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

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-03-17 16:16:04 +0300
committerGitHub <noreply@github.com>2020-03-17 16:16:04 +0300
commit6b03c711ac8000b5bd09c23f3fea2a005389b230 (patch)
tree2766ad718cac8c7d275acb69725ae593551dfc83 /layouts/shortcodes
parentf9dba2e36caef0c80666e79ce109621fd96ec9e8 (diff)
feat(shortcode): add link shortcode (#179)
* feat(shortcode): add link shortcode * docs: add docs for link shortcode * docs: fix 'mailto' in link shortcode docs error
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/link.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/shortcodes/link.html b/layouts/shortcodes/link.html
new file mode 100644
index 0000000..5208d81
--- /dev/null
+++ b/layouts/shortcodes/link.html
@@ -0,0 +1,13 @@
+{{- $options := dict -}}
+{{- if .IsNamedParams -}}
+ {{- $options = dict "href" (.Get "href") | merge $options -}}
+ {{- $options = dict "title" (.Get "title") | merge $options -}}
+ {{- $options = dict "rel" (.Get "rel") | merge $options -}}
+ {{- $options = dict "class" (.Get "class") | merge $options -}}
+ {{- $options = dict "content" (.Get "content") | merge $options -}}
+{{- else -}}
+ {{- $options = dict "href" (.Get 0) | merge $options -}}
+ {{- $options = dict "content" (.Get 1 | default (.Get 0)) | merge $options -}}
+ {{- $options = dict "title" (.Get 2) | merge $options -}}
+{{- end -}}
+{{- partial "plugin/link.html" $options -}}