mirror of
				https://github.com/ItsDrike/itsdrike.com.git
				synced 2025-11-04 04:06:36 +00:00 
			
		
		
		
	Add shortcode for mermaid diagrams
This commit is contained in:
		
							parent
							
								
									2eec248847
								
							
						
					
					
						commit
						d3f9af4560
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								layouts/shortcodes/mermaid.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								layouts/shortcodes/mermaid.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
{{ $mermaidData := dict "theme" "default" }}
 | 
			
		||||
{{ $data := dict "code" .Inner "mermaid" $mermaidData }}
 | 
			
		||||
 | 
			
		||||
<figure class="mermaid">
 | 
			
		||||
    <img src="https://mermaid.ink/img/{{ $data | jsonify | base64Encode }}" referrerpolicy="no-referrer">
 | 
			
		||||
    <figcaption class="text-center">
 | 
			
		||||
        <small>{{ .Get "caption" }}</small>
 | 
			
		||||
    </figcaption>
 | 
			
		||||
</figure>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue