@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
44 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Identity = void 0;
const log_1 = require("../../../../pkg/log");
const log = (0, log_1.getDomainLogger)('content', { component: 'identity' });
class Identity {
constructor(id, lang = '', langIdx = 0) {
this.stale = true; // 增量构建的 stale 标记
this.id = id;
this.lang = lang;
this.langIdx = langIdx;
}
ID() {
return this.id;
}
identifierBase() {
return `${this.id}-${this.lang}`;
}
pageLanguage() {
return this.lang;
}
pageLanguageIndex() {
return this.langIdx;
}
pageIdentity() {
return this;
}
// 增量构建相关的 stale 标记功能实现
markStale() {
if (!this.stale) {
this.stale = true;
}
}
isStale() {
return this.stale;
}
clearStale() {
if (this.stale) {
this.stale = false;
}
}
}
exports.Identity = Identity;
//# sourceMappingURL=identity.js.map