From 460d27814a5ca8f2229ccfa68b6f2022bf39e8e6 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 28 Oct 2023 22:48:31 +0200 Subject: [PATCH] fix: generate unique properties anchor (#733) BREAKING CHANGE: The way anchors are generated for properties of a propertylist has changed to be unique, even if the shortcode is used multiple times on a page. --- .gitsv/config.yml | 2 +- layouts/shortcodes/propertylist.html | 5 +++-- src/sass/_shortcodes.scss | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitsv/config.yml b/.gitsv/config.yml index 7b9cae5..acaf506 100644 --- a/.gitsv/config.yml +++ b/.gitsv/config.yml @@ -35,7 +35,7 @@ release-notes: - name: Documentation commit-types: [docs] section-type: commits - - name: Breaking Changes + - name: BREAKING CHANGES section-type: breaking-changes commit-message: diff --git a/layouts/shortcodes/propertylist.html b/layouts/shortcodes/propertylist.html index ec62a48..b97faf7 100644 --- a/layouts/shortcodes/propertylist.html +++ b/layouts/shortcodes/propertylist.html @@ -11,7 +11,8 @@ {{- $properties = (sort $properties . $order) }} {{- end }} {{- range $properties }} -
+ {{- $uniqueAnchor := anchorize (printf "%s-%s" $name .name) | safeHTML }} +
{{ .name }} {{- if .required }} {{ i18n "propertylist_required" | lower }} @@ -32,7 +33,7 @@ {{- end }} {{- end }} {{- if $showAnchor }} - + {{- end }} diff --git a/src/sass/_shortcodes.scss b/src/sass/_shortcodes.scss index e2fb574..2e3a1b4 100644 --- a/src/sass/_shortcodes.scss +++ b/src/sass/_shortcodes.scss @@ -90,7 +90,7 @@ padding: 0; } - .gdoc-post__anchor { + .gdoc-page__anchor { display: none; } }