Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix(docs): treat an empty slug like Astro when generating docs ids
Lincoln Steinb2f1c71af0b6
diff --git a/docs/plugins/remark-sort-prefix-slug.mjs b/docs/plugins/remark-sort-prefix-slug.mjsindex f7f502f6f2..17a5e6faa6 100644--- a/docs/plugins/remark-sort-prefix-slug.mjs+++ b/docs/plugins/remark-sort-prefix-slug.mjs@@ -16,6 +16,6 @@ export function remarkSortPrefixSlug({ docsDir }) {file.data.astro ??= {};const frontmatter = (file.data.astro.frontmatter ??= {});- if (typeof frontmatter.slug !== 'string') frontmatter.slug = generateDocsId({ entry, data: frontmatter });+ if (!frontmatter.slug) frontmatter.slug = generateDocsId({ entry, data: frontmatter });};}diff --git a/docs/src/content/docs/development/Documentation/index.mdx b/docs/src/content/docs/development/Documentation/index.mdxindex e6c8d8edbe..6a050ac4e2 100644--- a/docs/src/content/docs/development/Documentation/index.mdx+++ b/docs/src/content/docs/development/Documentation/index.mdx@@ -171,7 +171,7 @@ const sidebar = [To control the sidebar order, prefix a page file or directory name with a number and a dot, such as `01.projects.mdx` or `04.Image Generation/`. The sidebar lists prefixed siblings in numeric order, followed by any unprefixed siblings in their usual order. Among prefixed siblings, the number replaces `sidebar.order`. The prefix never appears in URLs or sidebar labels: `concepts/04.Image Generation/01.introduction.mdx` is served at `/concepts/image-generation/introduction/`, under a group labelled "Image Generation".-Any leading run of digits followed by a dot counts as a prefix, so avoid names like `2.0-migration.mdx` for other purposes. Two siblings that differ only in their prefix map to the same URL, and one of them is dropped.+Any leading run of digits followed by a dot counts as a prefix, so avoid names like `2.0-migration.mdx` for other purposes. Don't prefix the site's root `index.mdx`: the link checker can't match links to `/` against a prefixed root page. Two siblings that differ only in their prefix map to the same URL, and one of them is dropped.:::noteIf you renumber a file while `pnpm dev` is running, its page can disappear until you restart the dev server or touch the file. Builds are not affected.diff --git a/docs/src/lib/sort-prefix.mjs b/docs/src/lib/sort-prefix.mjsindex d163be60d6..7c16f1f2da 100644--- a/docs/src/lib/sort-prefix.mjs+++ b/docs/src/lib/sort-prefix.mjs@@ -25,7 +25,8 @@ export const stripSortPrefix = (segment) => segment.replace(sortPrefixRegEx, '')* @returns {string}*/export const generateDocsId = ({ entry, data }) => {- if (typeof data.slug === 'string') return data.slug;+ // Truthiness, as in Astro's default: an empty slug falls back to the path.+ if (data.slug) return String(data.slug);return entry.replace(/\.[^./]+$/, '').split('/')