HugoIO Templates
Page content
Custom Template Stuff
mkdir -p layouts/shortcodes
cat << 'EOF' > layouts/shortcodes/date.html
{{ now.Format "2006-01-02 03:04:05" }}
EOF
Insert Code in Template
current date ? { {< date >} }
Result ?
current date ?? 2022-05-25 05:46:45
Add RawHTML
Create Template
cat << 'EOF' > layouts/shortcodes/rawhtml.html
<!-- raw html -->
{{.Inner}}
EOF
Add Code
{ {< rawhtml >} }
<p class="speshal-fancy-custom">
This is <strong>raw HTML</strong>, inside Markdown.
</p>
{ {< /rawhtml >} }
Result ?
This is raw HTML, inside Markdown.
add a Tweet ?
{ {< tweet user="stoege" id="1248501399433822209" >} }
and get the following:
.. heute Nacht am Greifensee ... pic.twitter.com/yMIQOItMdB
— Daniel Stocker (@stoege) April 10, 2020
sha256: 1e4e3a9c5a1167878b75894434f34e55affb40709bc5c39b1e4eb9881921fe87