mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Allow picking a specific file out of a gist
This commit is contained in:
		
				
					committed by
					
						
						Bjørn Erik Pedersen
					
				
			
			
				
	
			
			
			
						parent
						
							7cd69aaae8
						
					
				
				
					commit
					e9008b91fa
				
			@@ -211,6 +211,10 @@ pass the owner and the ID of the gist to the shortcode:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    {{</* gist spf13 7896402 */>}}
 | 
					    {{</* gist spf13 7896402 */>}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If the gist contains several files and you want to quote just one of them, you can pass the filename (quoted) as an optional third argument:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {{</* gist spf13 7896402 "img.html" */>}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Speaker Deck
 | 
					### Speaker Deck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To embed slides from [Speaker Deck](https://speakerdeck.com/), click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL, e.g.:
 | 
					To embed slides from [Speaker Deck](https://speakerdeck.com/), click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL, e.g.:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ func (t *GoHTMLTemplate) EmbedShortcodes() {
 | 
				
			|||||||
  <iframe src="//player.vimeo.com/video/{{ .Get 0 }}" {{ if len .Params | eq 1 }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" {{ end }}webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
 | 
					  <iframe src="//player.vimeo.com/video/{{ .Get 0 }}" {{ if len .Params | eq 1 }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" {{ end }}webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
 | 
				
			||||||
 </div>
 | 
					 </div>
 | 
				
			||||||
{{ end }}`)
 | 
					{{ end }}`)
 | 
				
			||||||
	t.AddInternalShortcode("gist.html", `<script src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js"></script>`)
 | 
						t.AddInternalShortcode("gist.html", `<script src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>`)
 | 
				
			||||||
	t.AddInternalShortcode("tweet.html", `{{ (getJSON "https://api.twitter.com/1/statuses/oembed.json?id=" (index .Params 0)).html | safeHTML }}`)
 | 
						t.AddInternalShortcode("tweet.html", `{{ (getJSON "https://api.twitter.com/1/statuses/oembed.json?id=" (index .Params 0)).html | safeHTML }}`)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user