mirror of
				https://github.com/alrayyes/wiki.git
				synced 2025-08-07 15:21:03 +00:00 
			
		
		
		
	feat: allow enableToc to override default no TOC on a per-page basis
This commit is contained in:
		
					parent
					
						
							
								151b9851d6
							
						
					
				
			
			
				commit
				
					
						7f9f58860d
					
				
			
		
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
{{ $hasHeaders := gt (len (findRE "<h\\d.*?>(.|\n)*?</h\\d>" .Content)) 0 }}
 | 
			
		||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders) }}
 | 
			
		||||
{{ if (or (and (not $.Site.Data.config.enableToc) .Params.enableToc) (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders)) }}
 | 
			
		||||
<aside class="mainTOC">
 | 
			
		||||
    <details {{ if $.Site.Data.config.openToc }}open {{ end }}>
 | 
			
		||||
        <summary>{{ i18n "toc" }}</summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue