mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
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.
This commit is contained in:
committed by
Anthony Fok
parent
d48781badf
commit
6812229bb8
7
docs/layouts/shortcodes/gh.html
Normal file
7
docs/layouts/shortcodes/gh.html
Normal file
@@ -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 }}
|
Reference in New Issue
Block a user