mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	
		
			
				
	
	
	
		
			944 B
		
	
	
	
	
	
	
	
			
		
		
	
	
			944 B
		
	
	
	
	
	
	
	
title, description, date, categories, menu, keywords, signature, hugoversion, workson, relatedfuncs
| title | description | date | categories | menu | keywords | signature | hugoversion | workson | relatedfuncs | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| anchorize | Takes a string and sanitizes it the same way as Blackfriday does for markdown headers. | 2018-10-13 | 
 | 
 | 
 | 
 | 0.39 | 
 | 
The template function uses the SanitizedAnchorName logic from Blackfriday.
Since the same sanitizing logic is used as the markdown parser, you can determine the ID of a header for linking with anchor tags.
{{anchorize "This is a header"}} → "this-is-a-header"
{{anchorize "This is also          a header"}} → "this-is-also-a-header"
{{anchorize "main.go"}} → "main-go"
{{anchorize "Article 123"}} → "article-123"
{{anchorize "<- Let's try this, shall we?"}} → "let-s-try-this-shall-we"
{{anchorize "Hello, 世界"}} → "hello-世界"