mirror of
				https://github.com/BBaoVanC/bobatheme.git
				synced 2025-11-03 18:27:55 -06:00 
			
		
		
		
	Add figure shortcode
This commit is contained in:
		@@ -106,6 +106,12 @@ img:not(.noborder), video:not(.noborder) {
 | 
			
		||||
  border: 5px solid #1b5b9b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
figcaption {
 | 
			
		||||
  font-style: italic;
 | 
			
		||||
  font-size: small;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a {
 | 
			
		||||
  color: #4da6ff;
 | 
			
		||||
  text-decoration: inherit;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								layouts/shortcodes/figure.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								layouts/shortcodes/figure.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
<figure>
 | 
			
		||||
 | 
			
		||||
    {{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
 | 
			
		||||
        <img src="{{ .Get "src" }}"
 | 
			
		||||
             {{ if or (.Get "alt") (.Get "caption") }}
 | 
			
		||||
             alt="{{ with .Get "alt" }}
 | 
			
		||||
                  {{ . }}
 | 
			
		||||
                  {{ else }}
 | 
			
		||||
                  {{ .Get "caption" | markdownify }}
 | 
			
		||||
                  {{ end }}"
 | 
			
		||||
             {{ end }}
 | 
			
		||||
 | 
			
		||||
             {{ with .Get "width" }} width="{{ . }}" {{ end }}
 | 
			
		||||
             {{ with .Get "height" }} height="{{ . }}" {{ end }}
 | 
			
		||||
        />
 | 
			
		||||
    {{ if .Get "href" }}</a>{{ end }}
 | 
			
		||||
 | 
			
		||||
    {{ with .Get "caption" }}
 | 
			
		||||
    <figcaption>
 | 
			
		||||
        {{ . | markdownify }}
 | 
			
		||||
    </figcaption>
 | 
			
		||||
    {{ end }}
 | 
			
		||||
 | 
			
		||||
</figure>
 | 
			
		||||
		Reference in New Issue
	
	Block a user