Skip to content

Commit

Permalink
fix(page): exclude code directory from processing
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Feb 15, 2025
1 parent caf9d9c commit ae5fae7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/plugins/processor/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import type { Stats } from 'fs';
import { PageSchema } from '../../types';

export = (ctx: Hexo) => {
let codeDir = ctx.config.code_dir;
if (!codeDir.endsWith('/')) codeDir += '/';
return {
pattern: new Pattern(path => {
if (isExcludedFile(path, ctx.config)) return;
if (path.startsWith(codeDir)) return;

return {
renderable: ctx.render.isRenderable(path) && !isMatch(path, ctx.config.skip_render)
Expand Down

0 comments on commit ae5fae7

Please sign in to comment.