Skip to content

Commit ecfc77c

Browse files
committed
Docs: split changelog into per-release files
Use these as the body for (future) GitHub releases
1 parent 6cde18d commit ecfc77c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2309
-2183
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ jobs:
314314
path: npm
315315
- name: Create npm workspace tarball
316316
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
317+
- name: Parse semver for tag
318+
if: startsWith(github.ref, 'refs/tags/v')
319+
uses: madhead/semver-utils@v4
320+
id: semver
321+
with:
322+
version: ${{ github.ref_name }}
317323
- name: Create GitHub release for tag
318324
if: startsWith(github.ref, 'refs/tags/v')
319325
uses: ncipollo/release-action@v1
@@ -322,3 +328,4 @@ jobs:
322328
artifactContentType: application/x-xz
323329
prerelease: ${{ contains(github.ref, '-rc') }}
324330
makeLatest: ${{ !contains(github.ref, '-rc') }}
331+
bodyFile: "docs/src/content/docs/changelog/v${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.semver.outputs.patch }}.md"

docs/astro.config.mjs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
33
import starlight from '@astrojs/starlight';
4+
import starlightAutoSidebar from 'starlight-auto-sidebar';
5+
6+
import { version } from '../package.json';
47

58
export default defineConfig({
69
site: 'https://sharp.pixelplumbing.com',
@@ -68,12 +71,20 @@ export default defineConfig({
6871
]
6972
},
7073
{ label: 'Performance', slug: 'performance' },
71-
{ label: 'Changelog', slug: 'changelog' }
74+
{
75+
label: 'Changelog',
76+
collapsed: true,
77+
autogenerate: { directory: 'changelog' }
78+
}
7279
],
7380
social: [
7481
{ icon: 'openCollective', label: 'Open Collective', href: 'https://opencollective.com/libvips' },
7582
{ icon: 'github', label: 'GitHub', href: 'https://github.com/lovell/sharp' }
76-
]
83+
],
84+
plugins: [starlightAutoSidebar()]
7785
})
78-
]
86+
],
87+
redirects: {
88+
'/changelog': `/changelog/v${version}`
89+
}
7990
});

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.34.3",
15-
"astro": "^5.7.13"
14+
"@astrojs/starlight": "^0.34.6",
15+
"astro": "^5.11.1",
16+
"starlight-auto-sidebar": "^0.1.2"
1617
}
1718
}

docs/src/content.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { defineCollection } from 'astro:content';
22
import { docsLoader } from '@astrojs/starlight/loaders';
33
import { docsSchema } from '@astrojs/starlight/schema';
4+
import { autoSidebarLoader } from 'starlight-auto-sidebar/loader'
5+
import { autoSidebarSchema } from 'starlight-auto-sidebar/schema'
46

57
export const collections = {
68
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
9+
autoSidebar: defineCollection({ loader: autoSidebarLoader(), schema: autoSidebarSchema() })
710
};

0 commit comments

Comments
 (0)