<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Graphics on MIZE</title><link>https://mizerc.github.io/categories/graphics/</link><description>Recent content in Graphics on MIZE</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://mizerc.github.io/categories/graphics/index.xml" rel="self" type="application/rss+xml"/><item><title>Hugo: Adding Support to HTML Canvas</title><link>https://mizerc.github.io/posts/004-hugo-canvas-support/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://mizerc.github.io/posts/004-hugo-canvas-support/</guid><description>&lt;script type="importmap"&gt;
{
"imports": {
"three": "https://unpkg.com/three@0.160.0/build/three.module.js"
}
}
&lt;/script&gt;
&lt;p&gt;This post walks through how to add an HTML Canvas to a Hugo site, with additional guidance on including external JavaScript libraries from a CDN, such as Three.js to render the cube shown below:&lt;/p&gt;
&lt;!-- If you need to add HTML canvas or import JavaScript libraries from a CDN in your Hugo website, this post will walk you thru on how to do that.
In the end you will be able to use HTML canvas to render things like a 3d rotating cube from your markdown file: --&gt;
&lt;style&gt;
p.canvasjs-label {
text-align: center;
font-family: 'Georgia', serif;
color: #555;
font-size: 0.8rem;
text-align: center;
font-style: italic;
line-height: 1.3;
}
&lt;/style&gt;
&lt;div style="display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 16px;"&gt;
&lt;div style="width: 500px; height: 500px; margin: 8px;" id="div-container-cube1"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;script type="module" src="scripts/cube1.js"&gt;&lt;/script&gt;
&lt;h3 id="hugo-shortcodes"&gt;Hugo Shortcodes&lt;/h3&gt;
&lt;p&gt;Adding support to a new HTML DOM in your Hugo site is possible using Hugo &lt;a href="https://gohugo.io/content-management/shortcodes/"&gt;shortcodes&lt;/a&gt;.
Which is a way to add custom HTML elements to your website like image, video, and HTML canvas.
The shortcode is a HTML template invoked within markup, accepting any number of arguments.&lt;/p&gt;</description></item></channel></rss>