Skip to content

Commit 79c93fb

Browse files
vmaertenpd93andreynering
authored
docs: migrate website to vitepress (#2359)
Co-authored-by: Pete Davison <[email protected]> Co-authored-by: Andrey Nering <[email protected]>
1 parent 64fc538 commit 79c93fb

File tree

137 files changed

+13639
-19421
lines changed

Some content is hidden

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

137 files changed

+13639
-19421
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
indent_style = tab
1010

11-
[*.{md,mdx,yml,yaml,json,toml,htm,html,js,ts,css,svg,sh,bash,fish}]
11+
[*.{md,mdx,yml,yaml,json,toml,htm,html,js,ts,vue,css,svg,sh,bash,fish}]
1212
indent_style = space
1313
indent_size = 2

.github/workflows/lint.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,4 @@ jobs:
4040
run: python -m pip install 'check-jsonschema==0.27.3'
4141

4242
- name: check-jsonschema (metaschema)
43-
run: check-jsonschema --check-metaschema website/static/schema.json
44-
check_doc:
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: actions/checkout@v4
48-
- name: Get changed files in the docs folder
49-
id: changed-files-specific
50-
uses: tj-actions/changed-files@v46
51-
with:
52-
files: website/versioned_docs/**
53-
54-
- uses: actions/github-script@v7
55-
if: steps.changed-files-specific.outputs.any_changed == 'true'
56-
with:
57-
script: |
58-
core.setFailed('website/versioned_docs has changed. Instead you need to update the docs in the website/docs folder.')
59-
check_schema:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v4
63-
- name: Get changed files in the docs folder
64-
id: changed-files-specific
65-
uses: tj-actions/changed-files@v46
66-
with:
67-
files: |
68-
website/static/schema.json
69-
website/static/schema-taskrc.json
70-
- uses: actions/github-script@v7
71-
if: steps.changed-files-specific.outputs.any_changed == 'true'
72-
with:
73-
script: |
74-
core.setFailed('schema.json or schema-taskrc.json has changed. Instead you need to update next-schema.json or next-schema-taskrc.json.')
43+
run: check-jsonschema --check-metaschema website/src/public/schema.json

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ jobs:
1919
with:
2020
go-version: 1.24.x
2121

22+
- name: Install Task
23+
uses: arduino/setup-task@v2
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
28+
- name: Install Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22.x'
32+
cache: 'pnpm'
33+
2234
- name: Run GoReleaser
2335
uses: goreleaser/goreleaser-action@v6
2436
with:
@@ -28,3 +40,8 @@ jobs:
2840
env:
2941
GITHUB_TOKEN: ${{secrets.GH_PAT}}
3042
GORELEASER_KEY: ${{secrets.GORELEASER_KEY}}
43+
44+
- name: Deploy Website
45+
shell: bash
46+
run: |
47+
task website:deploy:prod

cmd/release/main.go

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@ import (
99
"time"
1010

1111
"github.com/Masterminds/semver/v3"
12-
"github.com/otiai10/copy"
1312
"github.com/spf13/pflag"
1413

1514
"github.com/go-task/task/v3/errors"
1615
)
1716

1817
const (
19-
changelogSource = "CHANGELOG.md"
20-
changelogTarget = "website/docs/changelog.mdx"
21-
docsSource = "website/docs"
22-
docsTarget = "website/versioned_docs/version-latest"
23-
schemaSource = "website/static/next-schema.json"
24-
schemaTarget = "website/static/schema.json"
25-
schemaTaskrcSource = "website/static/next-schema-taskrc.json"
26-
schemaTaskrcTarget = "website/static/schema-taskrc.json"
18+
changelogSource = "CHANGELOG.md"
19+
changelogTarget = "website/docs/changelog.md"
2720
)
2821

2922
var (
@@ -83,14 +76,6 @@ func release() error {
8376
return err
8477
}
8578

86-
if err := docs(); err != nil {
87-
return err
88-
}
89-
90-
if err := schema(); err != nil {
91-
return err
92-
}
93-
9479
return nil
9580
}
9681

@@ -173,23 +158,3 @@ func setJSONVersion(fileName string, version *semver.Version) error {
173158
// Write the JSON file
174159
return os.WriteFile(fileName, []byte(new), 0o644)
175160
}
176-
177-
func docs() error {
178-
if err := os.RemoveAll(docsTarget); err != nil {
179-
return err
180-
}
181-
if err := copy.Copy(docsSource, docsTarget); err != nil {
182-
return err
183-
}
184-
return nil
185-
}
186-
187-
func schema() error {
188-
if err := copy.Copy(schemaSource, schemaTarget); err != nil {
189-
return err
190-
}
191-
if err := copy.Copy(schemaTaskrcSource, schemaTaskrcTarget); err != nil {
192-
return err
193-
}
194-
return nil
195-
}

website/.gitignore

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
# Dependencies
22
/node_modules
33

4-
# Production
5-
/build
6-
7-
# Generated files
8-
.docusaurus
9-
.cache-loader
10-
i18n
11-
12-
# Misc
13-
.DS_Store
14-
.env.local
15-
.env.development.local
16-
.env.test.local
17-
.env.production.local
18-
194
npm-debug.log*
205
yarn-debug.log*
216
yarn-error.log*
7+
.vitepress/cache
8+
.vitepress/dist
9+
.task/

website/.nojekyll

Whitespace-only changes.

website/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

website/.vitepress/components.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.vue' {
2+
import type { DefineComponent } from 'vue';
3+
const component: DefineComponent<{}, {}, any>;
4+
export default component;
5+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<template>
2+
<div class="author-compact" v-if="author">
3+
<img :src="author.avatar" :alt="author.name" class="author-avatar" />
4+
<div class="author-info">
5+
<div class="author-name-line">
6+
<span class="author-name">{{ author.name }}</span>
7+
8+
<div class="author-socials">
9+
<a
10+
v-for="{ link, icon } in author.links"
11+
:key="link"
12+
:href="link"
13+
target="_blank"
14+
class="social-link"
15+
>
16+
<span :class="`vpi-social-${icon}`"></span>
17+
</a>
18+
</div>
19+
</div>
20+
<span class="author-bio">{{ author.title }}</span>
21+
</div>
22+
</div>
23+
</template>
24+
25+
<script setup>
26+
import { team } from '../team.ts';
27+
import { computed } from 'vue';
28+
const props = defineProps({
29+
author: String
30+
});
31+
32+
const author = computed(() => {
33+
return team.find((m) => m.slug === props.author) || null;
34+
});
35+
</script>
36+
37+
<style scoped>
38+
.author-compact {
39+
display: flex;
40+
align-items: center;
41+
gap: 0.75rem;
42+
margin: 1.5rem 0;
43+
}
44+
45+
.author-avatar {
46+
width: 48px;
47+
height: 48px;
48+
border-radius: 50%;
49+
object-fit: cover;
50+
}
51+
52+
.author-info {
53+
display: flex;
54+
flex-direction: column;
55+
gap: 0.1rem;
56+
flex: 1;
57+
}
58+
59+
.author-name-line {
60+
display: flex;
61+
align-items: center;
62+
gap: 0.75rem;
63+
}
64+
65+
.author-name {
66+
font-weight: 600;
67+
color: var(--vp-c-text-1);
68+
font-size: 0.95rem;
69+
}
70+
71+
.author-bio {
72+
color: var(--vp-c-text-2);
73+
font-size: 0.85rem;
74+
}
75+
76+
.author-socials {
77+
display: flex;
78+
gap: 0.5rem;
79+
}
80+
81+
.social-link {
82+
color: var(--vp-c-text-2);
83+
transition: color 0.2s;
84+
display: flex;
85+
align-items: center;
86+
}
87+
88+
.social-link:hover {
89+
color: var(--vp-c-brand-1);
90+
}
91+
92+
@media (max-width: 768px) {
93+
.author-compact {
94+
margin-bottom: 1rem;
95+
}
96+
}
97+
</style>

0 commit comments

Comments
 (0)