diff options
author | Olivier DOSSMANN <olivier+git@dossmann.net> | 2017-06-28 19:06:14 +0300 |
---|---|---|
committer | Olivier DOSSMANN <olivier+git@dossmann.net> | 2017-06-29 10:26:37 +0300 |
commit | be098bb56bac58aa1b5a0676609ea84881e5895c (patch) | |
tree | 287eb2ed0f1e80dc55af17b681f06a6c9e688490 | |
parent | 5c5bd51534ed32f5b27071d6ab550ee89e6d646b (diff) |
Remote shortcode: you can now use 1, 2 or 3 parameters on it
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | layouts/shortcodes/remote.html | 8 |
3 files changed, 19 insertions, 4 deletions
@@ -58,12 +58,20 @@ Example: {{< remote "Wiki" "http://fr.wikipedia.org/wiki/Wiki" >}} ``` -**Optional**: This shortcode accepts a third parameter to define link title. Example: +With remote shortcode, you have many other possibilities by playing with parameters: ``` {{< remote "Panda" "https://best.panda.domain.tld" "What a panda looks like" >}} ``` +which add a **title** to your link (when user keep cursor on it). + +``` +{{< remote "http://perdu.com/" >}} +``` + +which display the link at it is. But with the globe before ;) + ## internal This shortcode will use `relref` Hugo command to create a relative link to the given page. @@ -1,6 +1,7 @@ # TODO list - * improve remote shortcode to use param 1 as title (if only 1 param given) * relref doesn't work into a note shortcode: check what's possible to do * create a picture of what looks like EACH shortcode and add them into README - * add a picture to show a wiki website with Adam & Eve theme + * add a picture to show a wiki website with Adam & Eve theme: + * show homepage with some links + * show in this homepage blockquote and code diff --git a/layouts/shortcodes/remote.html b/layouts/shortcodes/remote.html index 7c21260..f4661e7 100644 --- a/layouts/shortcodes/remote.html +++ b/layouts/shortcodes/remote.html @@ -1 +1,7 @@ -<a class="remote" href="{{ .Get 1 }}"{{ if len .Params | eq 3 }}title="{{ .Get 2 }}"{{ end }}>{{ .Get 0 }}</a> +{{ if len .Params | eq 2 }} +<a class="remote" href="{{ .Get 1 }}">{{ .Get 0 }}</a> +{{ else if len .Params | eq 3 }} + <a class="remote" href="{{ .Get 1 }}" title="{{ .Get 2 }}">{{ .Get 0 }}</a> +{{ else }} + <a class="remote" href="{{ .Get 0 }}">{{ .Get 0 }}</a> +{{ end }} |