Skip to content

Commit 0cebb32

Browse files
authored
fix(website): sync de showcase, add contribute page, fix sitemap URLs (#102)
- Replace stale "Kommt bald" placeholder in `de/showcase/index.md` with the full `CommunityGallery` component, matching the English page - Add `de/showcase/contribute.md` — German translation of the contribution guide (was missing entirely) - Add `/de/showcase/` sidebar with German labels by parameterising `buildShowcaseSidebar()` - Fix Google Search Console "Duplicate without user-selected canonical": VitePress sitemap was emitting `.html` URLs while `transformHead` emitted clean canonical tags — strip `.html` in `sitemap.transformItems` so both match Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
1 parent 1aca41d commit 0cebb32

3 files changed

Lines changed: 192 additions & 15 deletions

File tree

website/.vitepress/config.ts

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,25 @@ try {
1818
}
1919

2020
// Build showcase sidebar from community folder
21-
function buildShowcaseSidebar() {
21+
interface ShowcaseSidebarLabels {
22+
showcase: string
23+
allProfiles: string
24+
contribute: string
25+
byTag: string
26+
byAuthor: string
27+
byName: string
28+
basePath: string
29+
}
30+
31+
function buildShowcaseSidebar(labels: ShowcaseSidebarLabels = {
32+
showcase: 'Showcase',
33+
allProfiles: 'All Profiles',
34+
contribute: 'Contribute',
35+
byTag: 'By Tag',
36+
byAuthor: 'By Author',
37+
byName: 'By Name',
38+
basePath: '/showcase',
39+
}) {
2240
const communityDir = path.resolve(__dirname, '../../community')
2341
const tags = new Set<string>()
2442
const authors = new Set<string>()
@@ -37,37 +55,38 @@ function buildShowcaseSidebar() {
3755
}
3856

3957
const COLLAPSE_THRESHOLD = 10
58+
const base = labels.basePath
4059

4160
return [
4261
{
43-
text: 'Showcase',
62+
text: labels.showcase,
4463
items: [
45-
{ text: `All Profiles (${names.length})`, link: '/showcase/' },
46-
{ text: 'Contribute', link: '/showcase/contribute' },
64+
{ text: `${labels.allProfiles} (${names.length})`, link: `${base}/` },
65+
{ text: labels.contribute, link: `${base}/contribute` },
4766
],
4867
},
4968
{
50-
text: 'By Tag',
69+
text: labels.byTag,
5170
collapsed: false,
5271
items: Array.from(tags).sort().map(tag => ({
5372
text: tag,
54-
link: `/showcase/#tag=${tag}`,
73+
link: `${base}/#tag=${tag}`,
5574
})),
5675
},
5776
{
58-
text: 'By Author',
77+
text: labels.byAuthor,
5978
collapsed: authors.size > COLLAPSE_THRESHOLD,
6079
items: Array.from(authors).sort().map(author => ({
6180
text: author,
62-
link: `/showcase/#author=${author}`,
81+
link: `${base}/#author=${author}`,
6382
})),
6483
},
6584
{
66-
text: 'By Name',
85+
text: labels.byName,
6786
collapsed: names.length > COLLAPSE_THRESHOLD,
6887
items: names.sort((a, b) => a.label.localeCompare(b.label)).map(n => ({
6988
text: n.label,
70-
link: `/showcase/#name=${n.slug}`,
89+
link: `${base}/#name=${n.slug}`,
7190
})),
7291
},
7392
]
@@ -101,6 +120,16 @@ export default defineConfig({
101120
cleanUrls: true,
102121
sitemap: {
103122
hostname: 'https://amoxide.rs',
123+
transformItems(items) {
124+
return items.map(item => ({
125+
...item,
126+
url: item.url.replace(/\.html$/, ''),
127+
links: item.links?.map(link => ({
128+
...link,
129+
url: link.url.replace(/\.html$/, ''),
130+
})),
131+
}))
132+
},
104133
},
105134
transformHead({ pageData }) {
106135
const canonicalUrl = `https://amoxide.rs/${pageData.relativePath}`
@@ -242,6 +271,15 @@ export default defineConfig({
242271
],
243272
},
244273
],
274+
'/de/showcase/': buildShowcaseSidebar({
275+
showcase: 'Showcase',
276+
allProfiles: 'Alle Profile',
277+
contribute: 'Beitragen',
278+
byTag: 'Nach Tag',
279+
byAuthor: 'Nach Autor',
280+
byName: 'Nach Name',
281+
basePath: '/de/showcase',
282+
}),
245283
},
246284
},
247285
},

website/de/showcase/contribute.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Profile teilen
2+
3+
Hast du eine Profil-Sammlung, die andere nützlich finden könnten? So fügst du sie dem Showcase hinzu.
4+
5+
## Voraussetzungen
6+
7+
- [amoxide](https://github.com/sassman/amoxide-rs) installiert
8+
- Ein [GitHub](https://github.com)-Konto
9+
10+
## Schritt für Schritt
11+
12+
Angenommen, dein GitHub-Nutzername ist **john** und du möchtest deine Git-Profile für konventionelle Commits teilen.
13+
14+
### 1. Repository forken
15+
16+
Gehe zu [github.com/sassman/amoxide-rs](https://github.com/sassman/amoxide-rs) und klicke auf **Fork** (oben rechts). Dadurch wird deine eigene Kopie unter `github.com/john/amoxide-rs` erstellt.
17+
18+
### 2. Fork klonen
19+
20+
```bash
21+
git clone git@github.com:john/amoxide-rs.git
22+
cd amoxide-rs
23+
```
24+
25+
### 3. Branch erstellen
26+
27+
```bash
28+
git checkout -b community/john-git-conventional
29+
```
30+
31+
### 4. Vorlage kopieren
32+
33+
```bash
34+
cp -r community/TEMPLATE community/john-git-conventional
35+
```
36+
37+
Das ergibt:
38+
39+
```
40+
community/john-git-conventional/
41+
├── README.md ← bearbeite diese Datei
42+
└── profiles.toml ← ersetze mit deinem Export
43+
```
44+
45+
### 5. Profile exportieren
46+
47+
Ersetze die Vorlagen-`profiles.toml` mit deinem eigentlichen Export:
48+
49+
```bash
50+
am export -p git-conventional > community/john-git-conventional/profiles.toml
51+
```
52+
53+
Oder exportiere mehrere Profile:
54+
55+
```bash
56+
am export -p git -p git-conventional > community/john-git-conventional/profiles.toml
57+
```
58+
59+
### 6. README bearbeiten
60+
61+
Öffne `community/john-git-conventional/README.md` und fülle das Frontmatter aus:
62+
63+
```yaml
64+
---
65+
author: john
66+
description: Git-Aliase für konventionelle Commit-Workflows
67+
category: git
68+
tags: [git, conventional-commits, workflow]
69+
profiles: [git, git-conventional]
70+
---
71+
```
72+
73+
Schreibe dann ein paar Sätze darüber, was deine Aliase tun, wie du sie verwendest und welche Tools installiert sein müssen.
74+
75+
::: details Frontmatter-Referenz
76+
| Feld | Pflichtfeld | Beschreibung |
77+
|------|-------------|--------------|
78+
| `author` | ja | Dein GitHub-Nutzername |
79+
| `description` | ja | Einzeilige Zusammenfassung (wird auf der Kachel angezeigt) |
80+
| `category` | ja | Eines von: `git`, `docker`, `rust`, `k8s`, `python`, `node`, `misc` |
81+
| `tags` | ja | Array von Stichwörtern für die Filterung |
82+
| `profiles` | ja | Profilnamen in deiner `profiles.toml` |
83+
| `shell` | nein | Nur setzen, wenn deine Aliase shell-spezifische Syntax verwenden (z. B. `fish`) |
84+
:::
85+
86+
### 7. Testen
87+
88+
Stelle sicher, dass der Import funktioniert:
89+
90+
```bash
91+
cat community/john-git-conventional/profiles.toml | am import --yes
92+
```
93+
94+
### 8. Committen und pushen
95+
96+
```bash
97+
git add community/john-git-conventional/
98+
git commit -m "community: add john-git-conventional"
99+
git push origin community/john-git-conventional
100+
```
101+
102+
### 9. Pull Request öffnen
103+
104+
Gehe zu deinem Fork auf GitHub — du siehst ein Banner zum Erstellen eines Pull Requests. Klicke darauf und wähle die **Community Profile** PR-Vorlage.
105+
106+
Die Checkliste führt dich durch das Notwendige:
107+
108+
- [ ] Ordner mit dem Namen `community/john-git-conventional/`
109+
- [ ] `profiles.toml` ist eine gültige `am export`-Ausgabe
110+
- [ ] `README.md` hat das erforderliche Frontmatter
111+
- [ ] Nur Dateien in deinem eigenen Ordner wurden geändert
112+
- [ ] Import lokal getestet
113+
114+
Dein Beitrag erscheint nach der Überprüfung im Showcase.
115+
116+
## Regeln
117+
118+
- Füge nur Dateien in deinem eigenen Ordner hinzu oder ändere sie
119+
- Ein Ordner pro Alias-Sammlung (mehrere Profile in einer `profiles.toml` sind in Ordnung)
120+
- Für eine zweite Sammlung erstelle einen zweiten Ordner (z. B. `john-docker-compose`)
121+
122+
## Was macht einen guten Beitrag aus?
123+
124+
- **Nützlich für andere** — Aliase, die häufige Workflows lösen
125+
- **Gut dokumentiert** — erkläre, was jeder Alias tut
126+
- **In sich geschlossen** — weise auf Abhängigkeiten hin
127+
- **Getestet** — überprüfe, dass der Import funktioniert
128+
129+
::: warning Sicherheit
130+
Alle Einsendungen werden vor dem Zusammenführen geprüft. Wir prüfen auf verdächtige Inhalte, aber du solltest Aliase immer selbst inspizieren, bevor du sie importierst — auch aus diesem Showcase.
131+
:::

website/de/showcase/index.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# Showcase
1+
<script setup>
2+
import { data } from '../../showcase/community.data'
3+
</script>
24

3-
::: tip Kommt bald
4-
Der Showcase wird community-erstellte Profile präsentieren, die du durchsuchen und in dein Setup importieren kannst.
5-
:::
5+
# Community Showcase <VersionBadge v="0.4.0" />
6+
7+
Stöbere in Alias-Profilen, die von der Community geteilt wurden. Entdecke nützliche Profile, schaue dir die Aliase an und importiere sie mit einem einzigen Befehl.
8+
9+
Wenn du den Import-Befehl ausführst, zeigt `am` eine Zusammenfassung aller Aliase, bevor etwas übernommen wird — überprüfe sie sorgfältig, bevor du bestätigst.
610

7-
Hast du eine Profil-Sammlung, die du teilen möchtest? Bleib dran — die Import-Funktion ist in Entwicklung.
11+
<CommunityGallery :profiles="data" />
12+
13+
::: tip Möchtest du deine eigenen Profile teilen?
14+
Schau in den [Beitragsleitfaden](./contribute), um zu erfahren, wie du deine einreichst.
15+
:::

0 commit comments

Comments
 (0)