mirror of https://github.com/sveltejs/svelte
parent
3db5e572c5
commit
96ec08a38b
@ -1,8 +1,8 @@
|
||||
{
|
||||
"title": "Svelte 5 (RC)",
|
||||
"tags": {
|
||||
"regex": "^svelte@5\\.0\\.0-(next.\\d+)$"
|
||||
"regex": "^svelte@(5\\.0\\.0-next.\\d+)$"
|
||||
},
|
||||
"path": "documentation/docs",
|
||||
"path": "sites/svelte-5-preview/src/routes/docs/content",
|
||||
"format": "sections"
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
export interface Config {
|
||||
/**
|
||||
* Version group title
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Git tags config
|
||||
*/
|
||||
tags: {
|
||||
/**
|
||||
* Regex for matching tags. The first numbered capturing group must contain the version name.
|
||||
*/
|
||||
regex: string;
|
||||
/**
|
||||
* Options to filter/title the git tags:
|
||||
* - `"minor"` - only take the latest patch version for every minor version.
|
||||
* Version extracted by the regex must match SemVer. The title is `<major>.<minor>`.
|
||||
* - `undefined` _(default)_ - take every matching tag.
|
||||
* The title is the version name.
|
||||
*/
|
||||
filter?: 'minor';
|
||||
};
|
||||
/**
|
||||
* Path inside the git repo that docs are found at
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Format of the docs files:
|
||||
* - `flat` - a list of `00_name.md` files
|
||||
* - `sections` - directories with a `meta.json` and a list of `00_name.md` files
|
||||
*/
|
||||
format: 'flat' | 'sections';
|
||||
}
|
||||
|
||||
export interface VersionGroup {
|
||||
title: string;
|
||||
id: string;
|
||||
versions: Record<string, string>;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
/**
|
||||
* @type {import('@sveltejs/kit').ParamMatcher}
|
||||
*/
|
||||
export const match = (param) => /^v\d/.exec(param) != null;
|
||||
export const match = (param) => param.startsWith('v-');
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { get_versions } from '$lib/server/docs/index.js';
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const GET = async () => {
|
||||
return json(await get_versions());
|
||||
};
|
||||
Loading…
Reference in new issue