-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pulls data from nodejs/Release#380 Fixes: #1889
- Loading branch information
1 parent
376193f
commit a159b1c
Showing
8 changed files
with
207 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{site.locale}}" {{#if site.rtl}}dir="rtl"{{/if}}> | ||
{{> html-head }} | ||
|
||
<body> | ||
{{> header }} | ||
|
||
<div id="main"> | ||
<div class="container has-side-nav"> | ||
|
||
{{> navigation key='about'}} | ||
|
||
<article> | ||
<h1>{{ title }}</h1> | ||
|
||
<p> | ||
<img alt="{{ title }}" src="https://raw.githubusercontent.com/nodejs/Release/master/schedule.png"> | ||
</p> | ||
|
||
{{{ release-schedule }}} | ||
|
||
<p> | ||
<small>{{ schedule-footer }}</small> | ||
</p> | ||
|
||
|
||
{{{ contents }}} | ||
</article> | ||
|
||
</div> | ||
</div> | ||
|
||
{{> footer }} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
table.release-schedule | ||
width 100% | ||
font-size 1rem | ||
border 1px solid $light-gray2 | ||
|
||
td | ||
padding 5px | ||
|
||
> thead | ||
font-weight 600 | ||
text-align left | ||
|
||
> tbody | ||
border-top 1px solid $light-gray2 | ||
|
||
tr:nth-child(odd) | ||
background-color $light-gray3 | ||
|
||
tr:nth-child(even) | ||
background-color $white |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
layout: about-release-schedule.hbs | ||
title: Release Schedule | ||
statuses: | ||
maintenance: 'Maintenance LTS' | ||
active: 'Active LTS' | ||
current: 'Current' | ||
pending: 'Pending' | ||
columns: | ||
- 'Release' | ||
- 'Status' | ||
- 'Codename' | ||
- 'Initial Release' | ||
- 'Active LTS Start' | ||
- 'Maintenance LTS Start' | ||
- 'End-of-life' | ||
schedule-footer: Dates are subject to change. | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'use strict' | ||
|
||
const schedule = require('../../source/schedule.json') | ||
|
||
const today = new Date() | ||
const datify = (release, key) => new Date(schedule[release][key]) | ||
|
||
module.exports = context => { | ||
const statuses = context.data.root.statuses | ||
|
||
const header = context.data.root.columns | ||
.map(column => `<th>${column}</th>\n`) | ||
.join('') | ||
|
||
let content = '' | ||
|
||
Object.keys(schedule) | ||
.filter(release => datify(release, 'end') > today) | ||
.forEach(release => { | ||
const codename = schedule[release].codename | ||
const codenameLink = codename | ||
? `<a href="https://nodejs.org/download/release/latest-${codename.toLowerCase()}/">${codename}</a>` | ||
: '' | ||
|
||
const releaseLink = datify(release, 'start') < today | ||
? `<a href="https://nodejs.org/download/release/latest-${release}.x/">${release}</a>` | ||
: release | ||
|
||
let status | ||
|
||
if (datify(release, 'start') > today) { | ||
status = statuses.pending | ||
} else if (!schedule[release].lts || datify(release, 'lts') > today) { | ||
status = statuses.current | ||
} else if (datify(release, 'maintenance') < today) { | ||
status = statuses.maintenance | ||
} else if (datify(release, 'lts') < today) { | ||
status = statuses.active | ||
} | ||
|
||
content += `<tr> | ||
<td>${releaseLink}</td> | ||
<td>${status}</td> | ||
<td>${codenameLink}</td> | ||
<td>${schedule[release].start || ''}</td> | ||
<td>${schedule[release].lts || ''}</td> | ||
<td>${schedule[release].maintenance || ''}</td> | ||
<td>${schedule[release].end || ''}</td> | ||
</tr>` | ||
}) | ||
|
||
return ` | ||
<table class="release-schedule"> | ||
<thead> | ||
<tr>${header}</tr> | ||
</thead> | ||
<tbody> | ||
${content} | ||
</tbody> | ||
</table> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"v0.10": { | ||
"start": "2013-03-11", | ||
"end": "2016-10-31" | ||
}, | ||
"v0.12": { | ||
"start": "2015-02-06", | ||
"end": "2016-12-31" | ||
}, | ||
"v4": { | ||
"start": "2015-09-08", | ||
"lts": "2015-10-12", | ||
"maintenance": "2017-04-01", | ||
"end": "2018-04-30", | ||
"codename": "Argon" | ||
}, | ||
"v5": { | ||
"start": "2015-10-29", | ||
"maintenance": "2016-04-30", | ||
"end": "2016-06-30" | ||
}, | ||
"v6": { | ||
"start": "2016-04-26", | ||
"lts": "2016-10-18", | ||
"maintenance": "2018-04-30", | ||
"end": "2019-04-01", | ||
"codename": "Boron" | ||
}, | ||
"v7": { | ||
"start": "2016-10-25", | ||
"maintenance": "2017-04-30", | ||
"end": "2017-06-30" | ||
}, | ||
"v8": { | ||
"start": "2017-05-30", | ||
"lts": "2017-10-31", | ||
"maintenance": "2019-04-01", | ||
"end": "2019-12-31", | ||
"codename": "Carbon" | ||
}, | ||
"v9": { | ||
"start": "2017-10-01", | ||
"maintenance": "2018-04-01", | ||
"end": "2018-06-30" | ||
}, | ||
"v10": { | ||
"start": "2018-04-24", | ||
"lts": "2018-10-30", | ||
"maintenance": "2020-04-01", | ||
"end": "2021-04-01", | ||
"codename": "Dubnium" | ||
}, | ||
"v11": { | ||
"start": "2018-10-23", | ||
"maintenance": "2019-04-01", | ||
"end": "2019-06-30" | ||
}, | ||
"v12": { | ||
"start": "2019-04-23", | ||
"lts": "2019-10-22", | ||
"maintenance": "2021-04-01", | ||
"end": "2022-04-01", | ||
"codename": "" | ||
} | ||
} |