Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Commit

Permalink
Merge pull request #269 from iojs/264_build_process
Browse files Browse the repository at this point in the history
build process #264
  • Loading branch information
therebelrobot committed Mar 5, 2015
2 parents 864daff + aa30a07 commit a5e0339
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 18 deletions.
31 changes: 19 additions & 12 deletions content/en/template.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"browser-title":"io.js - JavaScript I/O",
"contribute-message":"See something you like? Want to help? Visit https://github.com/iojs/website to contribute",
"heading-languages":"Languages",
"logo-text":"io.js",
"faq-link":"FAQ",
"es6-link":"ES6",
"api-link":"API Docs",
"issues-link":"GitHub Issues",
"org-link":"GitHub Org",
"irc-link":"IRC Chat",
"irc-logs-link":"Logs",
"gov-link":"Governance"
"browser-title": "io.js - JavaScript I/O",
"contribute-message": "See something you like? Want to help? Visit https://github.com/iojs/website to contribute",
"heading-languages": "Languages",
"logo-text": "io.js",
"faq-link": "FAQ",
"es6-link": "ES6",
"api-link": "API Docs",
"issues-link": "GitHub Issues",
"org-link": "GitHub Org",
"irc-link": "IRC Chat",
"irc-logs-link": "Logs",
"gov-link": "Governance",
"downloads": {
"linux": "Linux",
"win32": "Win32",
"win64": "Win64",
"mac": "Mac",
"all": "Others"
}
}
2 changes: 1 addition & 1 deletion gulp/tasks/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function generateContentAndTemplates() {
*/
base = path.resolve(__dirname, '..', '..'); /* 1 */
contentBase = path.resolve(base, 'content'); /* 2 */
projectJSON = require('../../source/project.json'); /* 3 */
projectJSON = require('../../source/project.js'); /* 3 */
i18nJSON = {}; /* 4 */
hbsTemplates = {}; /* 5 */

Expand Down
17 changes: 12 additions & 5 deletions gulp/util/template-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ var CONTENT_DIRECTORY = 'content';
// load template.json for given language, but use default language as fallback
// for properties which are not present in the given language
module.exports.loadTemplateJSON = function(lang) {
var defaultJSON = require('../../' + CONTENT_DIRECTORY + '/' + DEFAULT_LANG + '/template.json');
var defaultJSON = require('../../' + CONTENT_DIRECTORY + '/' + DEFAULT_LANG + '/template.json');
var templateJSON = require('../../' + CONTENT_DIRECTORY + '/' + lang + '/template.json');
var finalJSON = _.cloneDeep(defaultJSON);
_.forEach(templateJSON, function(value, key) {
finalJSON[key] = value;
});
var merge = function(targetJSON, customJSON) {
_.forEach(customJSON, function(value, key) {
if (typeof value === "object") {
merge(targetJSON[key], value)
} else {
targetJSON[key] = value;
}
});
}
merge(finalJSON, templateJSON)
return finalJSON;
};

Expand Down Expand Up @@ -39,4 +46,4 @@ module.exports.loadMdFiles = function(contentFiles, lang) {
return obj;
});
return templateFilesInThisLang;
};
};
46 changes: 46 additions & 0 deletions source/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// temporary merge to help avoid some merge confusion when landed:
var project = require('./project.json');

/*
// This will replace `./project.json`
project = {
"current_version": "1.4.3",
"current_v8": "4.1.0.21"
}
project.languages = [
{"code": "cn", "name": "简体中文", "name-en": "Chinese (Simple)"},
{"code": "de", "name": "Deutsch", "name-en": "German"},
{"code": "el", "name": "Ελληνικά", "name-en": "Greek"},
{"code": "en", "name": "English", "name-en": "English"},
{"code": "es", "name": "Español", "name-en": "Spanish"},
{"code": "fi", "name": "Suomi", "name-en": "Finnish"},
{"code": "fr", "name": "Français", "name-en": "French"},
{"code": "he", "name": "עברית", "name-en": "Hebrew", "rtl": true},
{"code": "id", "name": "Bahasa Indonesia", "name-en": "Indonesian"},
{"code": "it", "name": "Italiano", "name-en": "Italian"},
{"code": "ja", "name": "日本語", "name-en": "Japanese"},
{"code": "ko", "name": "한국어", "name-en": "Korean"},
{"code": "no", "name": "Norsk", "name-en": "Norwegian"},
{"code": "pt_BR", "name": "Português (BR)", "name-en": "Portuguese (Brazil)"},
{"code": "pt_PT", "name": "Português (PT)", "name-en": "Portuguese (Portugal)"},
{"code": "ru", "name": "Русский", "name-en": "Russian"},
{"code": "tr", "name": "Türkçe", "name-en": "Turkish"},
{"code": "uk", "name": "Українська", "name-en": "Ukrainian"},
{"code": "zh_TW", "name": "正體中文(台灣)", "name-en": "Chinese Traditional (Taiwan)"}
]
*/

var baseURL = `https://iojs.org/dist`;
project.current_version_downloads = [
{key: 'linux', url: `${baseURL}/v${project.current_version}/iojs-v${project.current_version}-linux-x64.tar.xz`},
{key: 'win32', url: `${baseURL}/v${project.current_version}/iojs-v${project.current_version}-x86.msi`},
{key: 'win64', url: `${baseURL}/v${project.current_version}/iojs-v${project.current_version}-x64.msi`},
{key: 'mac', url: `${baseURL}/v${project.current_version}/iojs-v${project.current_version}.pkg`},
{key: 'all', url: `${baseURL}/v${project.current_version}/`}
];
Object.defineProperty(project.current_version_downloads, 'all', {value: `${baseURL}/v${project.current_version}/`});

module.exports = project;

0 comments on commit a5e0339

Please sign in to comment.