diff --git a/src/router/indexRouter.js b/src/router/indexRouter.js index d58ea74..fabd22f 100644 --- a/src/router/indexRouter.js +++ b/src/router/indexRouter.js @@ -6,6 +6,7 @@ const { dirname } = require('path'); const thisDirectory = dirname(require.main.filename); const fs = require('fs'); const makeRss = require('../utils/rss'); +const langs = ["es", "en"] function addPaths(path, renderParams = {}){ let currentDefaultParams = {...renderParams} @@ -42,7 +43,6 @@ function addPaths(path, renderParams = {}){ } else{ if (file === 'partials' || file === 'layouts') return - addPaths(path + file + '/', currentDefaultParams) } } @@ -85,7 +85,7 @@ router.get('/update_log/rss', async (_req, res) => { rss.item({ title: "Update #" + i, description: `${u.link && ``}${u.description}${u.link && ``}`, - author: "Gor Down", + author: "Lyrical Tokarev", date: u.date }) }) diff --git a/src/utils/createCommonPath.js b/src/utils/createCommonPath.js index 3fd2b5f..0d571f3 100644 --- a/src/utils/createCommonPath.js +++ b/src/utils/createCommonPath.js @@ -1,6 +1,7 @@ const { dirname } = require('path'); const appDir = dirname(require.main.filename); const fs = require('fs') +const langs = ["es", "en"] function createCommonPath(router, path, renderParams = { }, cb = () => {}){ @@ -28,7 +29,16 @@ function createCommonPath(router, path, renderParams = { ...fileGeneralParams } } - router.get('/' + path, async (req, res) => { + renderOptions.lang = "es" + createPath('/' + path, cb, renderOptions, router) + langs.forEach(l => { + renderOptions.lang = l + createPath('/' + l + "/" + path, cb, renderOptions, router) + }) +} + +async function createPath(path, cb, renderOptions, router){ + router.get(path, async (req, res) => { const cb_params = await cb(req, res) renderOptions = {...renderOptions, ...cb_params} res.render(renderOptions.view, renderOptions) diff --git a/views/escudo.hbs b/views/escudo.hbs index 296b57b..d979feb 100644 --- a/views/escudo.hbs +++ b/views/escudo.hbs @@ -16,7 +16,7 @@

Blasonador: Cidoku

-

Armígero: Gor Down

+

Armígero: Lyrical Tokarev

Otorgado el: 9 de marzo, 2025