@zeropress/build-pages 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -33
- package/action.yml +1 -1
- package/dist/action.js +303 -142
- package/dist/prebuild.js +303 -25
- package/package.json +2 -2
- package/schemas/zeropress-build-pages.config.v0.1.schema.json +110 -3
- package/src/index.js +71 -13
- package/src/prebuild.js +349 -26
- package/themes/docs/404.html +13 -2
- package/themes/docs/assets/style.css +861 -253
- package/themes/docs/assets/theme.js +236 -4
- package/themes/docs/layout.html +58 -15
- package/themes/docs/page.html +12 -13
- package/themes/docs/partials/theme-bootstrap.html +10 -0
- package/themes/docs/post.html +37 -7
- package/themes/docs/theme.json +9 -4
package/dist/action.js
CHANGED
|
@@ -52317,6 +52317,7 @@ function validateSite(site, path4, errors) {
|
|
|
52317
52317
|
"media_base_url",
|
|
52318
52318
|
"media_delivery_mode",
|
|
52319
52319
|
"favicon",
|
|
52320
|
+
"logo",
|
|
52320
52321
|
"expose_generator",
|
|
52321
52322
|
"search",
|
|
52322
52323
|
"locale",
|
|
@@ -52346,6 +52347,9 @@ function validateSite(site, path4, errors) {
|
|
|
52346
52347
|
if (site.favicon !== void 0) {
|
|
52347
52348
|
validateSiteFavicon(site.favicon, `${path4}.favicon`, errors);
|
|
52348
52349
|
}
|
|
52350
|
+
if (site.logo !== void 0) {
|
|
52351
|
+
validateSiteLogo(site.logo, `${path4}.logo`, errors);
|
|
52352
|
+
}
|
|
52349
52353
|
if (site.expose_generator !== void 0) {
|
|
52350
52354
|
validateBoolean(site.expose_generator, `${path4}.expose_generator`, "INVALID_SITE_EXPOSE_GENERATOR", errors);
|
|
52351
52355
|
}
|
|
@@ -52625,6 +52629,16 @@ function validateSiteFavicon(favicon, path4, errors) {
|
|
|
52625
52629
|
}
|
|
52626
52630
|
}
|
|
52627
52631
|
}
|
|
52632
|
+
function validateSiteLogo(logo, path4, errors) {
|
|
52633
|
+
validateClosedObject(logo, path4, errors, ["src", "alt"]);
|
|
52634
|
+
if (!isObject(logo)) {
|
|
52635
|
+
return;
|
|
52636
|
+
}
|
|
52637
|
+
validateUrlLike(logo.src, `${path4}.src`, "INVALID_SITE_LOGO_URL", errors);
|
|
52638
|
+
if (logo.alt !== void 0) {
|
|
52639
|
+
validateString(logo.alt, `${path4}.alt`, "INVALID_SITE_LOGO_ALT", errors);
|
|
52640
|
+
}
|
|
52641
|
+
}
|
|
52628
52642
|
function validatePreviewMedia(media, path4, errors) {
|
|
52629
52643
|
validateClosedObject(media, path4, errors, ["src", "width", "height", "alt"]);
|
|
52630
52644
|
if (!isObject(media)) {
|
|
@@ -53014,11 +53028,14 @@ function isOptionalKey(path4, key) {
|
|
|
53014
53028
|
return key === "head_end" || key === "body_end";
|
|
53015
53029
|
}
|
|
53016
53030
|
if (path4 === "site") {
|
|
53017
|
-
return key === "media_delivery_mode" || key === "favicon" || key === "expose_generator" || key === "search" || key === "indexing" || key === "permalinks" || key === "front_page" || key === "post_index" || key === "footer" || key === "meta";
|
|
53031
|
+
return key === "media_delivery_mode" || key === "favicon" || key === "logo" || key === "expose_generator" || key === "search" || key === "indexing" || key === "permalinks" || key === "front_page" || key === "post_index" || key === "footer" || key === "meta";
|
|
53018
53032
|
}
|
|
53019
53033
|
if (path4 === "site.favicon") {
|
|
53020
53034
|
return key === "icon" || key === "svg" || key === "png" || key === "apple_touch_icon";
|
|
53021
53035
|
}
|
|
53036
|
+
if (path4 === "site.logo") {
|
|
53037
|
+
return key === "alt";
|
|
53038
|
+
}
|
|
53022
53039
|
if (path4 === "site.footer") {
|
|
53023
53040
|
return key === "copyright_text" || key === "attribution";
|
|
53024
53041
|
}
|
|
@@ -53679,7 +53696,7 @@ async function validateThemeFiles(fileMap, options2 = {}) {
|
|
|
53679
53696
|
}
|
|
53680
53697
|
const content = getText(files.get(templatePath));
|
|
53681
53698
|
templateContents.set(templatePath, content);
|
|
53682
|
-
validateTemplateSyntax(templatePath, content, { errors, runtime: manifest?.runtime || DEFAULT_RUNTIME });
|
|
53699
|
+
validateTemplateSyntax(templatePath, content, { errors, warnings, runtime: manifest?.runtime || DEFAULT_RUNTIME });
|
|
53683
53700
|
}
|
|
53684
53701
|
for (const [filePath, value] of files.entries()) {
|
|
53685
53702
|
if (!filePath.startsWith("partials/") || !filePath.endsWith(".html")) {
|
|
@@ -53688,7 +53705,7 @@ async function validateThemeFiles(fileMap, options2 = {}) {
|
|
|
53688
53705
|
const partialName = filePath.slice("partials/".length, -".html".length);
|
|
53689
53706
|
const content = getText(value);
|
|
53690
53707
|
partialContents.set(partialName, content);
|
|
53691
|
-
validateTemplateSyntax(filePath, content, { errors, runtime: manifest?.runtime || DEFAULT_RUNTIME });
|
|
53708
|
+
validateTemplateSyntax(filePath, content, { errors, warnings, runtime: manifest?.runtime || DEFAULT_RUNTIME });
|
|
53692
53709
|
}
|
|
53693
53710
|
validatePartialReferences(templateContents, partialContents, { errors, runtime: manifest?.runtime || DEFAULT_RUNTIME });
|
|
53694
53711
|
return {
|
|
@@ -53905,10 +53922,22 @@ function validateManifest(themeJson) {
|
|
|
53905
53922
|
return { errors, manifest: errors.length > 0 ? void 0 : manifest };
|
|
53906
53923
|
}
|
|
53907
53924
|
function validateTemplateSyntax(templatePath, content, context) {
|
|
53908
|
-
const { errors } = context;
|
|
53925
|
+
const { errors, warnings = [] } = context;
|
|
53909
53926
|
const slotRegex = /\{\{slot:([a-zA-Z0-9_-]+)\}\}/g;
|
|
53910
53927
|
const contentSlotMatches = content.match(/\{\{slot:content\}\}/g) || [];
|
|
53911
53928
|
if (templatePath === "layout.html") {
|
|
53929
|
+
if (!startsWithHtmlDoctype(content)) {
|
|
53930
|
+
warnings.push(issue2(
|
|
53931
|
+
"MISSING_DOCTYPE",
|
|
53932
|
+
"layout.html",
|
|
53933
|
+
"layout.html should start with <!doctype html> to keep browsers in standards mode",
|
|
53934
|
+
"warning",
|
|
53935
|
+
{
|
|
53936
|
+
category: "theme_validation",
|
|
53937
|
+
hint: "Add <!doctype html> before the opening <html> tag."
|
|
53938
|
+
}
|
|
53939
|
+
));
|
|
53940
|
+
}
|
|
53912
53941
|
if (contentSlotMatches.length !== 1) {
|
|
53913
53942
|
errors.push(issue2("INVALID_LAYOUT_SLOT", "layout.html", "layout.html must contain exactly one {{slot:content}}", "error"));
|
|
53914
53943
|
}
|
|
@@ -53940,6 +53969,9 @@ function validateTemplateSyntax(templatePath, content, context) {
|
|
|
53940
53969
|
}
|
|
53941
53970
|
validateRuntimeV05TemplateSyntax(templatePath, content, errors);
|
|
53942
53971
|
}
|
|
53972
|
+
function startsWithHtmlDoctype(content) {
|
|
53973
|
+
return /^\s*(?:<!--[\s\S]*?-->\s*)*<!doctype\s+html\s*>/i.test(content);
|
|
53974
|
+
}
|
|
53943
53975
|
function validateRuntimeV05TemplateSyntax(templatePath, content, errors) {
|
|
53944
53976
|
const stack = [];
|
|
53945
53977
|
let index = 0;
|
|
@@ -54591,6 +54623,7 @@ function escapeRegex(str) {
|
|
|
54591
54623
|
var utils_exports = {};
|
|
54592
54624
|
__export(utils_exports, {
|
|
54593
54625
|
arrayReplaceAt: () => arrayReplaceAt,
|
|
54626
|
+
asciiTrim: () => asciiTrim,
|
|
54594
54627
|
assign: () => assign,
|
|
54595
54628
|
escapeHtml: () => escapeHtml,
|
|
54596
54629
|
escapeRE: () => escapeRE,
|
|
@@ -54598,6 +54631,7 @@ __export(utils_exports, {
|
|
|
54598
54631
|
has: () => has,
|
|
54599
54632
|
isMdAsciiPunct: () => isMdAsciiPunct,
|
|
54600
54633
|
isPunctChar: () => isPunctChar,
|
|
54634
|
+
isPunctCharCode: () => isPunctCharCode,
|
|
54601
54635
|
isSpace: () => isSpace,
|
|
54602
54636
|
isString: () => isString,
|
|
54603
54637
|
isValidEntityCode: () => isValidEntityCode,
|
|
@@ -55425,6 +55459,9 @@ var xmlDecoder = getDecoder(decode_data_xml_default);
|
|
|
55425
55459
|
function decodeHTML(str, mode = DecodingMode.Legacy) {
|
|
55426
55460
|
return htmlDecoder(str, mode);
|
|
55427
55461
|
}
|
|
55462
|
+
function decodeHTMLStrict(str) {
|
|
55463
|
+
return htmlDecoder(str, DecodingMode.Strict);
|
|
55464
|
+
}
|
|
55428
55465
|
|
|
55429
55466
|
// node_modules/entities/lib/esm/generated/encode-html.js
|
|
55430
55467
|
function restoreDiff(arr) {
|
|
@@ -55650,6 +55687,9 @@ function isWhiteSpace(code2) {
|
|
|
55650
55687
|
function isPunctChar(ch) {
|
|
55651
55688
|
return regex_default4.test(ch) || regex_default5.test(ch);
|
|
55652
55689
|
}
|
|
55690
|
+
function isPunctCharCode(code2) {
|
|
55691
|
+
return isPunctChar(fromCodePoint2(code2));
|
|
55692
|
+
}
|
|
55653
55693
|
function isMdAsciiPunct(ch) {
|
|
55654
55694
|
switch (ch) {
|
|
55655
55695
|
case 33:
|
|
@@ -55696,6 +55736,24 @@ function normalizeReference(str) {
|
|
|
55696
55736
|
}
|
|
55697
55737
|
return str.toLowerCase().toUpperCase();
|
|
55698
55738
|
}
|
|
55739
|
+
function isAsciiTrimmable(c) {
|
|
55740
|
+
return c === 32 || c === 9 || c === 10 || c === 13;
|
|
55741
|
+
}
|
|
55742
|
+
function asciiTrim(str) {
|
|
55743
|
+
let start = 0;
|
|
55744
|
+
for (; start < str.length; start++) {
|
|
55745
|
+
if (!isAsciiTrimmable(str.charCodeAt(start))) {
|
|
55746
|
+
break;
|
|
55747
|
+
}
|
|
55748
|
+
}
|
|
55749
|
+
let end = str.length - 1;
|
|
55750
|
+
for (; end >= start; end--) {
|
|
55751
|
+
if (!isAsciiTrimmable(str.charCodeAt(end))) {
|
|
55752
|
+
break;
|
|
55753
|
+
}
|
|
55754
|
+
}
|
|
55755
|
+
return str.slice(start, end + 1);
|
|
55756
|
+
}
|
|
55699
55757
|
var lib = { mdurl: mdurl_exports, ucmicro: uc_exports };
|
|
55700
55758
|
|
|
55701
55759
|
// node_modules/markdown-it/lib/helpers/index.mjs
|
|
@@ -56448,12 +56506,27 @@ function replace(state) {
|
|
|
56448
56506
|
var QUOTE_TEST_RE = /['"]/;
|
|
56449
56507
|
var QUOTE_RE = /['"]/g;
|
|
56450
56508
|
var APOSTROPHE = "\u2019";
|
|
56451
|
-
function
|
|
56452
|
-
|
|
56509
|
+
function addReplacement(replacements, tokenIdx, pos, ch) {
|
|
56510
|
+
if (!replacements[tokenIdx]) {
|
|
56511
|
+
replacements[tokenIdx] = [];
|
|
56512
|
+
}
|
|
56513
|
+
replacements[tokenIdx].push({ pos, ch });
|
|
56514
|
+
}
|
|
56515
|
+
function applyReplacements(str, replacements) {
|
|
56516
|
+
let result = "";
|
|
56517
|
+
let lastPos = 0;
|
|
56518
|
+
replacements.sort((a, b) => a.pos - b.pos);
|
|
56519
|
+
for (let i = 0; i < replacements.length; i++) {
|
|
56520
|
+
const replacement = replacements[i];
|
|
56521
|
+
result += str.slice(lastPos, replacement.pos) + replacement.ch;
|
|
56522
|
+
lastPos = replacement.pos + 1;
|
|
56523
|
+
}
|
|
56524
|
+
return result + str.slice(lastPos);
|
|
56453
56525
|
}
|
|
56454
56526
|
function process_inlines(tokens, state) {
|
|
56455
56527
|
let j;
|
|
56456
56528
|
const stack = [];
|
|
56529
|
+
const replacements = {};
|
|
56457
56530
|
for (let i = 0; i < tokens.length; i++) {
|
|
56458
56531
|
const token = tokens[i];
|
|
56459
56532
|
const thisLevel = tokens[i].level;
|
|
@@ -56466,9 +56539,9 @@ function process_inlines(tokens, state) {
|
|
|
56466
56539
|
if (token.type !== "text") {
|
|
56467
56540
|
continue;
|
|
56468
56541
|
}
|
|
56469
|
-
|
|
56542
|
+
const text2 = token.content;
|
|
56470
56543
|
let pos = 0;
|
|
56471
|
-
|
|
56544
|
+
const max = text2.length;
|
|
56472
56545
|
OUTER:
|
|
56473
56546
|
while (pos < max) {
|
|
56474
56547
|
QUOTE_RE.lastIndex = pos;
|
|
@@ -56502,8 +56575,8 @@ function process_inlines(tokens, state) {
|
|
|
56502
56575
|
break;
|
|
56503
56576
|
}
|
|
56504
56577
|
}
|
|
56505
|
-
const isLastPunctChar = isMdAsciiPunct(lastChar) ||
|
|
56506
|
-
const isNextPunctChar = isMdAsciiPunct(nextChar) ||
|
|
56578
|
+
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
|
|
56579
|
+
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
|
|
56507
56580
|
const isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
56508
56581
|
const isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
56509
56582
|
if (isNextWhiteSpace) {
|
|
@@ -56531,7 +56604,7 @@ function process_inlines(tokens, state) {
|
|
|
56531
56604
|
}
|
|
56532
56605
|
if (!canOpen && !canClose) {
|
|
56533
56606
|
if (isSingle) {
|
|
56534
|
-
|
|
56607
|
+
addReplacement(replacements, i, t.index, APOSTROPHE);
|
|
56535
56608
|
}
|
|
56536
56609
|
continue;
|
|
56537
56610
|
}
|
|
@@ -56552,18 +56625,8 @@ function process_inlines(tokens, state) {
|
|
|
56552
56625
|
openQuote = state.md.options.quotes[0];
|
|
56553
56626
|
closeQuote = state.md.options.quotes[1];
|
|
56554
56627
|
}
|
|
56555
|
-
|
|
56556
|
-
|
|
56557
|
-
tokens[item.token].content,
|
|
56558
|
-
item.pos,
|
|
56559
|
-
openQuote
|
|
56560
|
-
);
|
|
56561
|
-
pos += closeQuote.length - 1;
|
|
56562
|
-
if (item.token === i) {
|
|
56563
|
-
pos += openQuote.length - 1;
|
|
56564
|
-
}
|
|
56565
|
-
text2 = token.content;
|
|
56566
|
-
max = text2.length;
|
|
56628
|
+
addReplacement(replacements, i, t.index, closeQuote);
|
|
56629
|
+
addReplacement(replacements, item.token, item.pos, openQuote);
|
|
56567
56630
|
stack.length = j;
|
|
56568
56631
|
continue OUTER;
|
|
56569
56632
|
}
|
|
@@ -56577,10 +56640,13 @@ function process_inlines(tokens, state) {
|
|
|
56577
56640
|
level: thisLevel
|
|
56578
56641
|
});
|
|
56579
56642
|
} else if (canClose && isSingle) {
|
|
56580
|
-
|
|
56643
|
+
addReplacement(replacements, i, t.index, APOSTROPHE);
|
|
56581
56644
|
}
|
|
56582
56645
|
}
|
|
56583
56646
|
}
|
|
56647
|
+
Object.keys(replacements).forEach(function(tokenIdx) {
|
|
56648
|
+
tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]);
|
|
56649
|
+
});
|
|
56584
56650
|
}
|
|
56585
56651
|
function smartquotes(state) {
|
|
56586
56652
|
if (!state.md.options.typographer) {
|
|
@@ -57769,10 +57835,13 @@ function html_block(state, startLine, endLine, silent) {
|
|
|
57769
57835
|
return HTML_SEQUENCES[i][2];
|
|
57770
57836
|
}
|
|
57771
57837
|
let nextLine = startLine + 1;
|
|
57838
|
+
const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
|
|
57772
57839
|
if (!HTML_SEQUENCES[i][1].test(lineText)) {
|
|
57773
57840
|
for (; nextLine < endLine; nextLine++) {
|
|
57774
57841
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
57775
|
-
|
|
57842
|
+
if (endsOnBlankLine || !state.isEmpty(nextLine)) {
|
|
57843
|
+
break;
|
|
57844
|
+
}
|
|
57776
57845
|
}
|
|
57777
57846
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
57778
57847
|
max = state.eMarks[nextLine];
|
|
@@ -57825,7 +57894,7 @@ function heading(state, startLine, endLine, silent) {
|
|
|
57825
57894
|
token_o.markup = "########".slice(0, level);
|
|
57826
57895
|
token_o.map = [startLine, state.line];
|
|
57827
57896
|
const token_i = state.push("inline", "", 0);
|
|
57828
|
-
token_i.content = state.src.slice(pos, max)
|
|
57897
|
+
token_i.content = asciiTrim(state.src.slice(pos, max));
|
|
57829
57898
|
token_i.map = [startLine, state.line];
|
|
57830
57899
|
token_i.children = [];
|
|
57831
57900
|
const token_c = state.push("heading_close", "h" + String(level), -1);
|
|
@@ -57878,9 +57947,10 @@ function lheading(state, startLine, endLine) {
|
|
|
57878
57947
|
}
|
|
57879
57948
|
}
|
|
57880
57949
|
if (!level) {
|
|
57950
|
+
state.parentType = oldParentType;
|
|
57881
57951
|
return false;
|
|
57882
57952
|
}
|
|
57883
|
-
const content = state.getLines(startLine, nextLine, state.blkIndent, false)
|
|
57953
|
+
const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
|
|
57884
57954
|
state.line = nextLine + 1;
|
|
57885
57955
|
const token_o = state.push("heading_open", "h" + String(level), 1);
|
|
57886
57956
|
token_o.markup = String.fromCharCode(marker);
|
|
@@ -57919,7 +57989,7 @@ function paragraph(state, startLine, endLine) {
|
|
|
57919
57989
|
break;
|
|
57920
57990
|
}
|
|
57921
57991
|
}
|
|
57922
|
-
const content = state.getLines(startLine, nextLine, state.blkIndent, false)
|
|
57992
|
+
const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
|
|
57923
57993
|
state.line = nextLine;
|
|
57924
57994
|
const token_o = state.push("paragraph_open", "p", 1);
|
|
57925
57995
|
token_o.map = [startLine, state.line];
|
|
@@ -58058,15 +58128,37 @@ StateInline.prototype.push = function(type, tag, nesting) {
|
|
|
58058
58128
|
StateInline.prototype.scanDelims = function(start, canSplitWord) {
|
|
58059
58129
|
const max = this.posMax;
|
|
58060
58130
|
const marker = this.src.charCodeAt(start);
|
|
58061
|
-
|
|
58131
|
+
let lastChar;
|
|
58132
|
+
if (start === 0) {
|
|
58133
|
+
lastChar = 32;
|
|
58134
|
+
} else if (start === 1) {
|
|
58135
|
+
lastChar = this.src.charCodeAt(0);
|
|
58136
|
+
if ((lastChar & 63488) === 55296) {
|
|
58137
|
+
lastChar = 65533;
|
|
58138
|
+
}
|
|
58139
|
+
} else {
|
|
58140
|
+
lastChar = this.src.charCodeAt(start - 1);
|
|
58141
|
+
if ((lastChar & 64512) === 56320) {
|
|
58142
|
+
const highSurr = this.src.charCodeAt(start - 2);
|
|
58143
|
+
lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
|
|
58144
|
+
} else if ((lastChar & 64512) === 55296) {
|
|
58145
|
+
lastChar = 65533;
|
|
58146
|
+
}
|
|
58147
|
+
}
|
|
58062
58148
|
let pos = start;
|
|
58063
58149
|
while (pos < max && this.src.charCodeAt(pos) === marker) {
|
|
58064
58150
|
pos++;
|
|
58065
58151
|
}
|
|
58066
58152
|
const count = pos - start;
|
|
58067
|
-
|
|
58068
|
-
|
|
58069
|
-
|
|
58153
|
+
let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
|
|
58154
|
+
if ((nextChar & 64512) === 55296) {
|
|
58155
|
+
const lowSurr = this.src.charCodeAt(pos + 1);
|
|
58156
|
+
nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
|
|
58157
|
+
} else if ((nextChar & 64512) === 56320) {
|
|
58158
|
+
nextChar = 65533;
|
|
58159
|
+
}
|
|
58160
|
+
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
|
|
58161
|
+
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
|
|
58070
58162
|
const isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
58071
58163
|
const isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
58072
58164
|
const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
|
|
@@ -58819,7 +58911,7 @@ function entity(state, silent) {
|
|
|
58819
58911
|
} else {
|
|
58820
58912
|
const match2 = state.src.slice(pos).match(NAMED_RE);
|
|
58821
58913
|
if (match2) {
|
|
58822
|
-
const decoded =
|
|
58914
|
+
const decoded = decodeHTMLStrict(match2[0]);
|
|
58823
58915
|
if (decoded !== match2[0]) {
|
|
58824
58916
|
if (!silent) {
|
|
58825
58917
|
const token = state.push("text_special", "", 0);
|
|
@@ -59172,10 +59264,6 @@ var defaultSchemas = {
|
|
|
59172
59264
|
};
|
|
59173
59265
|
var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
|
|
59174
59266
|
var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
|
|
59175
|
-
function resetScanCache(self) {
|
|
59176
|
-
self.__index__ = -1;
|
|
59177
|
-
self.__text_cache__ = "";
|
|
59178
|
-
}
|
|
59179
59267
|
function createValidator(re) {
|
|
59180
59268
|
return function(text2, pos) {
|
|
59181
59269
|
const tail = text2.slice(pos);
|
|
@@ -59203,8 +59291,11 @@ function compile(self) {
|
|
|
59203
59291
|
return tpl.replace("%TLDS%", re.src_tlds);
|
|
59204
59292
|
}
|
|
59205
59293
|
re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
|
|
59294
|
+
re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), "ig");
|
|
59206
59295
|
re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
|
|
59296
|
+
re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), "ig");
|
|
59207
59297
|
re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
|
|
59298
|
+
re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "ig");
|
|
59208
59299
|
re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
|
|
59209
59300
|
const aliases = [];
|
|
59210
59301
|
self.__compiled__ = {};
|
|
@@ -59259,23 +59350,15 @@ function compile(self) {
|
|
|
59259
59350
|
"(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@",
|
|
59260
59351
|
"i"
|
|
59261
59352
|
);
|
|
59262
|
-
|
|
59263
|
-
|
|
59264
|
-
|
|
59265
|
-
|
|
59266
|
-
|
|
59267
|
-
|
|
59268
|
-
this.
|
|
59269
|
-
this.
|
|
59270
|
-
this.
|
|
59271
|
-
this.raw = text2;
|
|
59272
|
-
this.text = text2;
|
|
59273
|
-
this.url = text2;
|
|
59274
|
-
}
|
|
59275
|
-
function createMatch(self, shift) {
|
|
59276
|
-
const match2 = new Match(self, shift);
|
|
59277
|
-
self.__compiled__[match2.schema].normalize(match2, self);
|
|
59278
|
-
return match2;
|
|
59353
|
+
}
|
|
59354
|
+
function Match(text2, schema, index, lastIndex) {
|
|
59355
|
+
const raw = text2.slice(index, lastIndex);
|
|
59356
|
+
this.schema = schema.toLowerCase();
|
|
59357
|
+
this.index = index;
|
|
59358
|
+
this.lastIndex = lastIndex;
|
|
59359
|
+
this.raw = raw;
|
|
59360
|
+
this.text = raw;
|
|
59361
|
+
this.url = raw;
|
|
59279
59362
|
}
|
|
59280
59363
|
function LinkifyIt(schemas, options2) {
|
|
59281
59364
|
if (!(this instanceof LinkifyIt)) {
|
|
@@ -59288,10 +59371,6 @@ function LinkifyIt(schemas, options2) {
|
|
|
59288
59371
|
}
|
|
59289
59372
|
}
|
|
59290
59373
|
this.__opts__ = assign2({}, defaultOptions, options2);
|
|
59291
|
-
this.__index__ = -1;
|
|
59292
|
-
this.__last_index__ = -1;
|
|
59293
|
-
this.__schema__ = "";
|
|
59294
|
-
this.__text_cache__ = "";
|
|
59295
59374
|
this.__schemas__ = assign2({}, defaultSchemas, schemas);
|
|
59296
59375
|
this.__compiled__ = {};
|
|
59297
59376
|
this.__tlds__ = tlds_default;
|
|
@@ -59309,55 +59388,34 @@ LinkifyIt.prototype.set = function set(options2) {
|
|
|
59309
59388
|
return this;
|
|
59310
59389
|
};
|
|
59311
59390
|
LinkifyIt.prototype.test = function test(text2) {
|
|
59312
|
-
this.__text_cache__ = text2;
|
|
59313
|
-
this.__index__ = -1;
|
|
59314
59391
|
if (!text2.length) {
|
|
59315
59392
|
return false;
|
|
59316
59393
|
}
|
|
59317
|
-
let m,
|
|
59394
|
+
let m, re;
|
|
59318
59395
|
if (this.re.schema_test.test(text2)) {
|
|
59319
59396
|
re = this.re.schema_search;
|
|
59320
59397
|
re.lastIndex = 0;
|
|
59321
59398
|
while ((m = re.exec(text2)) !== null) {
|
|
59322
|
-
|
|
59323
|
-
|
|
59324
|
-
this.__schema__ = m[2];
|
|
59325
|
-
this.__index__ = m.index + m[1].length;
|
|
59326
|
-
this.__last_index__ = m.index + m[0].length + len;
|
|
59327
|
-
break;
|
|
59399
|
+
if (this.testSchemaAt(text2, m[2], re.lastIndex)) {
|
|
59400
|
+
return true;
|
|
59328
59401
|
}
|
|
59329
59402
|
}
|
|
59330
59403
|
}
|
|
59331
59404
|
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
|
|
59332
|
-
|
|
59333
|
-
|
|
59334
|
-
|
|
59335
|
-
if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
|
|
59336
|
-
shift = ml.index + ml[1].length;
|
|
59337
|
-
if (this.__index__ < 0 || shift < this.__index__) {
|
|
59338
|
-
this.__schema__ = "";
|
|
59339
|
-
this.__index__ = shift;
|
|
59340
|
-
this.__last_index__ = ml.index + ml[0].length;
|
|
59341
|
-
}
|
|
59342
|
-
}
|
|
59405
|
+
if (text2.search(this.re.host_fuzzy_test) >= 0) {
|
|
59406
|
+
if (text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
|
|
59407
|
+
return true;
|
|
59343
59408
|
}
|
|
59344
59409
|
}
|
|
59345
59410
|
}
|
|
59346
59411
|
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
|
|
59347
|
-
|
|
59348
|
-
|
|
59349
|
-
|
|
59350
|
-
shift = me.index + me[1].length;
|
|
59351
|
-
next = me.index + me[0].length;
|
|
59352
|
-
if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
|
|
59353
|
-
this.__schema__ = "mailto:";
|
|
59354
|
-
this.__index__ = shift;
|
|
59355
|
-
this.__last_index__ = next;
|
|
59356
|
-
}
|
|
59412
|
+
if (text2.indexOf("@") >= 0) {
|
|
59413
|
+
if (text2.match(this.re.email_fuzzy) !== null) {
|
|
59414
|
+
return true;
|
|
59357
59415
|
}
|
|
59358
59416
|
}
|
|
59359
59417
|
}
|
|
59360
|
-
return
|
|
59418
|
+
return false;
|
|
59361
59419
|
};
|
|
59362
59420
|
LinkifyIt.prototype.pretest = function pretest(text2) {
|
|
59363
59421
|
return this.re.pretest.test(text2);
|
|
@@ -59370,16 +59428,87 @@ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema, pos) {
|
|
|
59370
59428
|
};
|
|
59371
59429
|
LinkifyIt.prototype.match = function match(text2) {
|
|
59372
59430
|
const result = [];
|
|
59373
|
-
|
|
59374
|
-
|
|
59375
|
-
|
|
59376
|
-
|
|
59431
|
+
const type_schemed = [];
|
|
59432
|
+
const type_fuzzy_link = [];
|
|
59433
|
+
const type_fuzzy_email = [];
|
|
59434
|
+
let m, len, re;
|
|
59435
|
+
function choose(a, b) {
|
|
59436
|
+
if (!a) {
|
|
59437
|
+
return b;
|
|
59438
|
+
}
|
|
59439
|
+
if (!b) {
|
|
59440
|
+
return a;
|
|
59441
|
+
}
|
|
59442
|
+
if (a.index !== b.index) {
|
|
59443
|
+
return a.index < b.index ? a : b;
|
|
59444
|
+
}
|
|
59445
|
+
return a.lastIndex >= b.lastIndex ? a : b;
|
|
59377
59446
|
}
|
|
59378
|
-
|
|
59379
|
-
|
|
59380
|
-
|
|
59381
|
-
|
|
59382
|
-
|
|
59447
|
+
if (!text2.length) {
|
|
59448
|
+
return null;
|
|
59449
|
+
}
|
|
59450
|
+
if (this.re.schema_test.test(text2)) {
|
|
59451
|
+
re = this.re.schema_search;
|
|
59452
|
+
re.lastIndex = 0;
|
|
59453
|
+
while ((m = re.exec(text2)) !== null) {
|
|
59454
|
+
len = this.testSchemaAt(text2, m[2], re.lastIndex);
|
|
59455
|
+
if (len) {
|
|
59456
|
+
type_schemed.push({
|
|
59457
|
+
schema: m[2],
|
|
59458
|
+
index: m.index + m[1].length,
|
|
59459
|
+
lastIndex: m.index + m[0].length + len
|
|
59460
|
+
});
|
|
59461
|
+
}
|
|
59462
|
+
}
|
|
59463
|
+
}
|
|
59464
|
+
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
|
|
59465
|
+
re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
|
|
59466
|
+
re.lastIndex = 0;
|
|
59467
|
+
while ((m = re.exec(text2)) !== null) {
|
|
59468
|
+
type_fuzzy_link.push({
|
|
59469
|
+
schema: "",
|
|
59470
|
+
index: m.index + m[1].length,
|
|
59471
|
+
lastIndex: m.index + m[0].length
|
|
59472
|
+
});
|
|
59473
|
+
}
|
|
59474
|
+
}
|
|
59475
|
+
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
|
|
59476
|
+
re = this.re.email_fuzzy_global;
|
|
59477
|
+
re.lastIndex = 0;
|
|
59478
|
+
while ((m = re.exec(text2)) !== null) {
|
|
59479
|
+
type_fuzzy_email.push({
|
|
59480
|
+
schema: "mailto:",
|
|
59481
|
+
index: m.index + m[1].length,
|
|
59482
|
+
lastIndex: m.index + m[0].length
|
|
59483
|
+
});
|
|
59484
|
+
}
|
|
59485
|
+
}
|
|
59486
|
+
const indexes = [0, 0, 0];
|
|
59487
|
+
let lastIndex = 0;
|
|
59488
|
+
for (; ; ) {
|
|
59489
|
+
const candidates = [
|
|
59490
|
+
type_schemed[indexes[0]],
|
|
59491
|
+
type_fuzzy_email[indexes[1]],
|
|
59492
|
+
type_fuzzy_link[indexes[2]]
|
|
59493
|
+
];
|
|
59494
|
+
const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
|
|
59495
|
+
if (!candidate) {
|
|
59496
|
+
break;
|
|
59497
|
+
}
|
|
59498
|
+
if (candidate === candidates[0]) {
|
|
59499
|
+
indexes[0]++;
|
|
59500
|
+
} else if (candidate === candidates[1]) {
|
|
59501
|
+
indexes[1]++;
|
|
59502
|
+
} else {
|
|
59503
|
+
indexes[2]++;
|
|
59504
|
+
}
|
|
59505
|
+
if (candidate.index < lastIndex) {
|
|
59506
|
+
continue;
|
|
59507
|
+
}
|
|
59508
|
+
const match2 = new Match(text2, candidate.schema, candidate.index, candidate.lastIndex);
|
|
59509
|
+
this.__compiled__[match2.schema].normalize(match2, this);
|
|
59510
|
+
result.push(match2);
|
|
59511
|
+
lastIndex = candidate.lastIndex;
|
|
59383
59512
|
}
|
|
59384
59513
|
if (result.length) {
|
|
59385
59514
|
return result;
|
|
@@ -59387,17 +59516,14 @@ LinkifyIt.prototype.match = function match(text2) {
|
|
|
59387
59516
|
return null;
|
|
59388
59517
|
};
|
|
59389
59518
|
LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) {
|
|
59390
|
-
this.__text_cache__ = text2;
|
|
59391
|
-
this.__index__ = -1;
|
|
59392
59519
|
if (!text2.length) return null;
|
|
59393
59520
|
const m = this.re.schema_at_start.exec(text2);
|
|
59394
59521
|
if (!m) return null;
|
|
59395
59522
|
const len = this.testSchemaAt(text2, m[2], m[0].length);
|
|
59396
59523
|
if (!len) return null;
|
|
59397
|
-
|
|
59398
|
-
this.
|
|
59399
|
-
|
|
59400
|
-
return createMatch(this, 0);
|
|
59524
|
+
const match2 = new Match(text2, m[2], m.index + m[1].length, m.index + m[0].length + len);
|
|
59525
|
+
this.__compiled__[match2.schema].normalize(match2, this);
|
|
59526
|
+
return match2;
|
|
59401
59527
|
};
|
|
59402
59528
|
LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
|
|
59403
59529
|
list2 = Array.isArray(list2) ? list2 : [list2];
|
|
@@ -60908,7 +61034,6 @@ var DEFAULT_POST_INDEX = Object.freeze({
|
|
|
60908
61034
|
paginate: true
|
|
60909
61035
|
});
|
|
60910
61036
|
var PERMALINK_OUTPUT_STYLES = /* @__PURE__ */ new Set(["directory", "html-extension"]);
|
|
60911
|
-
var COMMENT_POLICY_OUTPUT_PATH = "_zeropress/comment-policy.json";
|
|
60912
61037
|
var SEARCH_INDEX_OUTPUT_PATH = "_zeropress/search.json";
|
|
60913
61038
|
var SEARCH_ADAPTER_OUTPUT_PATH = "_zeropress/search.js";
|
|
60914
61039
|
var SEARCH_PAGEFIND_ADAPTER_OUTPUT_PATH = "_zeropress/search_pagefind.js";
|
|
@@ -60962,13 +61087,6 @@ async function buildSite(input2) {
|
|
|
60962
61087
|
for (const assetOutput of state.assetOutputs) {
|
|
60963
61088
|
await writeOutput(state.writer, state.summaries, assetOutput.path, assetOutput.content, assetOutput.contentType);
|
|
60964
61089
|
}
|
|
60965
|
-
await writeOutput(
|
|
60966
|
-
state.writer,
|
|
60967
|
-
state.summaries,
|
|
60968
|
-
COMMENT_POLICY_OUTPUT_PATH,
|
|
60969
|
-
state.commentPolicyContent,
|
|
60970
|
-
"application/json"
|
|
60971
|
-
);
|
|
60972
61090
|
if (shouldGenerateSearchArtifacts(state, options2)) {
|
|
60973
61091
|
await writeOutput(state.writer, state.summaries, SEARCH_INDEX_OUTPUT_PATH, buildSearchIndexJson(state), "application/json");
|
|
60974
61092
|
await writeOutput(state.writer, state.summaries, SEARCH_ADAPTER_OUTPUT_PATH, buildSearchAdapterJs(), "application/javascript");
|
|
@@ -61026,7 +61144,6 @@ async function createBuildState(input2, options2) {
|
|
|
61026
61144
|
customHtml: previewData.custom_html,
|
|
61027
61145
|
favicon: previewData.site.favicon,
|
|
61028
61146
|
exposeGenerator: previewData.site.expose_generator !== false,
|
|
61029
|
-
commentPolicyContent: buildCommentPolicyManifest(renderData.posts),
|
|
61030
61147
|
options: options2,
|
|
61031
61148
|
generatedAt: /* @__PURE__ */ new Date(),
|
|
61032
61149
|
emitted: {
|
|
@@ -61088,7 +61205,7 @@ async function renderRoute(state, templateName, route) {
|
|
|
61088
61205
|
route: routeContext,
|
|
61089
61206
|
meta: buildPageMeta(state.previewData.site, {
|
|
61090
61207
|
currentUrl,
|
|
61091
|
-
title: state.previewData.site.title,
|
|
61208
|
+
title: route.is_front_page === true ? buildFrontPageTitle(state.previewData.site) : state.previewData.site.title,
|
|
61092
61209
|
description: state.previewData.site.description,
|
|
61093
61210
|
ogType: "website"
|
|
61094
61211
|
})
|
|
@@ -61132,7 +61249,7 @@ async function renderFrontPage(state, route) {
|
|
|
61132
61249
|
route: routeContext,
|
|
61133
61250
|
meta: buildPageMeta(state.previewData.site, {
|
|
61134
61251
|
currentUrl,
|
|
61135
|
-
title:
|
|
61252
|
+
title: buildFrontPageTitle(state.previewData.site),
|
|
61136
61253
|
description: page.excerpt,
|
|
61137
61254
|
ogType: "website",
|
|
61138
61255
|
image: page.featured_image,
|
|
@@ -61164,7 +61281,7 @@ async function renderFrontPage(state, route) {
|
|
|
61164
61281
|
route: routeContext,
|
|
61165
61282
|
meta: buildPageMeta(state.previewData.site, {
|
|
61166
61283
|
currentUrl,
|
|
61167
|
-
title: state.previewData.site
|
|
61284
|
+
title: buildFrontPageTitle(state.previewData.site),
|
|
61168
61285
|
description: state.previewData.site.description,
|
|
61169
61286
|
ogType: "website"
|
|
61170
61287
|
})
|
|
@@ -61281,11 +61398,13 @@ async function maybeRenderNotFoundPage(state) {
|
|
|
61281
61398
|
await writeOutput(state.writer, state.summaries, "404.html", html, "text/html");
|
|
61282
61399
|
}
|
|
61283
61400
|
function normalizePreviewData(previewData, options2 = {}) {
|
|
61401
|
+
const media_base_url = normalizeOptionalString(previewData.site.media_base_url);
|
|
61284
61402
|
const normalizedSite = {
|
|
61285
61403
|
...previewData.site,
|
|
61286
|
-
media_base_url
|
|
61404
|
+
media_base_url,
|
|
61287
61405
|
media_delivery_mode: MEDIA_DELIVERY_MODES.has(previewData.site.media_delivery_mode) ? previewData.site.media_delivery_mode : "none",
|
|
61288
|
-
favicon: normalizeSiteFavicon(previewData.site.favicon
|
|
61406
|
+
favicon: previewData.site.favicon ? normalizeSiteFavicon(previewData.site.favicon, media_base_url) : normalizeSiteFavicon(options2.favicon, ""),
|
|
61407
|
+
logo: normalizeSiteLogo(previewData.site.logo, media_base_url),
|
|
61289
61408
|
posts_per_page: Number.isInteger(previewData.site.posts_per_page) && previewData.site.posts_per_page > 0 ? previewData.site.posts_per_page : DEFAULT_POSTS_PER_PAGE,
|
|
61290
61409
|
datetime_display: DATETIME_DISPLAY_MODES.has(previewData.site.datetime_display) ? previewData.site.datetime_display : DEFAULT_DATETIME_DISPLAY,
|
|
61291
61410
|
date_style: DATETIME_STYLES.has(previewData.site.date_style) ? previewData.site.date_style : DEFAULT_DATE_STYLE,
|
|
@@ -61528,7 +61647,7 @@ function normalizeCustomHtml(customHtml) {
|
|
|
61528
61647
|
...bodyEnd ? { body_end: { content: bodyEnd } } : {}
|
|
61529
61648
|
};
|
|
61530
61649
|
}
|
|
61531
|
-
function normalizeSiteFavicon(favicon) {
|
|
61650
|
+
function normalizeSiteFavicon(favicon, media_base_url) {
|
|
61532
61651
|
if (!favicon || typeof favicon !== "object") {
|
|
61533
61652
|
return void 0;
|
|
61534
61653
|
}
|
|
@@ -61536,11 +61655,25 @@ function normalizeSiteFavicon(favicon) {
|
|
|
61536
61655
|
for (const key of ["icon", "svg", "png", "apple_touch_icon"]) {
|
|
61537
61656
|
const value = normalizeOptionalString(favicon[key]);
|
|
61538
61657
|
if (value) {
|
|
61539
|
-
normalized[key] = value;
|
|
61658
|
+
normalized[key] = normalizeMediaField(value, media_base_url);
|
|
61540
61659
|
}
|
|
61541
61660
|
}
|
|
61542
61661
|
return Object.keys(normalized).length ? normalized : void 0;
|
|
61543
61662
|
}
|
|
61663
|
+
function normalizeSiteLogo(logo, media_base_url) {
|
|
61664
|
+
if (!logo || typeof logo !== "object") {
|
|
61665
|
+
return void 0;
|
|
61666
|
+
}
|
|
61667
|
+
const src = normalizeMediaField(logo.src, media_base_url);
|
|
61668
|
+
if (!src) {
|
|
61669
|
+
return void 0;
|
|
61670
|
+
}
|
|
61671
|
+
const alt = normalizeOptionalString(logo.alt);
|
|
61672
|
+
return {
|
|
61673
|
+
src,
|
|
61674
|
+
...alt ? { alt } : {}
|
|
61675
|
+
};
|
|
61676
|
+
}
|
|
61544
61677
|
function normalizePermalinks(permalinks) {
|
|
61545
61678
|
const source = permalinks && typeof permalinks === "object" ? permalinks : {};
|
|
61546
61679
|
const outputStyle = typeof source.output_style === "string" && PERMALINK_OUTPUT_STYLES.has(source.output_style) ? source.output_style : DEFAULT_PERMALINKS.output_style;
|
|
@@ -61756,8 +61889,12 @@ function attachCollectionCursors(posts, pages, collections) {
|
|
|
61756
61889
|
if (!target) {
|
|
61757
61890
|
return;
|
|
61758
61891
|
}
|
|
61892
|
+
const cursor = buildCollectionCursor(collectionId, collection, items, index);
|
|
61759
61893
|
target.collection_cursors = target.collection_cursors || {};
|
|
61760
|
-
target.collection_cursors[collectionId] =
|
|
61894
|
+
target.collection_cursors[collectionId] = cursor;
|
|
61895
|
+
if (!target.collection_cursor) {
|
|
61896
|
+
target.collection_cursor = cursor;
|
|
61897
|
+
}
|
|
61761
61898
|
});
|
|
61762
61899
|
}
|
|
61763
61900
|
}
|
|
@@ -62114,13 +62251,6 @@ function preparePost(post, site, authorsById, categoriesBySlug, tagsBySlug, them
|
|
|
62114
62251
|
comments_enabled: themeSupportsComments && site.disallow_comments !== true && post.allow_comments === true
|
|
62115
62252
|
};
|
|
62116
62253
|
}
|
|
62117
|
-
function buildCommentPolicyManifest(posts) {
|
|
62118
|
-
const commentablePosts = posts.filter((post) => post.status === "published" && post.comments_enabled === true).map((post) => post.public_id).filter((value) => Number.isInteger(value) && value > 0);
|
|
62119
|
-
return JSON.stringify({
|
|
62120
|
-
version: 1,
|
|
62121
|
-
commentable_posts: commentablePosts
|
|
62122
|
-
}, null, 2);
|
|
62123
|
-
}
|
|
62124
62254
|
function buildTaxonomyRoutes(options2) {
|
|
62125
62255
|
const routes = [];
|
|
62126
62256
|
for (const item of options2.items) {
|
|
@@ -62669,6 +62799,11 @@ function buildDocumentTitle(contentTitle, siteTitle) {
|
|
|
62669
62799
|
const resolvedSiteTitle = normalizeNonEmptyString(siteTitle, resolvedContentTitle);
|
|
62670
62800
|
return `${resolvedContentTitle} - ${resolvedSiteTitle}`;
|
|
62671
62801
|
}
|
|
62802
|
+
function buildFrontPageTitle(site) {
|
|
62803
|
+
const resolvedSiteTitle = normalizeNonEmptyString(site.title, "");
|
|
62804
|
+
const resolvedDescription = normalizeOptionalString(site.description);
|
|
62805
|
+
return resolvedDescription ? `${resolvedSiteTitle} - ${resolvedDescription}` : resolvedSiteTitle;
|
|
62806
|
+
}
|
|
62672
62807
|
function buildMetaHeadTags(meta) {
|
|
62673
62808
|
const tags = [];
|
|
62674
62809
|
if (meta.description) {
|
|
@@ -62930,8 +63065,7 @@ function assertPlannedOutputPathsSafe(state) {
|
|
|
62930
63065
|
assertUniqueRoutes(routeEntries);
|
|
62931
63066
|
const plannedPaths = [
|
|
62932
63067
|
...routeEntries.map((entry) => entry.outputPath),
|
|
62933
|
-
...state.assetOutputs.map((assetOutput) => assetOutput.path)
|
|
62934
|
-
COMMENT_POLICY_OUTPUT_PATH
|
|
63068
|
+
...state.assetOutputs.map((assetOutput) => assetOutput.path)
|
|
62935
63069
|
];
|
|
62936
63070
|
if (shouldGenerateSearchArtifacts(state, state.options)) {
|
|
62937
63071
|
plannedPaths.push(SEARCH_INDEX_OUTPUT_PATH, SEARCH_ADAPTER_OUTPUT_PATH, SEARCH_PAGEFIND_ADAPTER_OUTPUT_PATH);
|
|
@@ -64107,9 +64241,13 @@ async function linkExists(siteDir, link2) {
|
|
|
64107
64241
|
var __dirname = path3.dirname(fileURLToPath(import.meta.url));
|
|
64108
64242
|
var packageDir = path3.resolve(__dirname, "..");
|
|
64109
64243
|
var prebuildScript = __dirname === path3.join(packageDir, "dist") ? path3.join(__dirname, "prebuild.js") : path3.join(packageDir, "src", "prebuild.js");
|
|
64110
|
-
var
|
|
64111
|
-
var
|
|
64112
|
-
var
|
|
64244
|
+
var INTERNAL_WORK_DIR = ".zeropress-build-page";
|
|
64245
|
+
var PREVIEW_DATA_PATH = `${INTERNAL_WORK_DIR}/preview-data.json`;
|
|
64246
|
+
var STAGING_DIR = `${INTERNAL_WORK_DIR}/public-assets`;
|
|
64247
|
+
var BUNDLED_THEME_ALIASES = /* @__PURE__ */ new Map([
|
|
64248
|
+
["docs", "docs"],
|
|
64249
|
+
["docs1", "docs"]
|
|
64250
|
+
]);
|
|
64113
64251
|
async function runBuildPages(options2) {
|
|
64114
64252
|
const cwd = path3.resolve(options2.cwd || process.cwd());
|
|
64115
64253
|
const copyMarkdownSource = options2.copyMarkdownSource !== false;
|
|
@@ -64117,7 +64255,7 @@ async function runBuildPages(options2) {
|
|
|
64117
64255
|
const publicDirExplicit = hasExplicitPublicDir(options2);
|
|
64118
64256
|
const publicDir = publicDirExplicit ? path3.resolve(cwd, options2.publicDir) : sourceDir;
|
|
64119
64257
|
const destinationDir = path3.resolve(cwd, options2.destination);
|
|
64120
|
-
const generatedDir = path3.join(cwd,
|
|
64258
|
+
const generatedDir = path3.join(cwd, INTERNAL_WORK_DIR);
|
|
64121
64259
|
const stagingDir = path3.join(cwd, STAGING_DIR);
|
|
64122
64260
|
const previewDataPath = path3.join(cwd, PREVIEW_DATA_PATH);
|
|
64123
64261
|
const themeDir = resolveThemeDir(cwd, options2);
|
|
@@ -64131,6 +64269,7 @@ async function runBuildPages(options2) {
|
|
|
64131
64269
|
generatedDir
|
|
64132
64270
|
});
|
|
64133
64271
|
await assertDirectory(sourceDir, "Source directory");
|
|
64272
|
+
await assertDirectory(themeDir, "Theme directory");
|
|
64134
64273
|
await assertPublicDirectory(publicDir, publicDirExplicit);
|
|
64135
64274
|
await assertDestinationPath(destinationDir);
|
|
64136
64275
|
await fs3.rm(generatedDir, { recursive: true, force: true });
|
|
@@ -64174,7 +64313,7 @@ async function runBuildPages(options2) {
|
|
|
64174
64313
|
process.env.ZEROPRESS_PUBLIC_DIR = stagingDir;
|
|
64175
64314
|
try {
|
|
64176
64315
|
const result = await runBuild(themeDir, previewData, destinationDir);
|
|
64177
|
-
console.log(
|
|
64316
|
+
console.log(formatBuildPagesSuccessMessage());
|
|
64178
64317
|
console.log(`Files: ${result.files.length}`);
|
|
64179
64318
|
console.log(`Output: ${formatPath(cwd, destinationDir)}`);
|
|
64180
64319
|
} finally {
|
|
@@ -64195,14 +64334,36 @@ async function runBuildPages(options2) {
|
|
|
64195
64334
|
console.log(`Checked ${result.htmlFiles.length} HTML files for internal links`);
|
|
64196
64335
|
}
|
|
64197
64336
|
}
|
|
64337
|
+
function formatBuildPagesSuccessMessage(stream = process.stdout) {
|
|
64338
|
+
return createColor2(stream).green("Built ZeroPress Pages site successfully");
|
|
64339
|
+
}
|
|
64340
|
+
function createColor2(stream) {
|
|
64341
|
+
const enabled = colorsEnabled(stream);
|
|
64342
|
+
const wrap = (code2, value) => enabled ? `\x1B[${code2}m${value}\x1B[0m` : value;
|
|
64343
|
+
return {
|
|
64344
|
+
red: (value) => wrap("31", value),
|
|
64345
|
+
yellow: (value) => wrap("33", value),
|
|
64346
|
+
green: (value) => wrap("32", value)
|
|
64347
|
+
};
|
|
64348
|
+
}
|
|
64349
|
+
function colorsEnabled(stream) {
|
|
64350
|
+
if (process.env.NO_COLOR) {
|
|
64351
|
+
return false;
|
|
64352
|
+
}
|
|
64353
|
+
if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== "0") {
|
|
64354
|
+
return true;
|
|
64355
|
+
}
|
|
64356
|
+
return Boolean(stream?.isTTY);
|
|
64357
|
+
}
|
|
64198
64358
|
function resolveThemeDir(cwd, options2) {
|
|
64199
64359
|
if (options2.themePath) {
|
|
64200
64360
|
return path3.resolve(cwd, options2.themePath);
|
|
64201
64361
|
}
|
|
64202
|
-
|
|
64203
|
-
|
|
64362
|
+
const canonicalTheme = BUNDLED_THEME_ALIASES.get(options2.theme);
|
|
64363
|
+
if (canonicalTheme) {
|
|
64364
|
+
return path3.join(packageDir, "themes", canonicalTheme);
|
|
64204
64365
|
}
|
|
64205
|
-
throw new Error(`Unknown bundled theme: ${options2.theme}`);
|
|
64366
|
+
throw new Error(`Unknown bundled theme: ${options2.theme}. Supported bundled themes: ${Array.from(BUNDLED_THEME_ALIASES.keys()).join(", ")}`);
|
|
64206
64367
|
}
|
|
64207
64368
|
function hasExplicitPublicDir(options2) {
|
|
64208
64369
|
return typeof options2.publicDir === "string" && Boolean(options2.publicDir.trim());
|
|
@@ -64274,11 +64435,11 @@ function assertBuildPagesPathLayout({
|
|
|
64274
64435
|
`Public directory must be a dedicated asset directory, not the current working directory. Received: ${formatPath(cwd, publicDir)}`
|
|
64275
64436
|
);
|
|
64276
64437
|
}
|
|
64277
|
-
assertNoPathOverlap(cwd, "Source directory", sourceDir,
|
|
64278
|
-
assertNoPathOverlap(cwd, "Destination directory", destinationDir,
|
|
64279
|
-
assertNoPathOverlap(cwd, "Theme directory", themeDir,
|
|
64438
|
+
assertNoPathOverlap(cwd, "Source directory", sourceDir, `internal ${INTERNAL_WORK_DIR} working directory`, generatedDir);
|
|
64439
|
+
assertNoPathOverlap(cwd, "Destination directory", destinationDir, `internal ${INTERNAL_WORK_DIR} working directory`, generatedDir);
|
|
64440
|
+
assertNoPathOverlap(cwd, "Theme directory", themeDir, `internal ${INTERNAL_WORK_DIR} working directory`, generatedDir);
|
|
64280
64441
|
if (!samePath(publicDir, sourceDir)) {
|
|
64281
|
-
assertNoPathOverlap(cwd, "Public directory", publicDir,
|
|
64442
|
+
assertNoPathOverlap(cwd, "Public directory", publicDir, `internal ${INTERNAL_WORK_DIR} working directory`, generatedDir);
|
|
64282
64443
|
assertNoPathOverlap(cwd, "Public directory", publicDir, "destination directory", destinationDir);
|
|
64283
64444
|
assertNoPathOverlap(cwd, "Public directory", publicDir, "theme directory", themeDir);
|
|
64284
64445
|
}
|