Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: support multiple projects #50

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ncp = require('ncp');

const filterStylusPartials = require('./plugins/filter-stylus-partials');
const mapHandlebarsPartials = require('./plugins/map-handlebars-partials');
const versions = require('./source/versions');
const versions = require('./source/unified-versions');

/** Build **/

Expand Down Expand Up @@ -49,21 +49,26 @@ function traverse (obj, str) {
}

const source = {
project: {
versions,
currentVersion: versions[0].version
projects: {
iojs: {
versions: versions.iojs,
currentVersion: versions.iojs[0].version
},
nodejs: {
versions: versions.nodejs,
currentVersion: versions.nodejs[0].version
}
}
};


function buildlocale (locale) {
console.time('[metalsmith] build/' + locale + ' finished');
const siteJSON = path.join(__dirname, 'locale', locale, 'site.json');
const metalsmith = Metalsmith(__dirname);
metalsmith
.metadata({
site: require(siteJSON),
project: source.project,
projects: source.projects,
i18n: i18nJSON(locale)
})
.source(path.join(__dirname, 'locale', locale))
Expand Down
36 changes: 18 additions & 18 deletions layouts/download.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ section h2 {
<div class="download-hero full-width">
<ul class="no-padding">
<li>
<a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}-x86.msi">
<a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}-x86.msi">
<img src="/static/images/platform-icon-win.png" height="50" width="45" alt="">
Windows Installer
<p class="small color-lightgray pad-bottom-small">iojs-{{project.currentVersion}}-x86.msi</p>
<p class="small color-lightgray pad-bottom-small">iojs-{{projects.iojs.currentVersion}}-x86.msi</p>
</a>
</li>
<li>
<a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}.pkg">
<a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}.pkg">
<img src="/static/images/platform-icon-osx.png" height="50" width="45" alt="">
Macintosh Installer
<p class="small color-lightgray pad-bottom-small">iojs-{{project.currentVersion}}.pkg</p>
<p class="small color-lightgray pad-bottom-small">iojs-{{projects.iojs.currentVersion}}.pkg</p>
</a>
</li>
<li>
<a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}.tar.gz">
<a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}.tar.gz">
<img src="/static/images/platform-icon-generic.png" height="50" width="45" alt="">
Source Code
<p class="small color-lightgray pad-bottom-small">iojs-{{project.currentVersion}}.tar.gz</p>
<p class="small color-lightgray pad-bottom-small">iojs-{{projects.iojs.currentVersion}}.tar.gz</p>
</a>
</li>
</ul>
Expand All @@ -58,43 +58,43 @@ section h2 {
<tbody>
<tr>
<th>Windows Installer (.msi)</th>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}-x86.msi">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/x64/iojs-{{project.currentVersion}}-x64.msi">64-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}-x86.msi">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/x64/iojs-{{projects.iojs.currentVersion}}-x64.msi">64-bit</a></td>
</tr>

<tr>
<th>Windows Binary (.exe)</th>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/win-x86/iojs.exe">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/win-x64/iojs.exe">64-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/win-x86/iojs.exe">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/win-x64/iojs.exe">64-bit</a></td>
</tr>

<tr>
<th>Mac OS X Installer (.pkg)</th>
<td colspan="2"><a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}.pkg">Universal</a></td>
<td colspan="2"><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}.pkg">Universal</a></td>
</tr>

<tr>
<th>Mac OS X Binaries (.tar.gz)</th>
<td colspan="2"><a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}-darwin-x64.tar.gz">64-bit</a></td>
<td colspan="2"><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}-darwin-x64.tar.gz">64-bit</a></td>
</tr>

<tr>
<th>Linux Binaries (.tar.gz)</th>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}-linux-x86.tar.gz">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}-linux-x64.tar.gz">64-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}-linux-x86.tar.gz">32-bit</a></td>
<td><a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}-linux-x64.tar.gz">64-bit</a></td>
</tr>

<tr>
<th>Source Code</th>
<td colspan="2">
<a href="https://iojs.org/dist/{{project.currentVersion}}/iojs-{{project.currentVersion}}.tar.gz">iojs-{{project.currentVersion}}.tar.gz</a>
<a href="https://iojs.org/dist/{{projects.iojs.currentVersion}}/iojs-{{projects.iojs.currentVersion}}.tar.gz">iojs-{{projects.iojs.currentVersion}}.tar.gz</a>
</td>
</tr>
</tbody>
</table>

<p>
{{current-version}}: <strong>{{project.currentVersion}}</strong>
{{current-version}}: <strong>{{projects.iojs.currentVersion}}</strong>
</p>
<p>{{build-disclaimer}}</p>
</section>
Expand All @@ -119,7 +119,7 @@ section h2 {
</tr>
</thead>
<tbody>
{{#project.versions}}
{{#projects.iojs.versions}}
<tr>
<td data-label="Version">{{version}}</td>
<td data-label="Date"><time>{{date}}</time></td>
Expand All @@ -134,7 +134,7 @@ section h2 {
</a>
</td>
</tr>
{{/project.versions}}
{{/projects.iojs.versions}}
</tbody>
</table>
</section>
Expand Down
27 changes: 21 additions & 6 deletions layouts/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,28 @@
<div class="home-download">
<img src="/static/images/logo-hexagon.svg" alt="node.js" class="home-logo">
<div class="home-download-details">
<p class="home-download-version"><a href="https://iojs.org/dist/{{ project.currentVersion }}/">Version {{ project.currentVersion }}</a></p>
<p class="home-download-version"><a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/">Version {{ projects.nodejs.currentVersion }}</a></p>
<p class="home-download-list">
{{download-text}} <a href="https://iojs.org/dist/{{ project.currentVersion }}/iojs-{{ project.currentVersion }}-linux-x64.tar.xz">Linux</a>,
<a href="https://iojs.org/dist/{{ project.currentVersion }}/iojs-{{ project.currentVersion }}-x86.msi">Win32</a>,
<a href="https://iojs.org/dist/{{ project.currentVersion }}/iojs-{{ project.currentVersion }}-x64.msi">Win64</a>,
<a href="https://iojs.org/dist/{{ project.currentVersion }}/iojs-{{ project.currentVersion }}.pkg">Mac</a> &amp;
<a href="https://iojs.org/dist/{{ project.currentVersion }}/">Others</a>
{{download-text}} <a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/iojs-{{ projects.nodejs.currentVersion }}-linux-x64.tar.xz">Linux</a>,
<a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/iojs-{{ projects.nodejs.currentVersion }}-x86.msi">Win32</a>,
<a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/iojs-{{ projects.nodejs.currentVersion }}-x64.msi">Win64</a>,
<a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/iojs-{{ projects.nodejs.currentVersion }}.pkg">Mac</a> &amp;
<a href="https://iojs.org/dist/{{ projects.nodejs.currentVersion }}/">Others</a>
</p>
<p><a href="https://github.com/nodejs/io.js/blob/master/CHANGELOG.md">Changelog</a></p>
</div>
</div>

<div class="home-download" style="margin-top: 20px;">
<img src="/static/images/iojs-logo.png" alt="io.js" class="home-logo">
<div class="home-download-details">
<p class="home-download-version"><a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/">Version {{ projects.iojs.currentVersion }}</a></p>
<p class="home-download-list">
{{download-text}} <a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/iojs-{{ projects.iojs.currentVersion }}-linux-x64.tar.xz">Linux</a>,
<a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/iojs-{{ projects.iojs.currentVersion }}-x86.msi">Win32</a>,
<a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/iojs-{{ projects.iojs.currentVersion }}-x64.msi">Win64</a>,
<a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/iojs-{{ projects.iojs.currentVersion }}.pkg">Mac</a> &amp;
<a href="https://iojs.org/dist/{{ projects.iojs.currentVersion }}/">Others</a>
</p>
<p><a href="https://github.com/nodejs/io.js/blob/master/CHANGELOG.md">Changelog</a></p>
</div>
Expand Down
Loading