@zeropress/build-pages 0.6.2 → 0.6.3

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/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
  }
@@ -54591,6 +54608,7 @@ function escapeRegex(str) {
54591
54608
  var utils_exports = {};
54592
54609
  __export(utils_exports, {
54593
54610
  arrayReplaceAt: () => arrayReplaceAt,
54611
+ asciiTrim: () => asciiTrim,
54594
54612
  assign: () => assign,
54595
54613
  escapeHtml: () => escapeHtml,
54596
54614
  escapeRE: () => escapeRE,
@@ -54598,6 +54616,7 @@ __export(utils_exports, {
54598
54616
  has: () => has,
54599
54617
  isMdAsciiPunct: () => isMdAsciiPunct,
54600
54618
  isPunctChar: () => isPunctChar,
54619
+ isPunctCharCode: () => isPunctCharCode,
54601
54620
  isSpace: () => isSpace,
54602
54621
  isString: () => isString,
54603
54622
  isValidEntityCode: () => isValidEntityCode,
@@ -55425,6 +55444,9 @@ var xmlDecoder = getDecoder(decode_data_xml_default);
55425
55444
  function decodeHTML(str, mode = DecodingMode.Legacy) {
55426
55445
  return htmlDecoder(str, mode);
55427
55446
  }
55447
+ function decodeHTMLStrict(str) {
55448
+ return htmlDecoder(str, DecodingMode.Strict);
55449
+ }
55428
55450
 
55429
55451
  // node_modules/entities/lib/esm/generated/encode-html.js
55430
55452
  function restoreDiff(arr) {
@@ -55650,6 +55672,9 @@ function isWhiteSpace(code2) {
55650
55672
  function isPunctChar(ch) {
55651
55673
  return regex_default4.test(ch) || regex_default5.test(ch);
55652
55674
  }
55675
+ function isPunctCharCode(code2) {
55676
+ return isPunctChar(fromCodePoint2(code2));
55677
+ }
55653
55678
  function isMdAsciiPunct(ch) {
55654
55679
  switch (ch) {
55655
55680
  case 33:
@@ -55696,6 +55721,24 @@ function normalizeReference(str) {
55696
55721
  }
55697
55722
  return str.toLowerCase().toUpperCase();
55698
55723
  }
55724
+ function isAsciiTrimmable(c) {
55725
+ return c === 32 || c === 9 || c === 10 || c === 13;
55726
+ }
55727
+ function asciiTrim(str) {
55728
+ let start = 0;
55729
+ for (; start < str.length; start++) {
55730
+ if (!isAsciiTrimmable(str.charCodeAt(start))) {
55731
+ break;
55732
+ }
55733
+ }
55734
+ let end = str.length - 1;
55735
+ for (; end >= start; end--) {
55736
+ if (!isAsciiTrimmable(str.charCodeAt(end))) {
55737
+ break;
55738
+ }
55739
+ }
55740
+ return str.slice(start, end + 1);
55741
+ }
55699
55742
  var lib = { mdurl: mdurl_exports, ucmicro: uc_exports };
55700
55743
 
55701
55744
  // node_modules/markdown-it/lib/helpers/index.mjs
@@ -56448,12 +56491,27 @@ function replace(state) {
56448
56491
  var QUOTE_TEST_RE = /['"]/;
56449
56492
  var QUOTE_RE = /['"]/g;
56450
56493
  var APOSTROPHE = "\u2019";
56451
- function replaceAt(str, index, ch) {
56452
- return str.slice(0, index) + ch + str.slice(index + 1);
56494
+ function addReplacement(replacements, tokenIdx, pos, ch) {
56495
+ if (!replacements[tokenIdx]) {
56496
+ replacements[tokenIdx] = [];
56497
+ }
56498
+ replacements[tokenIdx].push({ pos, ch });
56499
+ }
56500
+ function applyReplacements(str, replacements) {
56501
+ let result = "";
56502
+ let lastPos = 0;
56503
+ replacements.sort((a, b) => a.pos - b.pos);
56504
+ for (let i = 0; i < replacements.length; i++) {
56505
+ const replacement = replacements[i];
56506
+ result += str.slice(lastPos, replacement.pos) + replacement.ch;
56507
+ lastPos = replacement.pos + 1;
56508
+ }
56509
+ return result + str.slice(lastPos);
56453
56510
  }
56454
56511
  function process_inlines(tokens, state) {
56455
56512
  let j;
56456
56513
  const stack = [];
56514
+ const replacements = {};
56457
56515
  for (let i = 0; i < tokens.length; i++) {
56458
56516
  const token = tokens[i];
56459
56517
  const thisLevel = tokens[i].level;
@@ -56466,9 +56524,9 @@ function process_inlines(tokens, state) {
56466
56524
  if (token.type !== "text") {
56467
56525
  continue;
56468
56526
  }
56469
- let text2 = token.content;
56527
+ const text2 = token.content;
56470
56528
  let pos = 0;
56471
- let max = text2.length;
56529
+ const max = text2.length;
56472
56530
  OUTER:
56473
56531
  while (pos < max) {
56474
56532
  QUOTE_RE.lastIndex = pos;
@@ -56502,8 +56560,8 @@ function process_inlines(tokens, state) {
56502
56560
  break;
56503
56561
  }
56504
56562
  }
56505
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
56506
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
56563
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
56564
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
56507
56565
  const isLastWhiteSpace = isWhiteSpace(lastChar);
56508
56566
  const isNextWhiteSpace = isWhiteSpace(nextChar);
56509
56567
  if (isNextWhiteSpace) {
@@ -56531,7 +56589,7 @@ function process_inlines(tokens, state) {
56531
56589
  }
56532
56590
  if (!canOpen && !canClose) {
56533
56591
  if (isSingle) {
56534
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
56592
+ addReplacement(replacements, i, t.index, APOSTROPHE);
56535
56593
  }
56536
56594
  continue;
56537
56595
  }
@@ -56552,18 +56610,8 @@ function process_inlines(tokens, state) {
56552
56610
  openQuote = state.md.options.quotes[0];
56553
56611
  closeQuote = state.md.options.quotes[1];
56554
56612
  }
56555
- token.content = replaceAt(token.content, t.index, closeQuote);
56556
- tokens[item.token].content = replaceAt(
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;
56613
+ addReplacement(replacements, i, t.index, closeQuote);
56614
+ addReplacement(replacements, item.token, item.pos, openQuote);
56567
56615
  stack.length = j;
56568
56616
  continue OUTER;
56569
56617
  }
@@ -56577,10 +56625,13 @@ function process_inlines(tokens, state) {
56577
56625
  level: thisLevel
56578
56626
  });
56579
56627
  } else if (canClose && isSingle) {
56580
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
56628
+ addReplacement(replacements, i, t.index, APOSTROPHE);
56581
56629
  }
56582
56630
  }
56583
56631
  }
56632
+ Object.keys(replacements).forEach(function(tokenIdx) {
56633
+ tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]);
56634
+ });
56584
56635
  }
56585
56636
  function smartquotes(state) {
56586
56637
  if (!state.md.options.typographer) {
@@ -57769,10 +57820,13 @@ function html_block(state, startLine, endLine, silent) {
57769
57820
  return HTML_SEQUENCES[i][2];
57770
57821
  }
57771
57822
  let nextLine = startLine + 1;
57823
+ const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
57772
57824
  if (!HTML_SEQUENCES[i][1].test(lineText)) {
57773
57825
  for (; nextLine < endLine; nextLine++) {
57774
57826
  if (state.sCount[nextLine] < state.blkIndent) {
57775
- break;
57827
+ if (endsOnBlankLine || !state.isEmpty(nextLine)) {
57828
+ break;
57829
+ }
57776
57830
  }
57777
57831
  pos = state.bMarks[nextLine] + state.tShift[nextLine];
57778
57832
  max = state.eMarks[nextLine];
@@ -57825,7 +57879,7 @@ function heading(state, startLine, endLine, silent) {
57825
57879
  token_o.markup = "########".slice(0, level);
57826
57880
  token_o.map = [startLine, state.line];
57827
57881
  const token_i = state.push("inline", "", 0);
57828
- token_i.content = state.src.slice(pos, max).trim();
57882
+ token_i.content = asciiTrim(state.src.slice(pos, max));
57829
57883
  token_i.map = [startLine, state.line];
57830
57884
  token_i.children = [];
57831
57885
  const token_c = state.push("heading_close", "h" + String(level), -1);
@@ -57878,9 +57932,10 @@ function lheading(state, startLine, endLine) {
57878
57932
  }
57879
57933
  }
57880
57934
  if (!level) {
57935
+ state.parentType = oldParentType;
57881
57936
  return false;
57882
57937
  }
57883
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
57938
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
57884
57939
  state.line = nextLine + 1;
57885
57940
  const token_o = state.push("heading_open", "h" + String(level), 1);
57886
57941
  token_o.markup = String.fromCharCode(marker);
@@ -57919,7 +57974,7 @@ function paragraph(state, startLine, endLine) {
57919
57974
  break;
57920
57975
  }
57921
57976
  }
57922
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
57977
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
57923
57978
  state.line = nextLine;
57924
57979
  const token_o = state.push("paragraph_open", "p", 1);
57925
57980
  token_o.map = [startLine, state.line];
@@ -58058,15 +58113,37 @@ StateInline.prototype.push = function(type, tag, nesting) {
58058
58113
  StateInline.prototype.scanDelims = function(start, canSplitWord) {
58059
58114
  const max = this.posMax;
58060
58115
  const marker = this.src.charCodeAt(start);
58061
- const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;
58116
+ let lastChar;
58117
+ if (start === 0) {
58118
+ lastChar = 32;
58119
+ } else if (start === 1) {
58120
+ lastChar = this.src.charCodeAt(0);
58121
+ if ((lastChar & 63488) === 55296) {
58122
+ lastChar = 65533;
58123
+ }
58124
+ } else {
58125
+ lastChar = this.src.charCodeAt(start - 1);
58126
+ if ((lastChar & 64512) === 56320) {
58127
+ const highSurr = this.src.charCodeAt(start - 2);
58128
+ lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
58129
+ } else if ((lastChar & 64512) === 55296) {
58130
+ lastChar = 65533;
58131
+ }
58132
+ }
58062
58133
  let pos = start;
58063
58134
  while (pos < max && this.src.charCodeAt(pos) === marker) {
58064
58135
  pos++;
58065
58136
  }
58066
58137
  const count = pos - start;
58067
- const nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
58068
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
58069
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
58138
+ let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
58139
+ if ((nextChar & 64512) === 55296) {
58140
+ const lowSurr = this.src.charCodeAt(pos + 1);
58141
+ nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
58142
+ } else if ((nextChar & 64512) === 56320) {
58143
+ nextChar = 65533;
58144
+ }
58145
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
58146
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
58070
58147
  const isLastWhiteSpace = isWhiteSpace(lastChar);
58071
58148
  const isNextWhiteSpace = isWhiteSpace(nextChar);
58072
58149
  const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
@@ -58819,7 +58896,7 @@ function entity(state, silent) {
58819
58896
  } else {
58820
58897
  const match2 = state.src.slice(pos).match(NAMED_RE);
58821
58898
  if (match2) {
58822
- const decoded = decodeHTML(match2[0]);
58899
+ const decoded = decodeHTMLStrict(match2[0]);
58823
58900
  if (decoded !== match2[0]) {
58824
58901
  if (!silent) {
58825
58902
  const token = state.push("text_special", "", 0);
@@ -59172,10 +59249,6 @@ var defaultSchemas = {
59172
59249
  };
59173
59250
  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
59251
  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
59252
  function createValidator(re) {
59180
59253
  return function(text2, pos) {
59181
59254
  const tail = text2.slice(pos);
@@ -59203,8 +59276,11 @@ function compile(self) {
59203
59276
  return tpl.replace("%TLDS%", re.src_tlds);
59204
59277
  }
59205
59278
  re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
59279
+ re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), "ig");
59206
59280
  re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
59281
+ re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), "ig");
59207
59282
  re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
59283
+ re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "ig");
59208
59284
  re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
59209
59285
  const aliases = [];
59210
59286
  self.__compiled__ = {};
@@ -59259,23 +59335,15 @@ function compile(self) {
59259
59335
  "(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@",
59260
59336
  "i"
59261
59337
  );
59262
- resetScanCache(self);
59263
- }
59264
- function Match(self, shift) {
59265
- const start = self.__index__;
59266
- const end = self.__last_index__;
59267
- const text2 = self.__text_cache__.slice(start, end);
59268
- this.schema = self.__schema__.toLowerCase();
59269
- this.index = start + shift;
59270
- this.lastIndex = end + shift;
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;
59338
+ }
59339
+ function Match(text2, schema, index, lastIndex) {
59340
+ const raw = text2.slice(index, lastIndex);
59341
+ this.schema = schema.toLowerCase();
59342
+ this.index = index;
59343
+ this.lastIndex = lastIndex;
59344
+ this.raw = raw;
59345
+ this.text = raw;
59346
+ this.url = raw;
59279
59347
  }
59280
59348
  function LinkifyIt(schemas, options2) {
59281
59349
  if (!(this instanceof LinkifyIt)) {
@@ -59288,10 +59356,6 @@ function LinkifyIt(schemas, options2) {
59288
59356
  }
59289
59357
  }
59290
59358
  this.__opts__ = assign2({}, defaultOptions, options2);
59291
- this.__index__ = -1;
59292
- this.__last_index__ = -1;
59293
- this.__schema__ = "";
59294
- this.__text_cache__ = "";
59295
59359
  this.__schemas__ = assign2({}, defaultSchemas, schemas);
59296
59360
  this.__compiled__ = {};
59297
59361
  this.__tlds__ = tlds_default;
@@ -59309,55 +59373,34 @@ LinkifyIt.prototype.set = function set(options2) {
59309
59373
  return this;
59310
59374
  };
59311
59375
  LinkifyIt.prototype.test = function test(text2) {
59312
- this.__text_cache__ = text2;
59313
- this.__index__ = -1;
59314
59376
  if (!text2.length) {
59315
59377
  return false;
59316
59378
  }
59317
- let m, ml, me, len, shift, next, re, tld_pos, at_pos;
59379
+ let m, re;
59318
59380
  if (this.re.schema_test.test(text2)) {
59319
59381
  re = this.re.schema_search;
59320
59382
  re.lastIndex = 0;
59321
59383
  while ((m = re.exec(text2)) !== null) {
59322
- len = this.testSchemaAt(text2, m[2], re.lastIndex);
59323
- if (len) {
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;
59384
+ if (this.testSchemaAt(text2, m[2], re.lastIndex)) {
59385
+ return true;
59328
59386
  }
59329
59387
  }
59330
59388
  }
59331
59389
  if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
59332
- tld_pos = text2.search(this.re.host_fuzzy_test);
59333
- if (tld_pos >= 0) {
59334
- if (this.__index__ < 0 || tld_pos < this.__index__) {
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
- }
59390
+ if (text2.search(this.re.host_fuzzy_test) >= 0) {
59391
+ if (text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
59392
+ return true;
59343
59393
  }
59344
59394
  }
59345
59395
  }
59346
59396
  if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
59347
- at_pos = text2.indexOf("@");
59348
- if (at_pos >= 0) {
59349
- if ((me = text2.match(this.re.email_fuzzy)) !== null) {
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
- }
59397
+ if (text2.indexOf("@") >= 0) {
59398
+ if (text2.match(this.re.email_fuzzy) !== null) {
59399
+ return true;
59357
59400
  }
59358
59401
  }
59359
59402
  }
59360
- return this.__index__ >= 0;
59403
+ return false;
59361
59404
  };
59362
59405
  LinkifyIt.prototype.pretest = function pretest(text2) {
59363
59406
  return this.re.pretest.test(text2);
@@ -59370,16 +59413,87 @@ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema, pos) {
59370
59413
  };
59371
59414
  LinkifyIt.prototype.match = function match(text2) {
59372
59415
  const result = [];
59373
- let shift = 0;
59374
- if (this.__index__ >= 0 && this.__text_cache__ === text2) {
59375
- result.push(createMatch(this, shift));
59376
- shift = this.__last_index__;
59416
+ const type_schemed = [];
59417
+ const type_fuzzy_link = [];
59418
+ const type_fuzzy_email = [];
59419
+ let m, len, re;
59420
+ function choose(a, b) {
59421
+ if (!a) {
59422
+ return b;
59423
+ }
59424
+ if (!b) {
59425
+ return a;
59426
+ }
59427
+ if (a.index !== b.index) {
59428
+ return a.index < b.index ? a : b;
59429
+ }
59430
+ return a.lastIndex >= b.lastIndex ? a : b;
59377
59431
  }
59378
- let tail = shift ? text2.slice(shift) : text2;
59379
- while (this.test(tail)) {
59380
- result.push(createMatch(this, shift));
59381
- tail = tail.slice(this.__last_index__);
59382
- shift += this.__last_index__;
59432
+ if (!text2.length) {
59433
+ return null;
59434
+ }
59435
+ if (this.re.schema_test.test(text2)) {
59436
+ re = this.re.schema_search;
59437
+ re.lastIndex = 0;
59438
+ while ((m = re.exec(text2)) !== null) {
59439
+ len = this.testSchemaAt(text2, m[2], re.lastIndex);
59440
+ if (len) {
59441
+ type_schemed.push({
59442
+ schema: m[2],
59443
+ index: m.index + m[1].length,
59444
+ lastIndex: m.index + m[0].length + len
59445
+ });
59446
+ }
59447
+ }
59448
+ }
59449
+ if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
59450
+ re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
59451
+ re.lastIndex = 0;
59452
+ while ((m = re.exec(text2)) !== null) {
59453
+ type_fuzzy_link.push({
59454
+ schema: "",
59455
+ index: m.index + m[1].length,
59456
+ lastIndex: m.index + m[0].length
59457
+ });
59458
+ }
59459
+ }
59460
+ if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
59461
+ re = this.re.email_fuzzy_global;
59462
+ re.lastIndex = 0;
59463
+ while ((m = re.exec(text2)) !== null) {
59464
+ type_fuzzy_email.push({
59465
+ schema: "mailto:",
59466
+ index: m.index + m[1].length,
59467
+ lastIndex: m.index + m[0].length
59468
+ });
59469
+ }
59470
+ }
59471
+ const indexes = [0, 0, 0];
59472
+ let lastIndex = 0;
59473
+ for (; ; ) {
59474
+ const candidates = [
59475
+ type_schemed[indexes[0]],
59476
+ type_fuzzy_email[indexes[1]],
59477
+ type_fuzzy_link[indexes[2]]
59478
+ ];
59479
+ const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
59480
+ if (!candidate) {
59481
+ break;
59482
+ }
59483
+ if (candidate === candidates[0]) {
59484
+ indexes[0]++;
59485
+ } else if (candidate === candidates[1]) {
59486
+ indexes[1]++;
59487
+ } else {
59488
+ indexes[2]++;
59489
+ }
59490
+ if (candidate.index < lastIndex) {
59491
+ continue;
59492
+ }
59493
+ const match2 = new Match(text2, candidate.schema, candidate.index, candidate.lastIndex);
59494
+ this.__compiled__[match2.schema].normalize(match2, this);
59495
+ result.push(match2);
59496
+ lastIndex = candidate.lastIndex;
59383
59497
  }
59384
59498
  if (result.length) {
59385
59499
  return result;
@@ -59387,17 +59501,14 @@ LinkifyIt.prototype.match = function match(text2) {
59387
59501
  return null;
59388
59502
  };
59389
59503
  LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) {
59390
- this.__text_cache__ = text2;
59391
- this.__index__ = -1;
59392
59504
  if (!text2.length) return null;
59393
59505
  const m = this.re.schema_at_start.exec(text2);
59394
59506
  if (!m) return null;
59395
59507
  const len = this.testSchemaAt(text2, m[2], m[0].length);
59396
59508
  if (!len) return null;
59397
- this.__schema__ = m[2];
59398
- this.__index__ = m.index + m[1].length;
59399
- this.__last_index__ = m.index + m[0].length + len;
59400
- return createMatch(this, 0);
59509
+ const match2 = new Match(text2, m[2], m.index + m[1].length, m.index + m[0].length + len);
59510
+ this.__compiled__[match2.schema].normalize(match2, this);
59511
+ return match2;
59401
59512
  };
59402
59513
  LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
59403
59514
  list2 = Array.isArray(list2) ? list2 : [list2];
@@ -60908,7 +61019,6 @@ var DEFAULT_POST_INDEX = Object.freeze({
60908
61019
  paginate: true
60909
61020
  });
60910
61021
  var PERMALINK_OUTPUT_STYLES = /* @__PURE__ */ new Set(["directory", "html-extension"]);
60911
- var COMMENT_POLICY_OUTPUT_PATH = "_zeropress/comment-policy.json";
60912
61022
  var SEARCH_INDEX_OUTPUT_PATH = "_zeropress/search.json";
60913
61023
  var SEARCH_ADAPTER_OUTPUT_PATH = "_zeropress/search.js";
60914
61024
  var SEARCH_PAGEFIND_ADAPTER_OUTPUT_PATH = "_zeropress/search_pagefind.js";
@@ -60962,13 +61072,6 @@ async function buildSite(input2) {
60962
61072
  for (const assetOutput of state.assetOutputs) {
60963
61073
  await writeOutput(state.writer, state.summaries, assetOutput.path, assetOutput.content, assetOutput.contentType);
60964
61074
  }
60965
- await writeOutput(
60966
- state.writer,
60967
- state.summaries,
60968
- COMMENT_POLICY_OUTPUT_PATH,
60969
- state.commentPolicyContent,
60970
- "application/json"
60971
- );
60972
61075
  if (shouldGenerateSearchArtifacts(state, options2)) {
60973
61076
  await writeOutput(state.writer, state.summaries, SEARCH_INDEX_OUTPUT_PATH, buildSearchIndexJson(state), "application/json");
60974
61077
  await writeOutput(state.writer, state.summaries, SEARCH_ADAPTER_OUTPUT_PATH, buildSearchAdapterJs(), "application/javascript");
@@ -61026,7 +61129,6 @@ async function createBuildState(input2, options2) {
61026
61129
  customHtml: previewData.custom_html,
61027
61130
  favicon: previewData.site.favicon,
61028
61131
  exposeGenerator: previewData.site.expose_generator !== false,
61029
- commentPolicyContent: buildCommentPolicyManifest(renderData.posts),
61030
61132
  options: options2,
61031
61133
  generatedAt: /* @__PURE__ */ new Date(),
61032
61134
  emitted: {
@@ -61088,7 +61190,7 @@ async function renderRoute(state, templateName, route) {
61088
61190
  route: routeContext,
61089
61191
  meta: buildPageMeta(state.previewData.site, {
61090
61192
  currentUrl,
61091
- title: state.previewData.site.title,
61193
+ title: route.is_front_page === true ? buildFrontPageTitle(state.previewData.site) : state.previewData.site.title,
61092
61194
  description: state.previewData.site.description,
61093
61195
  ogType: "website"
61094
61196
  })
@@ -61132,7 +61234,7 @@ async function renderFrontPage(state, route) {
61132
61234
  route: routeContext,
61133
61235
  meta: buildPageMeta(state.previewData.site, {
61134
61236
  currentUrl,
61135
- title: buildDocumentTitle(page.title, state.previewData.site.title),
61237
+ title: buildFrontPageTitle(state.previewData.site),
61136
61238
  description: page.excerpt,
61137
61239
  ogType: "website",
61138
61240
  image: page.featured_image,
@@ -61164,7 +61266,7 @@ async function renderFrontPage(state, route) {
61164
61266
  route: routeContext,
61165
61267
  meta: buildPageMeta(state.previewData.site, {
61166
61268
  currentUrl,
61167
- title: state.previewData.site.title,
61269
+ title: buildFrontPageTitle(state.previewData.site),
61168
61270
  description: state.previewData.site.description,
61169
61271
  ogType: "website"
61170
61272
  })
@@ -61281,11 +61383,13 @@ async function maybeRenderNotFoundPage(state) {
61281
61383
  await writeOutput(state.writer, state.summaries, "404.html", html, "text/html");
61282
61384
  }
61283
61385
  function normalizePreviewData(previewData, options2 = {}) {
61386
+ const media_base_url = normalizeOptionalString(previewData.site.media_base_url);
61284
61387
  const normalizedSite = {
61285
61388
  ...previewData.site,
61286
- media_base_url: normalizeOptionalString(previewData.site.media_base_url),
61389
+ media_base_url,
61287
61390
  media_delivery_mode: MEDIA_DELIVERY_MODES.has(previewData.site.media_delivery_mode) ? previewData.site.media_delivery_mode : "none",
61288
- favicon: normalizeSiteFavicon(previewData.site.favicon || options2.favicon),
61391
+ favicon: previewData.site.favicon ? normalizeSiteFavicon(previewData.site.favicon, media_base_url) : normalizeSiteFavicon(options2.favicon, ""),
61392
+ logo: normalizeSiteLogo(previewData.site.logo, media_base_url),
61289
61393
  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
61394
  datetime_display: DATETIME_DISPLAY_MODES.has(previewData.site.datetime_display) ? previewData.site.datetime_display : DEFAULT_DATETIME_DISPLAY,
61291
61395
  date_style: DATETIME_STYLES.has(previewData.site.date_style) ? previewData.site.date_style : DEFAULT_DATE_STYLE,
@@ -61528,7 +61632,7 @@ function normalizeCustomHtml(customHtml) {
61528
61632
  ...bodyEnd ? { body_end: { content: bodyEnd } } : {}
61529
61633
  };
61530
61634
  }
61531
- function normalizeSiteFavicon(favicon) {
61635
+ function normalizeSiteFavicon(favicon, media_base_url) {
61532
61636
  if (!favicon || typeof favicon !== "object") {
61533
61637
  return void 0;
61534
61638
  }
@@ -61536,11 +61640,25 @@ function normalizeSiteFavicon(favicon) {
61536
61640
  for (const key of ["icon", "svg", "png", "apple_touch_icon"]) {
61537
61641
  const value = normalizeOptionalString(favicon[key]);
61538
61642
  if (value) {
61539
- normalized[key] = value;
61643
+ normalized[key] = normalizeMediaField(value, media_base_url);
61540
61644
  }
61541
61645
  }
61542
61646
  return Object.keys(normalized).length ? normalized : void 0;
61543
61647
  }
61648
+ function normalizeSiteLogo(logo, media_base_url) {
61649
+ if (!logo || typeof logo !== "object") {
61650
+ return void 0;
61651
+ }
61652
+ const src = normalizeMediaField(logo.src, media_base_url);
61653
+ if (!src) {
61654
+ return void 0;
61655
+ }
61656
+ const alt = normalizeOptionalString(logo.alt);
61657
+ return {
61658
+ src,
61659
+ ...alt ? { alt } : {}
61660
+ };
61661
+ }
61544
61662
  function normalizePermalinks(permalinks) {
61545
61663
  const source = permalinks && typeof permalinks === "object" ? permalinks : {};
61546
61664
  const outputStyle = typeof source.output_style === "string" && PERMALINK_OUTPUT_STYLES.has(source.output_style) ? source.output_style : DEFAULT_PERMALINKS.output_style;
@@ -62114,13 +62232,6 @@ function preparePost(post, site, authorsById, categoriesBySlug, tagsBySlug, them
62114
62232
  comments_enabled: themeSupportsComments && site.disallow_comments !== true && post.allow_comments === true
62115
62233
  };
62116
62234
  }
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
62235
  function buildTaxonomyRoutes(options2) {
62125
62236
  const routes = [];
62126
62237
  for (const item of options2.items) {
@@ -62669,6 +62780,11 @@ function buildDocumentTitle(contentTitle, siteTitle) {
62669
62780
  const resolvedSiteTitle = normalizeNonEmptyString(siteTitle, resolvedContentTitle);
62670
62781
  return `${resolvedContentTitle} - ${resolvedSiteTitle}`;
62671
62782
  }
62783
+ function buildFrontPageTitle(site) {
62784
+ const resolvedSiteTitle = normalizeNonEmptyString(site.title, "");
62785
+ const resolvedDescription = normalizeOptionalString(site.description);
62786
+ return resolvedDescription ? `${resolvedSiteTitle} - ${resolvedDescription}` : resolvedSiteTitle;
62787
+ }
62672
62788
  function buildMetaHeadTags(meta) {
62673
62789
  const tags = [];
62674
62790
  if (meta.description) {
@@ -62930,8 +63046,7 @@ function assertPlannedOutputPathsSafe(state) {
62930
63046
  assertUniqueRoutes(routeEntries);
62931
63047
  const plannedPaths = [
62932
63048
  ...routeEntries.map((entry) => entry.outputPath),
62933
- ...state.assetOutputs.map((assetOutput) => assetOutput.path),
62934
- COMMENT_POLICY_OUTPUT_PATH
63049
+ ...state.assetOutputs.map((assetOutput) => assetOutput.path)
62935
63050
  ];
62936
63051
  if (shouldGenerateSearchArtifacts(state, state.options)) {
62937
63052
  plannedPaths.push(SEARCH_INDEX_OUTPUT_PATH, SEARCH_ADAPTER_OUTPUT_PATH, SEARCH_PAGEFIND_ADAPTER_OUTPUT_PATH);