Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/blankoworld/hugo_theme_adam_eve.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier DOSSMANN <olivier+git@dossmann.net>2017-06-28 19:06:14 +0300
committerOlivier DOSSMANN <olivier+git@dossmann.net>2017-06-29 10:26:37 +0300
commitbe098bb56bac58aa1b5a0676609ea84881e5895c (patch)
tree287eb2ed0f1e80dc55af17b681f06a6c9e688490
parent5c5bd51534ed32f5b27071d6ab550ee89e6d646b (diff)
Remote shortcode: you can now use 1, 2 or 3 parameters on it
-rw-r--r--README.md10
-rw-r--r--TODO5
-rw-r--r--layouts/shortcodes/remote.html8
3 files changed, 19 insertions, 4 deletions
diff --git a/README.md b/README.md
index e4d0fea..c368c1f 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/TODO b/TODO
index 23a6882..5426d9d 100644
--- a/TODO
+++ b/TODO
@@ -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 }}