Skip to content

Commit

Permalink
build: switch to stable HTML anchors in migration docs #599
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Jul 27, 2023
1 parent cbbbf18 commit 34b1347
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 67 deletions.
12 changes: 11 additions & 1 deletion .github/actions/release_milestone/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ runs:
regex: (\d+\.\d+)\.\d+
replacement: "$1"

- name: Get current main version number for anchoring
id: mainanchor
uses: ashley-taylor/regex-property-action@v1
env:
MILESTONE: ${{ inputs.milestone }}
with:
value: ${{ env.MILESTONE }}
regex: (\d+)\.(\d+)\.\d+
replacement: "$1$2"

- name: Get current major version number
id: majorvers
uses: ashley-taylor/regex-property-action@v1
Expand Down Expand Up @@ -81,7 +91,7 @@ runs:
uses: mingjun97/file-regex-replace@v1
with:
regex: '(.)[\n\r\s]*<!--GH-ACTION-RELEASE-MILESTONE-->[\n\r\s]*-*\s*[\n\r\s]*?[\n\r]+##\s*.*?[\n\r][\n\r\s]*(.)'
replacement: "$1\n\n<!--GH-ACTION-RELEASE-MILESTONE-->\n\n---\n\n## ${{ steps.mainvers.outputs.value }}.0 (${{ steps.date.outputs.time }})\n\n$2"
replacement: "$1\n\n<!--GH-ACTION-RELEASE-MILESTONE-->\n\n---\n\n## ${{ steps.mainvers.outputs.value }}.0 (${{ steps.date.outputs.time }}) {#${{ steps.mainanchor.outputs.value }}0}\n\n$2"
include: exampleSite/content/basics/migration/_index.en.md

- name: Update generator version
Expand Down
80 changes: 40 additions & 40 deletions exampleSite/content/basics/migration/_index.en.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion exampleSite/layouts/partials/shortcodes/piratify.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $content := .content }}
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- $content := .content }}
{{- with $page }}
{{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see http://localhost:1313/basics/migration/#500-2022-07-05" $page.File.Path }}
{{- warnf "%q: DEPRECATED usage of old 'chapter' archetype found, remove 'chapter=true' and add 'archetype=\"chapter\"' to your frontmatter and remove the leading h3 and h1 headings; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Path }}
<article class="chapter deprecated">
<header class="headline">
{{- partial "content-header.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/archetypes/deprecated-home/article.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- $content := .content }}
{{- with $page }}
{{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see http://localhost:1313/basics/migration/#500-2022-07-05" $page.File.Path }}
{{- warnf "%q: DEPRECATED usage of old 'home' archetype found, add 'archetype=\"home\"' to your frontmatter and remove the leading h1 heading; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#500" $page.File.Path }}
<article class="home deprecated">
<header class="headline">
{{- partial "content-header.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
{{- if not .Site.Params.disableLandingPageButton }}
{{- if (ne .Site.Params.landingPageURL nil) }}
{{- warnf "%q: UNSUPPORTED usage of 'landingPageURL' config parameter found, remove it and optionally overwrite the `logo.html` partial to provide a link if it should not point to the project's home page; see http://localhost:1313/basics/migration/#420-2022-06-23" .File.Path }}
{{- warnf "%q: UNSUPPORTED usage of 'landingPageURL' config parameter found, remove it and optionally overwrite the `logo.html` partial to provide a link if it should not point to the project's home page; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#420" .File.Path }}
{{- end }}
<div id="homelinks" class="default-animation">
<ul>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/attachments.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'attachments' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'attachments' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/badge.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/button.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'button' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'button' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/children.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'children' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'children' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $showhidden := .showhidden | default false }}
{{- if eq (printf "%T" $showhidden) "string" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/expand.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $content := .content }}
{{- $title := .title | default (T "Expand-title") }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/highlight.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'highlight' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'highlight' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $attributes := dict }}
{{- $otherAttributes := dict }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/icon.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $icon := .icon | default "" }}
{{- $icon = trim $icon " " }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'image' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'image' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $url := .url }}
{{- $title := .title }}
Expand Down Expand Up @@ -30,7 +30,7 @@
{{- $classes = $classes | append (split ($dest_url.Query.Get "classes") ",") }}
{{- end }}
{{- if $dest_url.Query.Has "featherlight" }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see http://localhost:1313/basics/migration/#5110-2023-02-07" $page.File.Path }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5110" $page.File.Path }}
{{- end }}
{{- $lightbox = and (ne ($dest_url.Query.Get "lightbox") "false") (ne ($dest_url.Query.Get "featherlight") "false") }}
{{- with $dest_url.Query.Get "height" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/include.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'include' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'include' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $file := .file }}
{{- $hideFirstHeading := .hidefirstheading | default false }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/link.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'link' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'link' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $url := .url }}
{{- $title := .title | default "" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/math.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'math' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'math' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $content := .content }}
{{- $align := .align | default "center" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/mermaid.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $content := .content }}
{{- $align := .align | default "center" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/notice.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/openapi.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $src := .src }}
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/siteparam.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'siteparam' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'siteparam' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $paramNames := split .name "." }}
{{- with $page }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/shortcodes/swagger.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ warnf "%q: DEPRECATED shortcode `swagger`found, use `openapi` instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5130-2023-05-17" .context.File.Path }}
{{ warnf "%q: DEPRECATED shortcode `swagger`found, use `openapi` instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5130" .context.File.Path }}
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'swagger' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'swagger' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- partial "shortcodes/openapi.html" (dict
"page" $page
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/tab.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tab' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tab' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $tabs := (slice | append (dict
"color" .color
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/shortcodes/tabs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tabs' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180-2023-07-27" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tabs' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5180" $page.File.Path }}
{{- end }}
{{- $groupid := .groupid | default (partial "make-random-md5.hugo" $page) }}
{{- $color := .color }}
Expand All @@ -11,7 +11,7 @@
{{- $tabs := slice }}
{{- range $tab := (.content | default slice) }}
{{- if and (not $tab.title) $tab.name }}
{{- warnf "%q: DEPRECATED parameter 'name' for shortcode 'tab' found, use 'title' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5160-2023-06-08" $page.File.Path }}
{{- warnf "%q: DEPRECATED parameter 'name' for shortcode 'tab' found, use 'title' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5160" $page.File.Path }}
{{- $tab = merge $tab (dict "title" .name) }}
{{- end }}
{{- with $tab }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/include.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if (.Get "showfirstheading") }}
{{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#420-2022-06-23" .Page.File.Path }}
{{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#420" .Page.File.Path }}
{{- end }}
{{- partial "shortcodes/include.html" (dict
"page" .Page
Expand Down

0 comments on commit 34b1347

Please sign in to comment.