Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/docs/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ export default defineAppConfig({
{ value: "vue", label: "Vue", icon: "i-mdi-vuejs" },
],
},
/**
* Changelog surface, rendered by the layer from the `changelog` collection.
* Styleframe is released by changesets, which tags `styleframe@<version>`;
* the layer's default is the plain `v<version>` tag, so the template is
* stated here. Entries predating that convention (1.0.0, 2.0.0) override the
* whole link from their `releaseUrl` frontmatter.
*/
changelog: {
releaseUrlTemplate: "{repo}/releases/tag/styleframe@{version}",
description:
"Everything new in Styleframe — recipes, engine improvements, and tooling, release by release.",
},
/**
* @docs https://www.docus.dev/concepts/configuration#socials-links
*/
Expand Down
18 changes: 0 additions & 18 deletions apps/docs/app/composables/useChangelogReleaseUrl.ts

This file was deleted.

98 changes: 0 additions & 98 deletions apps/docs/app/pages/[[lang]]/changelog/[slug].vue

This file was deleted.

97 changes: 0 additions & 97 deletions apps/docs/app/pages/[[lang]]/changelog/index.vue

This file was deleted.

35 changes: 1 addition & 34 deletions apps/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import { readdirSync } from "node:fs";
import type { NuxtI18nOptions } from "@nuxtjs/i18n";
import { createResolver, useNuxt } from "@nuxt/kit";
import { createResolver } from "@nuxt/kit";

const { resolve } = createResolver(import.meta.url);

// One prerendered detail route per changelog entry. The version-numbered slugs
// (e.g. /changelog/1.0.0) end in what the Nitro crawler reads as a file
// extension, so it skips them when following links — we list them explicitly so
// every release page lands in the static output, readable with no JS.
const changelogRoutes = readdirSync(resolve("./content/changelog"))
.filter((file) => file.endsWith(".md"))
.map((file) => `/changelog/${file.replace(/\.md$/, "")}`);

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
extends: ["@uxfront/layer-docs"],
Expand Down Expand Up @@ -65,29 +55,6 @@ export default defineNuxtConfig({
autoSubfolderIndex: false,
},
},
hooks: {
"nitro:config"(nitroConfig) {
const nuxt = useNuxt();

const i18nOptions = nuxt.options.i18n as NuxtI18nOptions;

const routes: string[] = [];
if (!i18nOptions) {
routes.push("/");
} else {
routes.push(
...(i18nOptions.locales?.map((locale) =>
typeof locale === "string" ? `/${locale}` : `/${locale.code}`,
) || []),
);
}

nitroConfig.prerender = nitroConfig.prerender || {};
nitroConfig.prerender.routes = nitroConfig.prerender.routes || [];
nitroConfig.prerender.routes.push(...(routes || []));
nitroConfig.prerender.routes.push(...changelogRoutes);
},
},
site: {
url: "https://www.styleframe.dev",
name: "Styleframe — The Design Systems Styling Engine",
Expand Down
Loading