From 143576bc9924a85d8d7c96e734d813b43f31b4a2 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 7 Oct 2017 20:26:21 +0100 Subject: [PATCH] staticref shortcode: Add `"newtab"` option to open link in new tab --- exampleSite/content/post/writing-markdown-latex.md | 4 +++- layouts/shortcodes/staticref.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/post/writing-markdown-latex.md b/exampleSite/content/post/writing-markdown-latex.md index 8d9cf46a..35662849 100644 --- a/exampleSite/content/post/writing-markdown-latex.md +++ b/exampleSite/content/post/writing-markdown-latex.md @@ -60,7 +60,9 @@ A numbered figure with caption: To enable linking to a file, such as a PDF, first place the file in your `static/files/` folder and then link to it using the following form: - {{%/* staticref "files/cv.pdf" */%}}Download my CV{{%/* /staticref */%}} + {{%/* staticref "files/cv.pdf" "newtab" */%}}Download my CV{{%/* /staticref */%}} + +The optional `"newtab"` argument for `staticref` will cause the link to be opened in a new tab. ## Emojis diff --git a/layouts/shortcodes/staticref.html b/layouts/shortcodes/staticref.html index 2a6eabb9..acd22d50 100644 --- a/layouts/shortcodes/staticref.html +++ b/layouts/shortcodes/staticref.html @@ -1 +1,3 @@ -{{ .Inner }} + + {{ .Inner }} +