diff options
author | Cameron Moore <moorereason@gmail.com> | 2015-11-25 09:01:22 -0600 |
---|---|---|
committer | Anthony Fok <foka@debian.org> | 2015-12-02 12:18:04 -0700 |
commit | 6812229bb8c09675b86b26c0338a3dc5cc5498b1 (patch) | |
tree | 8b0d899d2f317428f5f79e696556cd8d15756c95 /docs/layouts/shortcodes | |
parent | d48781badf4bf26bffe116365daf653b5eaa5935 (diff) |
Add gh shortcode to docs site
The `gh` shortcode has two modes: users and issues. For user mode, pass a list
of `@username` arguments. For the issues/PR mode, pass a list of issue or PR
numbers. PRs link to the "issues/" URL since Github redirects to the correct
URL.
Thanks to @ryanclarke for suggesting an improved template.
Diffstat (limited to 'docs/layouts/shortcodes')
-rw-r--r-- | docs/layouts/shortcodes/gh.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/layouts/shortcodes/gh.html b/docs/layouts/shortcodes/gh.html new file mode 100644 index 000000000..78369df58 --- /dev/null +++ b/docs/layouts/shortcodes/gh.html @@ -0,0 +1,7 @@ +{{ range .Params }} +{{ if eq (substr . 0 1) "@" }} +<a href="//github.com/{{ substr . 1 }}">{{ . }}</a> +{{ else }} +<a href="//github.com/spf13/hugo/issues/{{ . }}">{{ . }}</a> +{{ end }} +{{ end }} |