mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 20:15:49 +00:00
Cleanup shortcode calls
This commit is contained in:
1 parent
c9247e98d6
commit
903b42ebc9
75 files changed
+196
-196
No files matched your search
@@ -13,7 +13,7 @@ By example, let's use [MathJax] to render a LaTeX mathematical expression:
|
||||
|
||||
[MathJax]: https://www.mathjax.org/
|
||||
|
||||
{{< code file="contents/physics/lesson-1.md" lang=markdown >}}
|
||||
{{< code file=contents/physics/lesson-1.md lang=markdown >}}
|
||||
Albert Einstein’s theory of special relativity expresses
|
||||
the fact that mass and energy are the same physical entity
|
||||
and can be changed into each other.
|
||||
@@ -31,14 +31,14 @@ the kinetic energy (E) of that body.
|
||||
|
||||
The shortcode is simple:
|
||||
|
||||
{{< code file="layouts/shortcodes/math.html" lang=go-html-template >}}
|
||||
{{< code file=layouts/shortcodes/math.html lang=go-html-template >}}
|
||||
{{ trim .Inner "\r\n" }}
|
||||
{{< /code >}}
|
||||
|
||||
Now we can selectively load the required CSS and JavaScript on pages that call the "math" shortcode:
|
||||
|
||||
|
||||
{{< code file="layouts/baseof.html" lang=go-html-template >}}
|
||||
{{< code file=layouts/baseof.html lang=go-html-template >}}
|
||||
<head>
|
||||
...
|
||||
{{ if .HasShortcode "math" }}
|
||||
|
||||
Reference in new issue
Block a user