diff options
author | jesselau76 <jesselau76@gmail.com> | 2018-11-25 01:14:26 +0300 |
---|---|---|
committer | jesselau76 <jesselau76@gmail.com> | 2018-11-25 01:14:26 +0300 |
commit | 33571417294865110648ffefc78f533a8be6d65e (patch) | |
tree | f305a394e2507650e02ec9e1f5fa4ae3afa8e4b3 | |
parent | a1f33120114b756d3689e9db870cb66fcddc2f27 (diff) |
quote shortcodes:
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/content/posts/shortcodes-demopage.md | 51 | ||||
-rw-r--r-- | layouts/shortcodes/htmlcode.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/quote.html | 4 |
4 files changed, 56 insertions, 3 deletions
@@ -22,7 +22,7 @@ - Disqus - One Signal Push - Social share & Bookmark bar - - Shortcodes:Info, Warning, Colorcode. [Demo Here](https://jesselau.com/w3-simple-shortcodes-demo/) + - Shortcodes:Info, Warning, Colorcode, quote. [Demo Here](https://jesselau.com/w3-simple-shortcodes-demo/) - Sphinx or Manticore search supported. Output xml file which can be indexed by sphinx and manticore search. Example site can not include search function because it need server-side setting. [Live Search function Demo Here](https://jesselau.com/search/) - Table of content and back to top button on scroll. - Grid style and simple list style. diff --git a/exampleSite/content/posts/shortcodes-demopage.md b/exampleSite/content/posts/shortcodes-demopage.md index e76d724..a497a60 100644 --- a/exampleSite/content/posts/shortcodes-demopage.md +++ b/exampleSite/content/posts/shortcodes-demopage.md @@ -188,7 +188,58 @@ y = json.loads(x)<br> # the result is a Python dictionary:<br> print(y["age"]) <br> {{< /colorcode >}} +<hr> +## quote shortcode + +We can display quotes with shortcodes + +{{< colorcode title="Code for quote shortcodes">}} +{{< quote >}}<br> +<p class=" w3-xlarge"><br> + Make it as simple as possible, but not simpler.<br> +</p><br> +<p class="w3-right">--- Albert Einstein</p><br> +{{< /quote >}} +{{< /colorcode >}} +It will display quote with default width 100% style: +{{< quote >}} +<p class=" w3-xlarge"> + Make it as simple as possible, but not simpler. +</p><p class="w3-right">--- Albert Einstein</p> +{{< /quote >}} + +You can also set width with shortcodes: + {{< colorcode title="Code for quote shortcodes with % width">}} +{{< quote width="38.2%" >}}<br> +<p class=" w3-xlarge"><br> + Make it as simple as possible, but not simpler.<br> +</p><br> +<p class="w3-right">--- Albert Einstein</p><br> +{{< /quote >}} +{{< /colorcode >}} +{{< quote width="38.2%" >}} +<p class=" w3-xlarge"> + Make it as simple as possible, but not simpler. +</p><p class="w3-right">--- Albert Einstein</p> +{{< /quote >}} + +Or you can set px to width + +{{< colorcode title="Code for quote shortcodes with px width">}} +{{< quote width="300px" >}}<br> +<p class=" w3-xlarge"><br> + Make it as simple as possible, but not simpler.<br> +</p><br> +<p class="w3-right">--- Albert Einstein</p><br> +{{< /quote >}} +{{< /colorcode >}} + +{{< quote width="300px" >}} +<p class=" w3-xlarge"> + Make it as simple as possible, but not simpler. +</p><p class="w3-right">--- Albert Einstein</p> +{{< /quote >}} ## Test first picture without thumbnail set ![Thanks to Unsplash](https://raw.githubusercontent.com/jesselau76/hugo-w3-simple/master/exampleSite/images/thumb-jad-limcaco-183877-unsplash.jpg)
\ No newline at end of file diff --git a/layouts/shortcodes/htmlcode.html b/layouts/shortcodes/htmlcode.html deleted file mode 100644 index fb8cb85..0000000 --- a/layouts/shortcodes/htmlcode.html +++ /dev/null @@ -1,2 +0,0 @@ - {{ .Inner | safeHTML }} -
\ No newline at end of file diff --git a/layouts/shortcodes/quote.html b/layouts/shortcodes/quote.html new file mode 100644 index 0000000..62892db --- /dev/null +++ b/layouts/shortcodes/quote.html @@ -0,0 +1,4 @@ +<div class="w3-panel w3-card-4 w3-light-grey"{{ with .Get "width"}} style="width:{{.}}"{{ end }}> + <i class="fa fa-quote-right w3-xxlarge w3-text-red"></i><br> + {{ .Inner | safeHTML }} + </div>
\ No newline at end of file |