mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '7c62d6ef1654c0383eae474d3bd9ddf7754c1f30'
This commit is contained in:
@@ -15,10 +15,10 @@ If [Goldmark](/getting-started/configuration-markup#goldmark) is set as `default
|
||||
Since the `defaultMarkdownHandler` and this template function use the same sanitizing logic, you can use the latter to determine the ID of a header for linking with anchor tags.
|
||||
|
||||
```go-html-template
|
||||
{{ anchorize "This is a header" }} --> "this-is-a-header"
|
||||
{{ anchorize "This is also a header" }} --> "this-is-also----a-header"
|
||||
{{ anchorize "main.go" }} --> "maingo"
|
||||
{{ anchorize "Article 123" }} --> "article-123"
|
||||
{{ anchorize "<- Let's try this, shall we?" }} --> "--lets-try-this-shall-we"
|
||||
{{ anchorize "Hello, 世界" }} --> "hello-世界"
|
||||
{{ anchorize "This is a header" }} → "this-is-a-header"
|
||||
{{ anchorize "This is also a header" }} → "this-is-also----a-header"
|
||||
{{ anchorize "main.go" }} → "maingo"
|
||||
{{ anchorize "Article 123" }} → "article-123"
|
||||
{{ anchorize "<- Let's try this, shall we?" }} → "--lets-try-this-shall-we"
|
||||
{{ anchorize "Hello, 世界" }} → "hello-世界"
|
||||
```
|
||||
|
Reference in New Issue
Block a user