chore(v2): generic styling improvements

This commit is contained in:
Yangshun Tay 2019-02-23 12:50:31 -08:00
parent c46a894a01
commit b33de00a32
16 changed files with 109 additions and 109 deletions

View file

@ -16,10 +16,10 @@ async function loadPages({pagesDir, env, siteConfig}) {
const {baseUrl} = siteConfig;
/* Prepare metadata container */
// Prepare metadata container.
const pagesMetadatas = [];
/* Translation */
// Translation.
const translationEnabled = idx(env, ['translation', 'enabled']);
const enabledLanguages =
translationEnabled && idx(env, ['translation', 'enabledLanguages']);
@ -33,7 +33,7 @@ async function loadPages({pagesDir, env, siteConfig}) {
const pathName = encodePath(fileToPath(relativeSource));
if (translationEnabled && enabledLangTags.length > 0) {
enabledLangTags.forEach(langTag => {
/* default lang should also be available. E.g: /en/users and /users is the same */
// Default lang should also be available. E.g: /en/users and /users is the same.
if (langTag === defaultLangTag) {
pagesMetadatas.push({
permalink: pathName.replace(/^\//, baseUrl),
@ -49,9 +49,8 @@ async function loadPages({pagesDir, env, siteConfig}) {
};
pagesMetadatas.push(metadata);
});
// for defaultLanguage
} else {
// Default Language.
const metadata = {
permalink: pathName.replace(/^\//, baseUrl),
source,