Skip to content

Commit

Permalink
Add _ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Aug 14, 2024
1 parent 1a87576 commit 82d33ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/assets/js/app-globalping.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('./polyfills');
const http = require('./utils/http');

const _ = require('./_');
const cGlobalping = require('../../views/pages/globalping/index.html');
const cGlobalping = require('../../views/pages/globalping/_index.html');
const cGlobalpingCli = require('../../views/pages/globalping/cli.html');
const cGlobalpingSlack = require('../../views/pages/globalping/slack.html');
const cGlobalpingNetworkTools = require('../../views/pages/globalping/network-tools.html');
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ koaElasticUtils.addRoutes(router, [
};

try {
ctx.body = await ctx.render('pages/' + (ctx.path === '/' ? '_index' : ctx.path === '/globalping' ? 'globalping/index' : ctx.path) + '.html', data);
ctx.body = await ctx.render('pages/' + (ctx.path === '/' ? '_index' : ctx.path === '/globalping' ? 'globalping/_index' : ctx.path) + '.html', data);
ctx.maxAge = 5 * 60;
} catch (e) {
if (app.env === 'development') {
Expand Down
3 changes: 2 additions & 1 deletion src/middleware/sitemap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ let packagesPromise = updatePackages();

module.exports = async (ctx) => {
ctx.params.page = ctx.params.page.replace(/\.xml$/, '');
let pages = (await readDirRecursive(viewsPath + '/pages', [ '_*' ])).map(p => path.relative(viewsPath + '/pages', p).replace(/\\/g, '/').slice(0, -5).replace(/\/index$/, ''));
let pages = (await readDirRecursive(viewsPath + '/pages', [ '_*' ])).map(p => path.relative(viewsPath + '/pages', p).replace(/\\/g, '/').slice(0, -5));
let packages = await packagesPromise;
let maxPage = Math.ceil(packages.length / 50000);
let page = Number(ctx.params.page);

pages.push(
'globalping',
'oss-cdn/cocoa',
'oss-cdn/ghost',
'oss-cdn/musescore',
Expand Down
File renamed without changes.

0 comments on commit 82d33ad

Please sign in to comment.