mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-04 09:15:33 +00:00
Add version v28 (#564)
<!-- cloudflare-preview --> Preview: https://pr-564.docs-gitea-com.pages.dev Reviewed-on: https://gitea.com/gitea/docs/pulls/564 Reviewed-by: bircni <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
This commit is contained in:
@@ -211,7 +211,12 @@ async function parseFile(
|
||||
tableOfContents: frontmatter.toc !== false,
|
||||
sidebarLabel: asString(frontmatter.sidebar_label),
|
||||
body,
|
||||
digest: generateDigest(`${transformVersion}\u0000${substituted}`),
|
||||
// the version and the route are part of the stored data, so they have to
|
||||
// invalidate the entry too: an identical page of another version, or of the
|
||||
// same version moved to another prefix, must not reuse a stale entry
|
||||
digest: generateDigest(
|
||||
`${transformVersion}\u0000${segment.product.id}/${segment.version.id}/${segment.locale}/${segment.prefix}\u0000${substituted}`,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -374,7 +379,9 @@ async function resolveCategories(
|
||||
|
||||
async function renderCategory(context: LoaderContext, category: ParsedCategory): Promise<void> {
|
||||
const { generateDigest, parseData, renderMarkdown, store } = context;
|
||||
const digest = generateDigest(`${transformVersion}\u0000${category.title}\u0000${category.body}`);
|
||||
const digest = generateDigest(
|
||||
`${transformVersion}\u0000${category.segment.product.id}/${category.segment.version.id}/${category.segment.locale}/${category.segment.prefix}\u0000${category.title}\u0000${category.body}`,
|
||||
);
|
||||
if (store.get(category.id)?.digest === digest) return;
|
||||
|
||||
const filePath = `${collectionRoot}/${category.id}.md`;
|
||||
|
||||
@@ -76,14 +76,24 @@ export const defaultLocale: LocaleId = 'en-us';
|
||||
|
||||
const variables: Record<string, VersionVariables> = {
|
||||
next: {
|
||||
goVersion: '1.26',
|
||||
minGoVersion: '1.26',
|
||||
goVersion: '1.27',
|
||||
minGoVersion: '1.27',
|
||||
minNodeVersion: '22',
|
||||
version: 'main-nightly',
|
||||
sourceVersion: 'main',
|
||||
sourceBranch: 'main',
|
||||
dockerVersion: 'main-nightly',
|
||||
displayVersion: '1.28-dev',
|
||||
displayVersion: '29-dev',
|
||||
},
|
||||
'28': {
|
||||
goVersion: '1.27',
|
||||
minGoVersion: '1.27',
|
||||
minNodeVersion: '22',
|
||||
version: '28.0.0',
|
||||
sourceVersion: 'v28.0.0',
|
||||
sourceBranch: 'release/v28',
|
||||
dockerVersion: '28.0.0',
|
||||
displayVersion: '28.0.0',
|
||||
},
|
||||
'1.27': {
|
||||
goVersion: '1.26',
|
||||
@@ -177,14 +187,14 @@ const docsProduct: ProductDef = {
|
||||
variables: variables.next,
|
||||
},
|
||||
{
|
||||
id: '1.27',
|
||||
label: variables['1.27'].displayVersion,
|
||||
id: '28',
|
||||
label: variables['28'].displayVersion,
|
||||
path: '',
|
||||
latest: true,
|
||||
sources: docsSources('1.27'),
|
||||
variables: variables['1.27'],
|
||||
sources: docsSources('28'),
|
||||
variables: variables['28'],
|
||||
},
|
||||
...['1.26', '1.25', '1.24', '1.23', '1.22'].map(
|
||||
...['1.27', '1.26', '1.25', '1.24', '1.23', '1.22'].map(
|
||||
(id): VersionDef => ({
|
||||
id,
|
||||
label: variables[id]!.displayVersion,
|
||||
@@ -251,11 +261,19 @@ const apiProduct: ProductDef = {
|
||||
openapi3: 'static/openapi3-latest.json',
|
||||
},
|
||||
{
|
||||
id: '1.27',
|
||||
label: variables['1.27'].displayVersion,
|
||||
id: '28',
|
||||
label: variables['28'].displayVersion,
|
||||
path: '',
|
||||
latest: true,
|
||||
sources: {},
|
||||
schema: 'static/swagger-28.json',
|
||||
openapi3: 'static/openapi3-28.json',
|
||||
},
|
||||
{
|
||||
id: '1.27',
|
||||
label: variables['1.27'].displayVersion,
|
||||
path: '1.27',
|
||||
sources: {},
|
||||
schema: 'static/swagger-27.json',
|
||||
openapi3: 'static/openapi3-27.json',
|
||||
},
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* handwritten sidebar files of the runner docs.
|
||||
*/
|
||||
|
||||
import { defaultLocale } from './products';
|
||||
|
||||
export interface SidebarPage {
|
||||
/** Route id of the page. */
|
||||
id: string;
|
||||
@@ -164,7 +166,9 @@ function fromDocusaurus(
|
||||
}
|
||||
if (item.type === 'doc') {
|
||||
const page = byDocId.get(item.id);
|
||||
return page && link(page, item.label ?? page.title);
|
||||
// the label of the sidebar file is english, the title of a translated
|
||||
// page is already localized (docusaurus translated it from the json)
|
||||
return page && link(page, page.meta.locale === defaultLocale ? (item.label ?? page.title) : page.title);
|
||||
}
|
||||
if (item.type === 'autogenerated') {
|
||||
// only reached inside a category, the caller flattens the result
|
||||
|
||||
Reference in New Issue
Block a user