mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	add Table of Contents
- can be used by
     `ShowToc = true` in Single Post params
			
			
This commit is contained in:
		| @@ -45,3 +45,9 @@ | |||||||
|     padding-left: 18px; |     padding-left: 18px; | ||||||
|     padding-right: 16px; |     padding-right: 16px; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .toc { | ||||||
|  |     border-bottom: 1px solid var(--border); | ||||||
|  |     font-size: 20px; | ||||||
|  |     font-weight: 500; | ||||||
|  | } | ||||||
| @@ -12,6 +12,12 @@ | |||||||
|       {{- .Date.Format "January 2, 2006" -}} |       {{- .Date.Format "January 2, 2006" -}} | ||||||
|     </div> |     </div> | ||||||
|   </header> |   </header> | ||||||
|  |   {{ if .Params.ShowToc }} | ||||||
|  |   <blockquote> | ||||||
|  |     <div class="toc">Table of Contents</div> | ||||||
|  |     {{ .TableOfContents }} | ||||||
|  |   </blockquote> | ||||||
|  |   {{ end }} | ||||||
|   <div class="post-content">{{ .Content }}</div> |   <div class="post-content">{{ .Content }}</div> | ||||||
|   {{- if .Params.tags }} |   {{- if .Params.tags }} | ||||||
|   <footer class="post-footer"> |   <footer class="post-footer"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange