diff --git a/website_and_docs/layouts/shortcodes/gh-codeblock.html b/website_and_docs/layouts/shortcodes/gh-codeblock.html index ca3073301620..ff7ce8e2ce88 100644 --- a/website_and_docs/layouts/shortcodes/gh-codeblock.html +++ b/website_and_docs/layouts/shortcodes/gh-codeblock.html @@ -21,6 +21,7 @@ {{ $fullPath := .Get "path" }} {{ $path := index (split $fullPath "#") 0 }} +{{ $hasFragment := in $fullPath "#" }} {{ $apiUrl := printf "%s/%s/%s/contents%s?ref=%s" $apiBaseUrl $org $repo $path $branch }} {{ $webUrl := printf "%s/%s/%s/blob/%s/%s" $webBaseUrl $org $repo $branch $fullPath }} @@ -50,6 +51,13 @@ {{ highlight $codeSnippet $language }} +{{ if $hasFragment }} +
+ Show full example +
{{ highlight $content $language }}
+
+{{ end }} +
@@ -58,6 +66,4 @@
{{ else }} {{ partial "github-content.html" }} -{{ end }} - - +{{ end }} \ No newline at end of file