diff --git a/CHANGELOG.md b/CHANGELOG.md index 707100da..c1ee9f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ Any BREAKING CHANGE between minor versions will be documented here in upper case ### Added - The second argument of the `page.data.url()` function has the default URL value. +### Changed +- Removed schema.org meta tags in metas plugin, because they are are not valid. + Probably it needs a new specific plugin. + +### Fixed +- Ignore error checking Lume version in offline environments [#496]. +- Updated dependencies: `deno_dom`, `katex`, `preact`, `sass`, `svg2png`, `terser`. + ## [1.19.1] - 2023-09-29 ### Added - `modify_urls` plugin: The replace callback can return a `Promise`. @@ -2442,6 +2450,7 @@ The first version. [#488]: https://github.com/lumeland/lume/issues/488 [#490]: https://github.com/lumeland/lume/issues/490 [#492]: https://github.com/lumeland/lume/issues/492 +[#496]: https://github.com/lumeland/lume/issues/496 [1.19.2]: https://github.com/lumeland/lume/compare/v1.19.1...HEAD [1.19.1]: https://github.com/lumeland/lume/compare/v1.19.0...v1.19.1 diff --git a/MIGRATION.md b/MIGRATION.md index bdbfbf7b..adad8cae 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -28,6 +28,7 @@ - Removed `site.cacheFile()` - Removed `Entry.setContent()` - Replace `fn-date` with `Temporal` polyfill to convert dates. +- Removed message to upgrade Lume. ## `search` Plugin diff --git a/cli/build.ts b/cli/build.ts index 0ab9dd7f..ccdcab62 100644 --- a/cli/build.ts +++ b/cli/build.ts @@ -1,4 +1,4 @@ -import { checkUpgrade, log } from "../core/utils.ts"; +import { log } from "../core/utils.ts"; import Server from "../core/server.ts"; import FSWatcher, { SiteWatcher } from "../core/watcher.ts"; import { printError } from "../core/errors.ts"; @@ -43,8 +43,6 @@ export async function build( ` ${total} files generated in ${duration.toFixed(2)} seconds`, ); - await checkUpgrade(); - if (!serve && !watch) { // Prevent possible timers to keep the process alive forever (wait preventively 10 seconds) const id = setTimeout(() => { diff --git a/core/utils.ts b/core/utils.ts index eda04ece..8e31e7e4 100644 --- a/core/utils.ts +++ b/core/utils.ts @@ -81,41 +81,6 @@ export function checkDenoVersion(): void { } } -/** Check if the current version is outdated */ -export async function checkUpgrade(): Promise { - const current = getLumeVersion(); - - // It's a local version - if (current.startsWith("local ")) { - return; - } - - const stable = !!current.match(/^v\d+\./); - const expires = 1000 * 60 * 60 * 24; // 1 day - const interval = localStorage.getItem("lume-upgrade"); - - if (interval && parseInt(interval) + expires > Date.now()) { - return; - } - - localStorage.setItem("lume-upgrade", Date.now().toString()); - - const latest = stable - ? await getLatestVersion() - : await getLatestDevelopmentVersion(); - - if (current === latest) { - return; - } - - const command = "deno task lume upgrade" + (stable ? "" : " --dev"); - - console.log("----------------------------------------"); - console.log(`Update available ${dim(current)} → ${green(latest)}`); - console.log(`Run ${cyan(command)} to update`); - console.log("----------------------------------------"); -} - /** Return the latest stable version from the deno.land/x repository */ export async function getLatestVersion(): Promise { const response = await fetch("https://cdn.deno.land/lume/meta/versions.json"); diff --git a/deps/dom.ts b/deps/dom.ts index 330fdf66..32331c2b 100644 --- a/deps/dom.ts +++ b/deps/dom.ts @@ -1 +1 @@ -export * from "https://deno.land/x/deno_dom@v0.1.40/deno-dom-wasm.ts"; +export * from "https://deno.land/x/deno_dom@v0.1.41-alpha-artifacts/deno-dom-wasm.ts"; diff --git a/deps/katex.ts b/deps/katex.ts index 43e3b2f9..49e49fb1 100644 --- a/deps/katex.ts +++ b/deps/katex.ts @@ -1,4 +1,4 @@ -import katex from "npm:katex@0.16.8"; +import katex from "npm:katex@0.16.9"; export { katex }; diff --git a/deps/preact.ts b/deps/preact.ts index c80d200c..d6682941 100644 --- a/deps/preact.ts +++ b/deps/preact.ts @@ -1,3 +1,3 @@ -export * as preact from "npm:preact@10.18.0"; -export * as hooks from "npm:preact@10.18.0/hooks"; -export { renderToString } from "npm:preact-render-to-string@6.2.1"; +export * as preact from "npm:preact@10.18.1"; +export * as hooks from "npm:preact@10.18.1/hooks"; +export { renderToString } from "npm:preact-render-to-string@6.2.2"; diff --git a/deps/sass.ts b/deps/sass.ts index bf964e55..0182ffb5 100644 --- a/deps/sass.ts +++ b/deps/sass.ts @@ -1 +1 @@ -export * from "npm:sass@1.68.0"; +export * from "npm:sass@1.69.0"; diff --git a/deps/svg2png.ts b/deps/svg2png.ts index 8bd6e605..4acf2fb1 100644 --- a/deps/svg2png.ts +++ b/deps/svg2png.ts @@ -1,8 +1,8 @@ -import { initialize, svg2png } from "npm:svg2png-wasm@1.4.0"; +import { initialize, svg2png } from "npm:svg2png-wasm@1.4.1"; import { read } from "../core/utils.ts"; // Initialize the WASM module -const url = "https://unpkg.com/svg2png-wasm@1.4.0/svg2png_wasm_bg.wasm"; +const url = "https://unpkg.com/svg2png-wasm@1.4.1/svg2png_wasm_bg.wasm"; const wasm = await read(url, true); await initialize(wasm); diff --git a/deps/terser.ts b/deps/terser.ts index b078fc82..af80a5cf 100644 --- a/deps/terser.ts +++ b/deps/terser.ts @@ -1,2 +1,2 @@ -export { minify } from "npm:terser@5.20.0"; -export type { MinifyOptions } from "npm:terser@5.20.0"; +export { minify } from "npm:terser@5.21.0"; +export type { MinifyOptions } from "npm:terser@5.21.0"; diff --git a/plugins/feed.ts b/plugins/feed.ts index 9761a388..aef5f61a 100644 --- a/plugins/feed.ts +++ b/plugins/feed.ts @@ -121,7 +121,7 @@ export interface FeedItem { const defaultGenerator = `Lume ${getLumeVersion()}`; -export default (userOptions?: DeepPartial) => { +export default function (userOptions?: DeepPartial) { const options = merge(defaults, userOptions); return (site: Site) => { @@ -185,7 +185,7 @@ export default (userOptions?: DeepPartial) => { } }); }; -}; +} function fixUrls(base: URL, html: string): string { return html.replaceAll( diff --git a/plugins/metas.ts b/plugins/metas.ts index e4a5791e..257bd8f8 100644 --- a/plugins/metas.ts +++ b/plugins/metas.ts @@ -112,11 +112,6 @@ export default function (userOptions?: Partial): Plugin { ); addMeta(document, "name", "twitter:site", twitter); - // Schema.org - addMeta(document, "itemprop", "name", title); - addMeta(document, "itemprop", "description", description, 155); - addMeta(document, "itemprop", "image", image || icon); - // SEO addMeta(document, "name", "description", description, 155); addMeta(document, "name", "keywords", keywords?.join(", ")); diff --git a/tests/__snapshots__/metas.test.ts.snap b/tests/__snapshots__/metas.test.ts.snap index 90a293b8..ecd8e68a 100644 --- a/tests/__snapshots__/metas.test.ts.snap +++ b/tests/__snapshots__/metas.test.ts.snap @@ -117,9 +117,6 @@ snapshot[`metas plugin 3`] = ` - - - @@ -195,9 +192,6 @@ snapshot[`metas plugin 3`] = ` - - - @@ -272,9 +266,6 @@ snapshot[`metas plugin 3`] = ` - - - diff --git a/tests/assets/mdx/_components/Header.jsx b/tests/assets/mdx/_components/Header.jsx index d1a14e54..688a3ba0 100644 --- a/tests/assets/mdx/_components/Header.jsx +++ b/tests/assets/mdx/_components/Header.jsx @@ -1,4 +1,4 @@ -/** @jsxImportSource https://esm.sh/preact */ +/** @jsxImportSource npm:preact */ export default function Header({ title, description }) { return ( diff --git a/tests/assets/mdx/_includes/Image.tsx b/tests/assets/mdx/_includes/Image.tsx index 99ec4027..50f2889a 100644 --- a/tests/assets/mdx/_includes/Image.tsx +++ b/tests/assets/mdx/_includes/Image.tsx @@ -1,4 +1,4 @@ -/** @jsxImportSource https://esm.sh/preact */ +/** @jsxImportSource npm:preact */ interface Options { src: string; diff --git a/tests/mdx.test.ts b/tests/mdx.test.ts index 4a4a9ba7..3faf8e07 100644 --- a/tests/mdx.test.ts +++ b/tests/mdx.test.ts @@ -9,7 +9,7 @@ Deno.test("Build a mdx site", async (t) => { site.use(jsx()); site.use(mdx({ - pragma: "/** @jsxImportSource https://esm.sh/preact */", + pragma: "/** @jsxImportSource npm:preact */", })); await build(site);