Skip to content

Commit 190d2e4

Browse files
committed
docs: changelog v1 page
1 parent 5e1048b commit 190d2e4

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Changelog v1
3+
excludeSearch: true
4+
sidebar:
5+
exclude: true
6+
---
7+
8+
Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangci-lint.run).
9+
10+
`golangci-lint` is a free and open-source project built by volunteers.
11+
12+
If you value it, consider supporting us, we appreciate it!
13+
14+
{{< golangci/button text="Donate ❤️" link="/docs/donate" >}}
15+
16+
{{% golangci/embed file=".tmp/raw_changelog_v1.tmp" %}}

docs/content/docs/product/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ If you value it, consider supporting us, we appreciate it!
1515
{{< golangci/button text="Donate ❤️" link="/docs/donate" >}}
1616

1717
{{% golangci/embed file=".tmp/raw_changelog.tmp" %}}
18+
19+
## v1.x.x
20+
21+
{{< cards cols=2 >}}
22+
{{< card link="/docs/product/changelog-v1" title="Changelog of golangci-lint v1" icon="collection" >}}
23+
{{< /cards >}}

scripts/website/expand_templates/changelog.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,31 @@ import (
66
"path/filepath"
77
)
88

9-
func copyChangelog(dir string) error {
10-
marker := "<!-- START --->"
9+
func copyChangelogs(dir string) error {
10+
data := map[string]string{
11+
"CHANGELOG.md": filepath.Join(dir, "raw_changelog.tmp"),
12+
"CHANGELOG-v1.md": filepath.Join(dir, "raw_changelog_v1.tmp"),
13+
}
14+
15+
for src, dst := range data {
16+
err := copyChangelog(src, dst)
17+
if err != nil {
18+
return err
19+
}
20+
}
21+
22+
return nil
23+
}
24+
25+
func copyChangelog(src, dst string) error {
26+
markerStart := "<!-- START --->"
1127

12-
in, err := os.ReadFile("CHANGELOG.md")
28+
in, err := os.ReadFile(src)
1329
if err != nil {
1430
return err
1531
}
1632

17-
out, err := os.Create(filepath.Join(dir, "raw_changelog.tmp"))
33+
out, err := os.Create(dst)
1834
if err != nil {
1935
return err
2036
}
@@ -24,7 +40,7 @@ func copyChangelog(dir string) error {
2440
var write bool
2541

2642
for line := range bytes.Lines(bytes.ReplaceAll(in, []byte("### "), []byte("## "))) {
27-
if bytes.Equal(bytes.TrimSpace(line), []byte(marker)) {
43+
if bytes.Equal(bytes.TrimSpace(line), []byte(markerStart)) {
2844
write = true
2945
continue
3046
}

scripts/website/expand_templates/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func saveTmp(tmpDir string) error {
4040
return fmt.Errorf("copy plugin reference: %w", err)
4141
}
4242

43-
err = copyChangelog(tmpDir)
43+
err = copyChangelogs(tmpDir)
4444
if err != nil {
4545
return fmt.Errorf("copy changelog: %w", err)
4646
}

0 commit comments

Comments
 (0)