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 ?? 2024-12-20 10:30:09
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 | stöge#1 | (@stoege) April 10, 2020
Any Comments ?
sha256: 3d23d1a38d9802f0bad6902c6448effb4d86423a88eb54af4046f0728d27ed6c