@mark1russell7/site-pages 0.6.0 → 0.7.1

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 CHANGED
@@ -639,6 +639,10 @@ The shell is the part of a page that is not its content. The package has two par
639
639
 
640
640
  The entry `@mark1russell7/site-pages/vite` is for `vite.config.ts`. The plugin `siteShell` sets `base` from `SITE_BASE`, sets `build.target` to `es2022`, defines `__BUILD__`, and adds the theme script to the `head` of each HTML page.
641
641
 
642
+ The plugin also adds an icon link to each HTML page with no icon link. Without an icon link, the browser asks for `/favicon.ico`. A project site on GitHub Pages has no such file, so the console shows a 404 error. The option `icon` sets the `href` of the icon. The value `false` adds no icon.
643
+
644
+ The releases page and the status page have the same icon. `PageOptions.icon` sets its `href`. The root entry exports `SITE_ICON_HREF`, `iconLink(href)` and `hasIconLink(html)`, for a page without the plugin.
645
+
642
646
  ```ts
643
647
  import { defineConfig } from "vite";
644
648
  import { siteShell } from "@mark1russell7/site-pages/vite";
@@ -660,7 +664,7 @@ showBuild(byId("build"), __BUILD__, "owner/my-site");
660
664
 
661
665
  | Export of `./vite` | Operation |
662
666
  | --- | --- |
663
- | `siteShell({ themeKey, packageFile })` | Makes the plugin. A `base` or a `build.target` in the config of the site has priority. |
667
+ | `siteShell({ themeKey, packageFile, icon })` | Makes the plugin. A `base` or a `build.target` in the config of the site has priority. |
664
668
  | `siteStamps(input)` | Makes the plugin of the data stamps of a site. |
665
669
  | `themeScript(storageKey)` | Gives the text of the theme script, for a page without the plugin. |
666
670
  | `siteBase(env)` | Gives `SITE_BASE` with one `/` at the end, or `/`. |
@@ -1,4 +1,4 @@
1
- import { A as headCommit, B as versionOfTag, E as readKpi, I as npmPublishTimes, L as compareVersions, M as isShallow, N as originRepository, R as kindOf, S as KpiError, _ as listText, b as KPI_FILE, g as link, h as inlineMarkdown, j as headingDate, k as gitTagDates, m as escapeHtml, v as plural, z as parseVersion } from "./freshness.js";
1
+ import { A as readKpi, B as npmPublishTimes, E as KpiError, F as headingDate, H as kindOf, I as isShallow, L as originRepository, N as gitTagDates, P as headCommit, S as plural, U as parseVersion, V as compareVersions, W as versionOfTag, _ as iconLink, b as link, v as escapeHtml, w as KPI_FILE, x as listText, y as inlineMarkdown } from "./freshness.js";
2
2
  import { stripTypeScriptTypes } from "node:module";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
4
  import { basename, dirname, isAbsolute, join, posix, resolve } from "node:path";
@@ -1900,6 +1900,7 @@ function pageShell(parts, options) {
1900
1900
  <meta name="color-scheme" content="light dark">
1901
1901
  <title>${escapeHtml(`${parts.title} · ${name}`)}</title>
1902
1902
  <meta name="description" content="${escapeHtml(parts.description)}">
1903
+ ${iconLink(options.icon)}
1903
1904
  <style>${BASE_CSS}${options.extraCss ? `\n${options.extraCss}` : ""}</style>
1904
1905
  <noscript><style>${NO_SCRIPT_CSS}</style></noscript>
1905
1906
  </head>