repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/extend/injector.ts | test/scripts/extend/injector.ts | import Injector from '../../../lib/extend/injector';
describe('Injector', () => {
const content = [
'<!DOCTYPE html>',
'<html lang="en">',
'<head id="head"><title>Test</title>',
'</head>',
'<body id="body">',
'<div></div>',
'<p></p>',
'</body>',
'</html>'
].join('');
it('regi... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/extend/migrator.ts | test/scripts/extend/migrator.ts | import Migrator from '../../../lib/extend/migrator';
import chai from 'chai';
const should = chai.should();
describe('Migrator', () => {
const ctx = {};
it('register()', () => {
const d = new Migrator();
// name, fn
d.register('test', () => {});
d.get('test').should.exist;
// no name
// ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/extend/console.ts | test/scripts/extend/console.ts | import Console from '../../../lib/extend/console';
import chai from 'chai';
const should = chai.should();
describe('Console', () => {
const ctx = {};
it('register()', () => {
const c = new Console();
// no name
// @ts-expect-error
should.throw(() => c.register(), TypeError, 'name is required');
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/processors/post.ts | test/scripts/processors/post.ts |
import { join } from 'path';
import { exists, mkdirs, rmdir, unlink, writeFile } from 'hexo-fs';
import BluebirdPromise from 'bluebird';
import defaultConfig from '../../../lib/hexo/default_config';
import Hexo from '../../../lib/hexo';
import posts from '../../../lib/plugins/processor/post';
import chai from 'chai';
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | true |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/processors/common.ts | test/scripts/processors/common.ts | import moment from 'moment';
import { isTmpFile, isHiddenFile, toDate, adjustDateForTimezone, isMatch } from '../../../lib/plugins/processor/common';
import chai from 'chai';
const should = chai.should();
describe('common', () => {
it('isTmpFile()', () => {
isTmpFile('foo').should.be.false;
isTmpFile('foo%')... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/processors/data.ts | test/scripts/processors/data.ts | import BluebirdPromise from 'bluebird';
import { mkdirs, rmdir, unlink, writeFile } from 'hexo-fs';
import { join } from 'path';
import Hexo from '../../../lib/hexo';
import data from '../../../lib/plugins/processor/data';
import chai from 'chai';
const should = chai.should();
describe('data', () => {
const baseDir ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/processors/asset.ts | test/scripts/processors/asset.ts | import { dirname, join } from 'path';
import { mkdirs, rmdir, stat, unlink, writeFile } from 'hexo-fs';
import { spy } from 'sinon';
import Hexo from '../../../lib/hexo';
import defaults from '../../../lib/hexo/default_config';
import assets from '../../../lib/plugins/processor/asset';
import chai from 'chai';
const sh... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/theme_processors/config.ts | test/scripts/theme_processors/config.ts | import { spy, assert as sinonAssert } from 'sinon';
import { join } from 'path';
import { mkdirs, rmdir, unlink, writeFile} from 'hexo-fs';
import BluebirdPromise from 'bluebird';
import Hexo from '../../../lib/hexo';
import { config } from '../../../lib/theme/processors/config';
import chai from 'chai';
const should =... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/theme_processors/source.ts | test/scripts/theme_processors/source.ts | import { join } from 'path';
import { mkdirs, rmdir, unlink, writeFile } from 'hexo-fs';
import BluebirdPromise from 'bluebird';
import Hexo from '../../../lib/hexo';
import { source } from '../../../lib/theme/processors/source';
import chai from 'chai';
const should = chai.should();
type SourceParams = Parameters<type... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/theme_processors/i18n.ts | test/scripts/theme_processors/i18n.ts | import { join } from 'path';
import { mkdirs, rmdir, unlink, writeFile } from 'hexo-fs';
import BluebirdPromise from 'bluebird';
import Hexo from '../../../lib/hexo';
import { i18n } from '../../../lib/theme/processors/i18n';
import chai from 'chai';
const should = chai.should();
type I18nParams = Parameters<typeof i18... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/theme_processors/view.ts | test/scripts/theme_processors/view.ts | import { join } from 'path';
import { mkdirs, rmdir, unlink, writeFile } from 'hexo-fs';
import BluebirdPromise from 'bluebird';
import Hexo from '../../../lib/hexo';
import { view } from '../../../lib/theme/processors/view';
import chai from 'chai';
const should = chai.should();
type ViewParams = Parameters<typeof vie... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/box/file.ts | test/scripts/box/file.ts | import { join } from 'path';
import { rmdir, stat, statSync, writeFile } from 'hexo-fs';
import { load } from 'js-yaml';
import Hexo from '../../../lib/hexo';
import Box from '../../../lib/box';
describe('File', () => {
const hexo = new Hexo(__dirname);
const box = new Box(hexo, join(hexo.base_dir, 'file_test'));
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/scripts/box/box.ts | test/scripts/box/box.ts | import { join, sep } from 'path';
import { appendFile, mkdir, mkdirs, rename, rmdir, stat, unlink, writeFile } from 'hexo-fs';
import { hash, Pattern } from 'hexo-util';
import { spy, match, assert as sinonAssert } from 'sinon';
import BluebirdPromise from 'bluebird';
import Hexo from '../../../lib/hexo';
import Box fr... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/util/stream.ts | test/util/stream.ts | import Promise from 'bluebird';
export function readStream(stream): Promise<string> {
return new Promise((resolve, reject) => {
let data = '';
stream.on('data', chunk => {
data += chunk.toString();
}).on('end', () => {
resolve(data);
}).on('error', reject);
});
}
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/util/index.ts | test/util/index.ts | export { readStream } from './stream';
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/test/fixtures/post_render.ts | test/fixtures/post_render.ts | import { highlight } from 'hexo-util';
const code = [
'if tired && night:',
' sleep()'
].join('\n');
export const content = [
'# Title',
'``` python',
code,
'```',
'some content',
'',
'## Another title',
'{% blockquote %}',
'quote content 1',
'{% endblockquote %}',
'',
'{% quote Hello Wor... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/types.ts | lib/types.ts | import moment from 'moment';
import type default_config from './hexo/default_config';
import type i18n from 'hexo-i18n';
import type Query from 'warehouse/dist/query';
import type css from './plugins/helper/css';
import type { date, date_xml, time, full_date, relative_date, time_tag, moment as _moment } from './plugins... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/render.ts | lib/hexo/render.ts | import { extname } from 'path';
import Promise from 'bluebird';
import { readFile, readFileSync } from 'hexo-fs';
import type Hexo from './index';
import type { Renderer } from '../extend';
import type { StoreFunction, StoreFunctionData, StoreSyncFunction } from '../extend/renderer';
import { NodeJSLikeCallback } from ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/load_config.ts | lib/hexo/load_config.ts | import { sep, resolve, join, parse, basename, extname } from 'path';
import tildify from 'tildify';
import Theme from '../theme';
import Source from './source';
import { exists, readdir } from 'hexo-fs';
import { magenta } from 'picocolors';
import { deepMerge } from 'hexo-util';
import validateConfig from './validate_... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/scaffold.ts | lib/hexo/scaffold.ts | import { extname, join } from 'path';
import { exists, listDir, readFile, unlink, writeFile } from 'hexo-fs';
import type Hexo from './index';
import type { NodeJSLikeCallback } from '../types';
import type Promise from 'bluebird';
class Scaffold {
public context: Hexo;
public scaffoldDir: string;
public default... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/router.ts | lib/hexo/router.ts | import { EventEmitter } from 'events';
import Promise from 'bluebird';
import Stream from 'stream';
const { Readable } = Stream;
interface Data {
data: any;
modified: boolean;
}
class RouteStream extends Readable {
public _data: any;
public _ended: boolean;
public modified: boolean;
constructor(data: Dat... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/post.ts | lib/hexo/post.ts | import assert from 'assert';
import moment from 'moment';
import Promise from 'bluebird';
import { join, extname, basename } from 'path';
import { magenta } from 'picocolors';
import { load } from 'js-yaml';
import { slugize, escapeRegExp, deepMerge} from 'hexo-util';
import { copyDir, exists, listDir, mkdirs, readFile... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/multi_config_path.ts | lib/hexo/multi_config_path.ts | import { isAbsolute, resolve, join, extname } from 'path';
import { existsSync, readFileSync, writeFileSync } from 'hexo-fs';
import yml from 'js-yaml';
import { deepMerge } from 'hexo-util';
import type Hexo from './index';
export = (ctx: Hexo) => function multiConfigPath(base: string, configPaths?: string, outputDir... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/default_config.ts | lib/hexo/default_config.ts | export = {
// Site
title: 'Hexo',
subtitle: '',
description: '',
author: 'John Doe',
language: 'en',
timezone: '',
// URL
url: 'http://example.com',
root: '/',
permalink: ':year/:month/:day/:title/',
permalink_defaults: {} as Record<string, string>,
pretty_urls: {
trailing_index: true,
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/load_plugins.ts | lib/hexo/load_plugins.ts | import { join } from 'path';
import { exists, readFile, listDir } from 'hexo-fs';
import Promise from 'bluebird';
import { magenta } from 'picocolors';
import type Hexo from './index';
export = (ctx: Hexo): Promise<void[][]> => {
if (!ctx.env.init || ctx.env.safe) return;
return loadModules(ctx).then(() => loadSc... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/update_package.ts | lib/hexo/update_package.ts | import { join } from 'path';
import { writeFile, exists, readFile } from 'hexo-fs';
import type Hexo from './index';
import type Promise from 'bluebird';
export = (ctx: Hexo): Promise<void> => {
const pkgPath = join(ctx.base_dir, 'package.json');
return readPkg(pkgPath).then(pkg => {
if (!pkg) return;
ct... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/source.ts | lib/hexo/source.ts | import Box from '../box';
import type Hexo from './index';
class Source extends Box {
constructor(ctx: Hexo) {
super(ctx, ctx.source_dir);
this.processors = ctx.extend.processor.list();
}
}
export = Source;
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/load_theme_config.ts | lib/hexo/load_theme_config.ts | import { join, parse, basename, extname } from 'path';
import tildify from 'tildify';
import { exists, readdir } from 'hexo-fs';
import { magenta } from 'picocolors';
import { deepMerge } from 'hexo-util';
import type Hexo from './index';
import type Promise from 'bluebird';
export = (ctx: Hexo): Promise<void> => {
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/register_models.ts | lib/hexo/register_models.ts | import * as models from '../models';
import type Hexo from './index';
export = (ctx: Hexo): void => {
const db = ctx.database;
const keys = Object.keys(models);
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i];
db.model(key, models[key](ctx));
}
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/locals.ts | lib/hexo/locals.ts | import { Cache } from 'hexo-util';
class Locals {
public cache: InstanceType<typeof Cache>;
public getters: Record<string, () => any>;
constructor() {
this.cache = new Cache();
this.getters = {};
}
get(name: string): any {
if (typeof name !== 'string') throw new TypeError('name must be a string... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/index.ts | lib/hexo/index.ts | import Promise from 'bluebird';
import { sep, join, dirname } from 'path';
import tildify from 'tildify';
import Database from 'warehouse';
import { magenta, underline } from 'picocolors';
import { EventEmitter } from 'events';
import { readFile } from 'hexo-fs';
import Module from 'module';
import { runInThisContext }... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/load_database.ts | lib/hexo/load_database.ts | import { exists, unlink } from 'hexo-fs';
import Promise from 'bluebird';
import type Hexo from './index';
export = (ctx: Hexo): Promise<void> => {
if (ctx._dbLoaded) return Promise.resolve();
const db = ctx.database;
const { path } = db.options;
const { log } = ctx;
return exists(path).then(exist => {
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/hexo/validate_config.ts | lib/hexo/validate_config.ts | import assert from 'assert';
import type Hexo from './index';
export = (ctx: Hexo): void => {
const { config, log } = ctx;
log.info('Validating config');
// Validation for config.url && config.root
if (typeof config.url !== 'string') {
throw new TypeError(`Invalid config detected: "url" should be string,... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/page.ts | lib/models/page.ts | import warehouse from 'warehouse';
import { join } from 'path';
import Moment from './types/moment';
import moment from 'moment';
import { full_url_for } from 'hexo-util';
import type Hexo from '../hexo';
import type { PageSchema } from '../types';
export = (ctx: Hexo) => {
const Page = new warehouse.Schema<PageSche... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/post_category.ts | lib/models/post_category.ts | import warehouse from 'warehouse';
import type Hexo from '../hexo';
import { PostCategorySchema } from '../types';
export = (ctx: Hexo) => {
const PostCategory = new warehouse.Schema<PostCategorySchema>({
post_id: {type: warehouse.Schema.Types.CUID, ref: 'Post'},
category_id: {type: warehouse.Schema.Types.CU... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/post_asset.ts | lib/models/post_asset.ts | import warehouse from 'warehouse';
import { join, posix } from 'path';
import type Hexo from '../hexo';
import type { PostAssetSchema } from '../types';
export = (ctx: Hexo) => {
const PostAsset = new warehouse.Schema<PostAssetSchema>({
_id: {type: String, required: true},
slug: {type: String, required: true... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/tag.ts | lib/models/tag.ts | import warehouse from 'warehouse';
import { slugize, full_url_for } from 'hexo-util';
const { hasOwnProperty: hasOwn } = Object.prototype;
import type Hexo from '../hexo';
import type { TagSchema } from '../types';
export = (ctx: Hexo) => {
const Tag = new warehouse.Schema<TagSchema>({
name: {type: String, requi... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/post.ts | lib/models/post.ts | import warehouse from 'warehouse';
import moment from 'moment';
import { extname, join, sep } from 'path';
import Promise from 'bluebird';
import Moment from './types/moment';
import { full_url_for, Cache } from 'hexo-util';
import type Hexo from '../hexo';
import type { CategorySchema, PostCategorySchema, PostSchema }... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/cache.ts | lib/models/cache.ts | import warehouse from 'warehouse';
import Promise from 'bluebird';
import type Hexo from '../hexo';
import type fs from 'fs';
import type Document from 'warehouse/dist/document';
import type { CacheSchema } from '../types';
export = (_ctx: Hexo) => {
const Cache = new warehouse.Schema<CacheSchema>({
_id: {type: ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/data.ts | lib/models/data.ts | import warehouse from 'warehouse';
import type Hexo from '../hexo';
import { DataSchema } from '../types';
export = (_ctx: Hexo) => {
const Data = new warehouse.Schema<DataSchema>({
_id: {type: String, required: true},
data: Object
});
return Data;
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/asset.ts | lib/models/asset.ts | import warehouse from 'warehouse';
import { join } from 'path';
import type Hexo from '../hexo';
import type { AssetSchema } from '../types';
export = (ctx: Hexo) => {
const Asset = new warehouse.Schema<AssetSchema>({
_id: {type: String, required: true},
path: {type: String, required: true},
modified: {t... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/post_tag.ts | lib/models/post_tag.ts | import warehouse from 'warehouse';
import type Hexo from '../hexo';
import { PostTagSchema } from '../types';
export = (ctx: Hexo) => {
const PostTag = new warehouse.Schema<PostTagSchema>({
post_id: {type: warehouse.Schema.Types.CUID, ref: 'Post'},
tag_id: {type: warehouse.Schema.Types.CUID, ref: 'Tag'}
})... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/binary_relation_index.ts | lib/models/binary_relation_index.ts | import type Hexo from '../hexo';
type BinaryRelationType<K extends PropertyKey, V extends PropertyKey> = {
[key in K]: PropertyKey;
} & {
[key in V]: PropertyKey;
};
class BinaryRelationIndex<K extends PropertyKey, V extends PropertyKey> {
keyIndex: Map<PropertyKey, Set<PropertyKey>> = new Map();
valueIndex: ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/index.ts | lib/models/index.ts | export { default as Asset } from './asset';
export { default as Cache } from './cache';
export { default as Category } from './category';
export { default as Data } from './data';
export { default as Page } from './page';
export { default as Post } from './post';
export { default as PostAsset } from './post_asset';
exp... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/category.ts | lib/models/category.ts | import warehouse from 'warehouse';
import { slugize, full_url_for } from 'hexo-util';
import type Hexo from '../hexo';
import type { CategorySchema } from '../types';
export = (ctx: Hexo) => {
const Category = new warehouse.Schema<CategorySchema>({
name: {type: String, required: true},
parent: { type: wareho... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/models/types/moment.ts | lib/models/types/moment.ts | import warehouse from 'warehouse';
import { moment } from '../../plugins/helper/date';
// It'll pollute the moment module.
// declare module 'moment' {
// export default interface Moment extends moment.Moment {
// _d: Date;
// // eslint-disable-next-line semi
// }
// }
class SchemaTypeMoment extends warehou... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/renderer/json.ts | lib/plugins/renderer/json.ts | import type { StoreFunctionData } from '../../extend/renderer';
function jsonRenderer(data: StoreFunctionData): any {
return JSON.parse(data.text);
}
export = jsonRenderer;
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/renderer/plain.ts | lib/plugins/renderer/plain.ts | import type { StoreFunctionData } from '../../extend/renderer';
function plainRenderer(data: StoreFunctionData): string {
return data.text;
}
export = plainRenderer;
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/renderer/yaml.ts | lib/plugins/renderer/yaml.ts | import yaml from 'js-yaml';
import { escape } from 'hexo-front-matter';
import logger from 'hexo-log';
import type { StoreFunctionData } from '../../extend/renderer';
let schema: yaml.Schema;
// FIXME: workaround for https://github.com/hexojs/hexo/issues/4917
try {
schema = yaml.DEFAULT_SCHEMA.extend(require('js-yam... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/renderer/nunjucks.ts | lib/plugins/renderer/nunjucks.ts | import nunjucks, { Environment } from 'nunjucks';
import { readFileSync } from 'hexo-fs';
import { dirname } from 'path';
import type { StoreFunctionData } from '../../extend/renderer';
function toArray(value) {
if (Array.isArray(value)) {
// Return if given value is an Array
return value;
} else if (typeo... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/renderer/index.ts | lib/plugins/renderer/index.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => {
const { renderer } = ctx.extend;
const plain = require('./plain');
renderer.register('htm', 'html', plain, true);
renderer.register('html', 'html', plain, true);
renderer.register('css', 'css', plain, true);
renderer.register('js', 'js', plain... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/post_permalink.ts | lib/plugins/filter/post_permalink.ts | import { createSha1Hash, Permalink, slugize } from 'hexo-util';
import { basename } from 'path';
import type Hexo from '../../hexo';
import type { PostSchema } from '../../types';
let permalink: Permalink;
function postPermalinkFilter(this: Hexo, data: PostSchema): string {
const { config } = this;
const { id, _i... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/index.ts | lib/plugins/filter/index.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
require('./after_render')(ctx);
require('./after_post_render')(ctx);
require('./before_post_render')(ctx);
require('./before_exit')(ctx);
require('./before_generate')(ctx);
require('./template_locals')(ctx);
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/new_post_path.ts | lib/plugins/filter/new_post_path.ts | import { join, extname } from 'path';
import moment from 'moment';
import Promise from 'bluebird';
import { createSha1Hash, Permalink } from 'hexo-util';
import { ensurePath } from 'hexo-fs';
import type Hexo from '../../hexo';
import type { PostSchema } from '../../types';
let permalink: Permalink;
const reservedKey... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_post_render/backtick_code_block.ts | lib/plugins/filter/before_post_render/backtick_code_block.ts | import type { HighlightOptions } from '../../../extend/syntax_highlight';
import type Hexo from '../../../hexo';
import type { RenderData } from '../../../types';
const rBacktick = /^((?:(?:[^\S\r\n]*>){0,3}|[-*+]|[0-9]+\.)[^\S\r\n]*)(`{3,}|~{3,})[^\S\r\n]*((?:.*?[^`\s])?)[^\S\r\n]*\n((?:[\s\S]*?\n)?)(?:(?:[^\S\r\n]*>... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_post_render/titlecase.ts | lib/plugins/filter/before_post_render/titlecase.ts | import type { RenderData } from '../../../types';
let titlecase;
function titlecaseFilter(data: RenderData): void {
if (!(typeof data.titlecase !== 'undefined' ? data.titlecase : this.config.titlecase) || !data.title) return;
if (!titlecase) titlecase = require('titlecase');
data.title = titlecase(data.title);... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_post_render/index.ts | lib/plugins/filter/before_post_render/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('before_post_render', require('./backtick_code_block')(ctx));
filter.register('before_post_render', require('./titlecase'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_generate/render_post.ts | lib/plugins/filter/before_generate/render_post.ts | import Promise from 'bluebird';
import type Hexo from '../../../hexo';
import type Model from 'warehouse/dist/model';
function renderPostFilter(this: Hexo): Promise<[any[], any[]]> {
const renderPosts = (model: Model<any>) => {
const posts = model.toArray().filter(post => post.content == null);
return Promi... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_generate/index.ts | lib/plugins/filter/before_generate/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('before_generate', require('./render_post'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_post_render/external_link.ts | lib/plugins/filter/after_post_render/external_link.ts | import { isExternalLink } from 'hexo-util';
import type Hexo from '../../../hexo';
import type { RenderData } from '../../../types';
let EXTERNAL_LINK_POST_ENABLED = true;
const rATag = /<a(?:\s+?|\s+?[^<>]+?\s+?)href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
const rTargetAttr = /target=/i;
const rRelAttr = /rel=/... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_post_render/excerpt.ts | lib/plugins/filter/after_post_render/excerpt.ts | import type { RenderData } from '../../../types';
const rExcerpt = /<!-- ?more ?-->/i;
function excerptFilter(data: RenderData): void {
const { content } = data;
if (typeof data.excerpt !== 'undefined') {
data.more = content;
} else if (rExcerpt.test(content)) {
data.content = content.replace(rExcerpt,... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_post_render/index.ts | lib/plugins/filter/after_post_render/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('after_post_render', require('./external_link'));
filter.register('after_post_render', require('./excerpt'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/template_locals/i18n.ts | lib/plugins/filter/template_locals/i18n.ts | import { Pattern } from 'hexo-util';
import type Hexo from '../../../hexo';
import type { LocalsType } from '../../../types';
function i18nLocalsFilter(this: Hexo, locals: LocalsType): void {
const { i18n } = this.theme;
const { config } = this;
const i18nDir = config.i18n_dir;
const { page } = locals;
let l... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/template_locals/index.ts | lib/plugins/filter/template_locals/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('template_locals', require('./i18n'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_render/external_link.ts | lib/plugins/filter/after_render/external_link.ts | import { isExternalLink } from 'hexo-util';
import type Hexo from '../../../hexo';
let EXTERNAL_LINK_SITE_ENABLED = true;
const rATag = /<a(?:\s+?|\s+?[^<>]+?\s+?)href=["']((?:https?:|\/\/)[^<>"']+)["'][^<>]*>/gi;
const rTargetAttr = /target=/i;
const rRelAttr = /rel=/i;
const rRelStrAttr = /rel=["']([^<>"']*)["']/i;
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_render/meta_generator.ts | lib/plugins/filter/after_render/meta_generator.ts | import type Hexo from '../../../hexo';
let NEED_INJECT = true;
let HAS_CHECKED = false;
let META_GENERATOR_TAG;
function hexoMetaGeneratorInject(this: Hexo, data: string): string {
if (!NEED_INJECT) return;
if (!HAS_CHECKED) {
HAS_CHECKED = true;
if (!this.config.meta_generator
|| data.match(/<meta\s... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/after_render/index.ts | lib/plugins/filter/after_render/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('after_render:html', require('./external_link'));
filter.register('after_render:html', require('./meta_generator'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_exit/save_database.ts | lib/plugins/filter/before_exit/save_database.ts | import type Hexo from '../../../hexo';
function saveDatabaseFilter(this: Hexo): Promise<void> {
if (!this.env.init || !this._dbLoaded) return;
return this.database.save().then(() => {
this.log.debug('Database saved');
});
}
export = saveDatabaseFilter;
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/filter/before_exit/index.ts | lib/plugins/filter/before_exit/index.ts | import type Hexo from '../../../hexo';
export = (ctx: Hexo) => {
const { filter } = ctx.extend;
filter.register('before_exit', require('./save_database'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/generator/page.ts | lib/plugins/generator/page.ts | import type { BaseGeneratorReturn, PageSchema, SiteLocals } from '../../types';
import type Document from 'warehouse/dist/document';
type SimplePageGenerator = Omit<BaseGeneratorReturn, 'layout'> & { data: string };
interface NormalPageGenerator extends BaseGeneratorReturn {
layout: string[];
data: PageSchema;
}
t... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/generator/post.ts | lib/plugins/generator/post.ts | import type { BaseGeneratorReturn, PostSchema, SiteLocals } from '../../types';
import type Document from 'warehouse/dist/document';
type SimplePostGenerator = Omit<BaseGeneratorReturn, 'layout'> & { data: string };
interface NormalPostGenerator extends BaseGeneratorReturn {
data: PostSchema | Document<PostSchema>;
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/generator/asset.ts | lib/plugins/generator/asset.ts | import { exists, createReadStream } from 'hexo-fs';
import Promise from 'bluebird';
import { extname } from 'path';
import { magenta } from 'picocolors';
import type Hexo from '../../hexo';
import type { AssetSchema, BaseGeneratorReturn } from '../../types';
import type Document from 'warehouse/dist/document';
interfa... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/generator/index.ts | lib/plugins/generator/index.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => {
const { generator } = ctx.extend;
generator.register('asset', require('./asset'));
generator.register('page', require('./page'));
generator.register('post', require('./post'));
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/processor/post.ts | lib/plugins/processor/post.ts | import { toDate, adjustDateForTimezone, isExcludedFile, isTmpFile, isHiddenFile, isMatch } from './common';
import Promise from 'bluebird';
import { parse as yfm } from 'hexo-front-matter';
import { extname, join, posix, sep } from 'path';
import { stat, listDir } from 'hexo-fs';
import { slugize, Pattern, Permalink } ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/processor/common.ts | lib/plugins/processor/common.ts | import moment from 'moment-timezone';
import micromatch from 'micromatch';
const DURATION_MINUTE = 1000 * 60;
function isMatch(path: string, patterns?: string| string[]) {
if (!patterns) return false;
return micromatch.isMatch(path, patterns);
}
function isTmpFile(path: string) {
return path.endsWith('%') || ... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/processor/data.ts | lib/plugins/processor/data.ts | import { Pattern } from 'hexo-util';
import { extname } from 'path';
import type Hexo from '../../hexo';
import type { _File } from '../../box';
export = (ctx: Hexo) => ({
pattern: new Pattern('_data/*path'),
process: function dataProcessor(file: _File) {
const Data = ctx.model('Data');
const { path } = f... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/processor/asset.ts | lib/plugins/processor/asset.ts | import { adjustDateForTimezone, toDate, isExcludedFile, isMatch } from './common';
import Promise from 'bluebird';
import { parse as yfm } from 'hexo-front-matter';
import { extname, relative } from 'path';
import { Pattern } from 'hexo-util';
import { magenta } from 'picocolors';
import type { _File } from '../../box'... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/processor/index.ts | lib/plugins/processor/index.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => {
const { processor } = ctx.extend;
function register(name: string) {
const obj = require(`./${name}`)(ctx);
processor.register(obj.pattern, obj.process);
}
register('asset');
register('data');
register('post');
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/config.ts | lib/plugins/console/config.ts | import yaml from 'js-yaml';
import { exists, writeFile } from 'hexo-fs';
import { extname } from 'path';
import Promise from 'bluebird';
import type Hexo from '../../hexo';
interface ConfigArgs {
_: string[]
[key: string]: any
}
function configConsole(this: Hexo, args: ConfigArgs): Promise<void> {
const key = a... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/render.ts | lib/plugins/console/render.ts | import { resolve } from 'path';
import tildify from 'tildify';
import prettyHrtime from 'pretty-hrtime';
import { writeFile } from 'hexo-fs';
import { cyan, magenta } from 'picocolors';
import type Hexo from '../../hexo';
import type Promise from 'bluebird';
interface RenderArgs {
_: string[]
o?: string
output?:... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/publish.ts | lib/plugins/console/publish.ts | import tildify from 'tildify';
import { magenta } from 'picocolors';
import type Hexo from '../../hexo';
import type Promise from 'bluebird';
interface PublishArgs {
_: string[]
r?: boolean
replace?: boolean
[key: string]: any
}
function publishConsole(this: Hexo, args: PublishArgs): Promise<void> {
// Disp... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/migrate.ts | lib/plugins/console/migrate.ts | import { underline, magenta } from 'picocolors';
import type Hexo from '../../hexo';
interface MigrateArgs {
_: string[]
[key: string]: any
}
function migrateConsole(this: Hexo, args: MigrateArgs): Promise<any> {
// Display help message if user didn't input any arguments
if (!args._.length) {
return this.... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/index.ts | lib/plugins/console/index.ts | import type Hexo from '../../hexo';
export = function(ctx: Hexo) {
const { console } = ctx.extend;
console.register('clean', 'Remove generated files and cache.', require('./clean'));
console.register('config', 'Get or set configurations.', {
usage: '[name] [value]',
arguments: [
{name: 'name', de... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/generate.ts | lib/plugins/console/generate.ts | import { exists, writeFile, unlink, stat, mkdirs } from 'hexo-fs';
import { join } from 'path';
import Promise from 'bluebird';
import prettyHrtime from 'pretty-hrtime';
import { cyan, magenta } from 'picocolors';
import tildify from 'tildify';
import { PassThrough, type Readable } from 'stream';
import { createSha1Has... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/new.ts | lib/plugins/console/new.ts | import tildify from 'tildify';
import { magenta } from 'picocolors';
import { basename } from 'path';
import Hexo from '../../hexo';
import type Promise from 'bluebird';
const reservedKeys = {
_: true,
title: true,
layout: true,
slug: true,
s: true,
path: true,
p: true,
replace: true,
r: true,
// G... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/deploy.ts | lib/plugins/console/deploy.ts | import { exists } from 'hexo-fs';
import { underline, magenta } from 'picocolors';
import type Hexo from '../../hexo';
import type Promise from 'bluebird';
interface DeployArgs {
_?: string[]
g?: boolean
generate?: boolean
[key: string]: any
}
function deployConsole(this: Hexo, args: DeployArgs): Promise<any>... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/clean.ts | lib/plugins/console/clean.ts | import Promise from 'bluebird';
import { exists, unlink, rmdir } from 'hexo-fs';
import type Hexo from '../../hexo';
function cleanConsole(this: Hexo): Promise<[void, void, any]> {
return Promise.all([
deleteDatabase(this),
deletePublicDir(this),
this.execFilter('after_clean', null, {context: this})
])... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/page.ts | lib/plugins/console/list/page.ts | import { magenta, underline, gray } from 'picocolors';
import table from 'fast-text-table';
import { stringLength } from './common';
import type Hexo from '../../../hexo';
import type { PageSchema } from '../../../types';
import type Model from 'warehouse/dist/model';
import type Document from 'warehouse/dist/document'... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/tag.ts | lib/plugins/console/list/tag.ts | import { magenta, underline } from 'picocolors';
import table from 'fast-text-table';
import { stringLength } from './common';
import type Hexo from '../../../hexo';
import type { TagSchema } from '../../../types';
import type Model from 'warehouse/dist/model';
import type Document from 'warehouse/dist/document';
func... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/post.ts | lib/plugins/console/list/post.ts | import { gray, magenta, underline } from 'picocolors';
import table from 'fast-text-table';
import { stringLength } from './common';
import type Hexo from '../../../hexo';
import type { PostSchema } from '../../../types';
import type Model from 'warehouse/dist/model';
import type Document from 'warehouse/dist/document'... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/common.ts | lib/plugins/console/list/common.ts | import strip from 'strip-ansi';
export function stringLength(str: string): number {
str = strip(str);
const len = str.length;
let result = len;
// Detect double-byte characters
for (let i = 0; i < len; i++) {
if (str.charCodeAt(i) > 255) {
result++;
}
}
return result;
}
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/route.ts | lib/plugins/console/list/route.ts | import archy from 'fast-archy';
import type Hexo from '../../../hexo';
function listRoute(this: Hexo): void {
const routes = this.route.list().sort();
const tree = buildTree(routes);
const nodes = buildNodes(tree);
const s = archy({
label: `Total: ${routes.length}`,
nodes
});
console.log(s);
}
f... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/index.ts | lib/plugins/console/list/index.ts | import abbrev from 'abbrev';
import page from './page';
import post from './post';
import route from './route';
import tag from './tag';
import category from './category';
import type Hexo from '../../../hexo';
import type Promise from 'bluebird';
interface ListArgs {
_: string[]
}
const store = {
page, post, rou... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/console/list/category.ts | lib/plugins/console/list/category.ts | import { underline } from 'picocolors';
import table from 'fast-text-table';
import { stringLength } from './common';
import type Hexo from '../../../hexo';
import type { CategorySchema } from '../../../types';
import type Model from 'warehouse/dist/model';
import type Document from 'warehouse/dist/document';
function... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/injector/index.ts | lib/plugins/injector/index.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { injector } = ctx.extend;
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/helper/relative_url.ts | lib/plugins/helper/relative_url.ts | import { relative_url } from 'hexo-util';
export = function(from: string, to: string) {
return relative_url(from, to);
}
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/helper/image_tag.ts | lib/plugins/helper/image_tag.ts | import { htmlTag, url_for } from 'hexo-util';
import type { LocalsType } from '../../types';
interface Options {
src?: string;
alt?: string;
class?: string | string[];
}
interface Attrs {
src?: string;
class?: string;
[key: string]: string | undefined;
}
function imageTagHelper(this: LocalsType, path: st... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/helper/render.ts | lib/plugins/helper/render.ts | import type Hexo from '../../hexo';
export = (ctx: Hexo) => function render(text: string, engine: string, options:object = {}) {
return ctx.render.renderSync({
text,
engine
}, options);
};
| typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/helper/number_format.ts | lib/plugins/helper/number_format.ts | interface Options {
delimiter?: string;
separator?: string;
precision?: number | false;
}
function numberFormatHelper(num: number, options: Options = {}) {
const split = num.toString().split('.');
let before = split.shift();
let after = split.length ? split[0] : '';
const delimiter = options.delimiter ||... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
hexojs/hexo | https://github.com/hexojs/hexo/blob/1fd997c3ad772ab7ed85b71b886d55248d92bb68/lib/plugins/helper/toc.ts | lib/plugins/helper/toc.ts | import { tocObj, escapeHTML } from 'hexo-util';
interface Options {
min_depth?: number;
max_depth?: number;
max_items?: number;
class?: string;
class_item?: string;
class_link?: string;
class_text?: string;
class_child?: string;
class_number?: string;
class_level?: string;
list_number?: boolean;
... | typescript | MIT | 1fd997c3ad772ab7ed85b71b886d55248d92bb68 | 2026-01-04T15:50:29.521527Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.