Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jul 25, 2023
1 parent b3b444d commit 1ef75e8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
6 changes: 3 additions & 3 deletions lib/box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ function readDirWalker(ctx, base, results, ignore, prefix) {
if (err && err.code === 'ENOENT') return null;
throw err;
});
const prefixdPath = `${prefix}${path}`;
const prefixPath = `${prefix}${path}`;
if (stats) {
if (stats.isDirectory()) {
return readDirWalker(ctx, fullpath, results, ignore, `${prefixdPath}/`);
return readDirWalker(ctx, fullpath, results, ignore, `${prefixPath}/`);
}
if (!isIgnoreMatch(fullpath, ignore)) {
results.push(prefixdPath);
results.push(prefixPath);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/extend/syntax_highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface HighlightOptions {
caption: string | undefined,
lines_length: number,

// plulgins/filter/before_post_render/backtick_code_block
// plugins/filter/before_post_render/backtick_code_block
firstLineNumber?: string | number

// plugins/tag/code.ts
Expand Down
6 changes: 3 additions & 3 deletions lib/extend/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ const formatNunjucksError = (err, input, source = '') => {
if (isNaN(errLine)) return err;

// trim useless info from Nunjucks Error
const splited = err.message.split('\n');
const splitted = err.message.split('\n');

const e = new NunjucksError();
e.name = 'Nunjucks Error';
e.line = errLine;
e.location = splited[0];
e.type = splited[1].trim();
e.location = splitted[0];
e.type = splitted[1].trim();
e.message = getContext(input.split(/\r?\n/), errLine, e.location, e.type).join('\n');
return e;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/hexo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ class Hexo extends EventEmitter {
}, []);
}

_routerReflesh(runningGenerators, useCache) {
_routerRefresh(runningGenerators, useCache) {
const { route } = this;
const routeList = route.list();
const Locals = this._generateLocals();
Expand Down Expand Up @@ -556,7 +556,7 @@ class Hexo extends EventEmitter {

// Run before_generate filters
return this.execFilter('before_generate', this.locals.get('data'), { context: this })
.then(() => this._routerReflesh(this._runGenerators(), useCache)).then(() => {
.then(() => this._routerRefresh(this._runGenerators(), useCache)).then(() => {
this.emit('generateAfter');

// Run after_generate filters
Expand Down
14 changes: 7 additions & 7 deletions lib/hexo/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,16 @@ class Post {

_renderScaffold(data) {
const { tag } = this.context.extend;
let splited;
let splitted;

return this._getScaffold(data.layout).then(scaffold => {
splited = yfmSplit(scaffold);
const jsonMode = splited.separator.startsWith(';');
splitted = yfmSplit(scaffold);
const jsonMode = splitted.separator.startsWith(';');
const frontMatter = prepareFrontMatter({ ...data }, jsonMode);

return tag.render(splited.data, frontMatter);
return tag.render(splitted.data, frontMatter);
}).then(frontMatter => {
const { separator } = splited;
const { separator } = splitted;
const jsonMode = separator.startsWith(';');

// Parse front-matter
Expand All @@ -310,14 +310,14 @@ class Post {

let content = '';
// Prepend the separator
if (splited.prefixSeparator) content += `${separator}\n`;
if (splitted.prefixSeparator) content += `${separator}\n`;

content += yfmStringify(obj, {
mode: jsonMode ? 'json' : ''
});

// Concat content
content += splited.content;
content += splitted.content;

if (data.content) {
content += `\n${data.content}`;
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/helper/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const showAll = (tags, options, ctx) => {
}
};

const pagenasionPartShow = (tags, options, ctx) => {
const paginationPartShow = (tags, options, ctx) => {
const {
current,
total,
Expand Down Expand Up @@ -156,7 +156,7 @@ function paginatorHelper(options: Options = {}) {
if (options.show_all) {
showAll(tags, options, this);
} else {
pagenasionPartShow(tags, options, this);
paginationPartShow(tags, options, this);
}

// Display the link to the next page
Expand Down
1 change: 0 additions & 1 deletion lib/plugins/renderer/nunjucks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import nunjucks from 'nunjucks';
import { readFileSync } from 'hexo-fs';
import { dirname } from 'path';
Expand Down

0 comments on commit 1ef75e8

Please sign in to comment.