2025-2-26-fixed
This commit is contained in:
55
themes/fluid/scripts/generators/pages.js
Normal file
55
themes/fluid/scripts/generators/pages.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// generate 404 page
|
||||
if (!fs.existsSync(path.join(hexo.source_dir, '404.html'))) {
|
||||
hexo.extend.generator.register('_404', function(locals) {
|
||||
if (this.theme.config.page404.enable !== false) {
|
||||
return {
|
||||
path : '404.html',
|
||||
data : locals.theme,
|
||||
layout: '404'
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// generate tags Page
|
||||
hexo.extend.generator.register('_tags', function(locals) {
|
||||
if (this.theme.config.tag.enable !== false) {
|
||||
return {
|
||||
path : 'tags/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'tags'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate categories Page
|
||||
hexo.extend.generator.register('_categories', function(locals) {
|
||||
if (this.theme.config.category.enable !== false) {
|
||||
return {
|
||||
path : 'categories/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'categories'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate links page
|
||||
hexo.extend.generator.register('_links', function(locals) {
|
||||
if (this.theme.config.links.enable !== false) {
|
||||
return {
|
||||
path : 'links/index.html',
|
||||
data : locals.theme,
|
||||
layout: 'links'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// generate index page
|
||||
hexo.extend.generator.register('index', require('./index-generator'));
|
||||
Reference in New Issue
Block a user