Skip to content

Commit 54ca217

Browse files
authored
fix(release): wrap changelog with v-pre directive (#2526)
1 parent a6c0c1d commit 54ca217

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

cmd/release/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ func changelog(version *semver.Version) error {
121121
return err
122122
}
123123

124+
// Wrap the changelog content with v-pre directive for VitePress to prevent
125+
// Vue from interpreting template syntax like {{.TASK_VERSION}}
126+
changelogWithVPre := strings.Replace(changelog, "# Changelog\n\n", "# Changelog\n\n::: v-pre\n\n", 1) + "\n:::"
127+
124128
// Add the frontmatter to the changelog
125-
changelog = fmt.Sprintf("---\n%s\n---\n\n%s", frontmatter, changelog)
129+
changelogWithFrontmatter := fmt.Sprintf("---\n%s\n---\n\n%s", frontmatter, changelogWithVPre)
126130

127131
// Write the changelog to the target file
128-
return os.WriteFile(changelogTarget, []byte(changelog), 0o644)
132+
return os.WriteFile(changelogTarget, []byte(changelogWithFrontmatter), 0o644)
129133
}
130134

131135
func setVersionFile(fileName string, version *semver.Version) error {

website/src/docs/changelog.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ outline: deep
55

66
# Changelog
77

8+
::: v-pre
9+
810
## v3.45.5 - 2025-11-11
911

1012
- Fixed bug that made a generic message, instead of an useful one, appear when a
@@ -181,7 +183,7 @@ Reverted the changes made in #2113 and #2186 that affected the
181183
- The default taskfile (output when using the `--init` flag) is now an embedded
182184
file in the binary instead of being stored in the code (#2112 by @pd93).
183185
- Improved the way we report the Task version when using the `--version` flag or
184-
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more
186+
`{{.TASK_VERSION}}` variable. This should now be more
185187
consistent and easier for package maintainers to use (#2131 by @pd93).
186188
- Fixed a bug where globstar (`**`) matching in `sources` only resolved the
187189
first result (#2073, #2075 by @pd93).
@@ -642,8 +644,8 @@ stabilize the API in the future. #121 now tracks this piece of work.
642644
- Fix a missing a line break on log when using `--watch` mode (#1285, #1297 by
643645
@FilipSolich).
644646
- Fix `defer` on JSON Schema (#1288 by @calvinmclean and @andreynering).
645-
- Fix bug in usage of special variables like
646-
<span v-pre>`{{.USER_WORKING_DIR}}`</span> in combination with `includes`
647+
- Fix bug in usage of special variables like `{{.USER_WORKING_DIR}}` in
648+
combination with `includes`
647649
(#1046, #1205, #1250, #1293, #1312, #1274 by @andarto, #1309 by
648650
@andreynering).
649651
- Fix bug on `--status` flag. Running this flag should not have side-effects: it
@@ -750,11 +752,10 @@ it a go and let us know what you think via a
750752
- Added task location data to the `--json` flag output (#1056 by @pd93)
751753
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to
752754
`Taskfile.yml` (#1062 by @misitebao).
753-
- Added new `splitArgs` template function
754-
(<span v-pre>`{{splitArgs "foo bar 'foo bar baz'"}}`</span>) to ensure string
755-
is split as arguments (#1040, #1059 by @dhanusaputra).
756-
- Fix the value of <span v-pre>`{{.CHECKSUM}}`</span> variable in status (#1076,
757-
#1080 by @pd93).
755+
- Added new `splitArgs` template function (`{{splitArgs "foo bar 'foo bar
756+
baz'"}}`) to ensure string is split as arguments (#1040, #1059 by
757+
@dhanusaputra).
758+
- Fix the value of `{{.CHECKSUM}}` variable in status (#1076, #1080 by @pd93).
758759
- Fixed deep copy implementation (#1072 by @pd93)
759760
- Created a tool to assist with releases (#1086 by @pd93).
760761

@@ -962,8 +963,8 @@ it a go and let us know what you think via a
962963

963964
- Add logging in verbose mode for when a task starts and finishes (#533, #588).
964965
- Fix an issue with preconditions and context errors (#597, #598).
965-
- Quote each <span v-pre>`{{.CLI_ARGS}}`</span> argument to prevent one with
966-
spaces to become many (#613).
966+
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many
967+
(#613).
967968
- Fix nil pointer when `cmd:` was left empty (#612, #614).
968969
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant
969970
fixes:
@@ -978,9 +979,9 @@ it a go and let us know what you think via a
978979

979980
## v3.9.0 - 2021-10-02
980981

981-
- A new `shellQuote` function was added to the template system
982-
(<span v-pre>`{{shellQuote "a string"}}`</span>) to ensure a string is safe
983-
for use in shell ([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
982+
- A new `shellQuote` function was added to the template system (`{{shellQuote
983+
"a string"}}`) to ensure a string is safe for use in shell
984+
([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
984985
[mvdan/sh#737](https://github.com/mvdan/sh/pull/737),
985986
[Documentation](https://pkg.go.dev/mvdan.cc/sh/[email protected]/syntax#Quote))
986987
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with
@@ -1365,3 +1366,5 @@ document, since it describes in depth what changed for this version.
13651366
## v1.0.0 - 2017-02-28
13661367

13671368
- Add LICENSE file
1369+
1370+
:::

0 commit comments

Comments
 (0)