<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Coding and Development — Getting Out There</title><link>https://blog.ryanmoore.au/categories/coding-and-development/</link><description>This blog is dedicated to my adventures in the great outdoors, fishing trips, hiking routes, camping, etc. as well as a collection of thoughts and interests. It's not all outdoorsy: there's plenty of politics, work/coding, football and other random ~~rants~~ thoughts I have.</description><language>en-au</language><lastBuildDate>Sun, 14 Apr 2024 17:59:06 +1000</lastBuildDate><atom:link href="https://blog.ryanmoore.au/categories/coding-and-development/index.xml" rel="self" type="application/rss+xml"/><item><title>Dont ever use &lt;B> in HTML... err... Wrong!</title><link>https://blog.ryanmoore.au/posts/2024/dont-use-b-in-html-wrong/</link><pubDate>Sun, 14 Apr 2024 17:59:06 +1000</pubDate><guid>https://blog.ryanmoore.au/posts/2024/dont-use-b-in-html-wrong/</guid><description>&lt;p class="lead">If you&amp;rsquo;ve ever &lt;b class='brand'>Google&amp;rsquo;d&lt;/b> the humble HTML &lt;code>&amp;lt;b&amp;gt;&lt;/code> tag, and read more than three of the results returned, you&amp;rsquo;ll have inevitably come across the hordes of self-righteous knobs on &lt;b class='brand'>StackExchange&lt;/b> berating people (especially those new to HTML/CSS) for using the tag. Their reason? It&amp;rsquo;s semantically-invalid HTML. &lt;strong>They. Are. Wrong!&lt;/strong>&lt;/p>
&lt;p>The key to the &lt;code>&amp;lt;b&amp;gt;&lt;/code> tag, or even the &lt;code>&amp;lt;i&amp;gt;&lt;/code> for that matter (but that&amp;rsquo;s a different post for another day) is that the &lt;em>usage&lt;/em> is different than what you might expect&amp;hellip;&lt;/p>
&lt;blockquote cite="mdn web docs">&lt;dl>
&lt;dt>&lt;code>b&lt;/code> is the &lt;del>Boldface&lt;/del> &lt;q>Bring Attention To&lt;/q> element&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/dt>
&lt;dd>The &lt;code>&amp;lt;b&amp;gt;&lt;/code> HTML element is used to draw the reader&amp;rsquo;s attention to the element&amp;rsquo;s contents, which are not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface. However, you should not use &lt;code>&amp;lt;b&amp;gt;&lt;/code> for styling text or granting importance. If you wish to create boldface text, you should use the CSS font-weight property. If you wish to indicate an element is of special importance, you should use the &lt;code>&amp;lt;strong&amp;gt;&lt;/code> element.&lt;/dd>
&lt;/dl>
&lt;/blockquote>
&lt;p>That does &lt;em>not&lt;/em> necessitate being &lt;strong>bold&lt;/strong>. &lt;em>That&lt;/em> is a design decision separate to the semantic one. In days of yore, &lt;code>b&lt;/code> meant &lt;q>Boldface&lt;/q>. This is where the angst arises, because it is automatically assumed that you&amp;rsquo;re using &lt;code>&amp;lt;b&amp;gt;&lt;/code> because you&amp;rsquo;re ignorant of &lt;code>&amp;lt;strong&amp;gt;&lt;/code>.&lt;/p>
&lt;p>I use this tag liberally across my site to mark up any text where I use a brand name, e.g. &lt;code>&amp;lt;b class=&amp;quot;brand&amp;quot;&amp;gt;Google&amp;lt;/b&amp;gt;&lt;/code> signifies that &lt;b class="brand">Google&lt;/b> is a brand name, and then I &lt;em>do&lt;/em> style it subtly differently (I switch out the serif font for the sans-serif and italicise) but &lt;strong>importantly&lt;/strong>: that does &lt;em>not&lt;/em> mean I am using it for that function. All I am doing by adding it to my HTML is saying that this text &lt;em>may&lt;/em> need to be marked up as standing somewhat different to its surrounding context. What I do in the stylesheet afterwards is &lt;em>not&lt;/em> a determinant of its validity as HTML markup.&lt;/p>
&lt;p>My stylesheet declaring that&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-css" data-lang="css">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">b&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nc">brand&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">font-family&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">sans-serif&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">font-style&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">italic&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>is purely decorative and has no semantic meaning to the original markup. I might decide one day to not treat brand names any different from the surrounding text, and if I was to remove that stylesheet, my markup would remain perfectly valid. Or I could just remove the &lt;code>font-style: italic&lt;/code> style:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-css" data-lang="css">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">b&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nc">brand&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">font-family&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">sans-serif&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="k">font-style&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">italic&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Some browsers still render &lt;code>&amp;lt;b&amp;gt;&lt;/code> as bold, &lt;code>&amp;lt;i&amp;gt;&lt;/code> as italicised, but that&amp;rsquo;s easily solved with a reset style in the root of your stylesheet, and it&amp;rsquo;s the browser&amp;rsquo;s fault and problem, not yours.&lt;/p>
&lt;p>So the next time you get berated (or find yourself about to do the berat&lt;em>ing&lt;/em>) take a moment to first discern the &lt;em>reason&lt;/em> that page is marked up the way it is. Maybe drawing &lt;em>some&lt;/em> attention to that element is correct, and you&amp;rsquo;re merely arguing about the stylistic choices of your fellows.&lt;/p>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>Definition from &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b">mdn web docs&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div>
&lt;hr>&lt;p>&lt;strong>Rant:&lt;/strong>&lt;/p>&lt;p>Why the rant? I use &amp;lt;b&amp;gt; all over the site and some goose had at me about it.&lt;/p></description></item><item><title>Transitioning from Wordpress to Hugo</title><link>https://blog.ryanmoore.au/posts/2023/transitioning-from-wordpress-to-hugo/</link><pubDate>Tue, 14 Nov 2023 09:52:00 +1100</pubDate><guid>https://blog.ryanmoore.au/posts/2023/transitioning-from-wordpress-to-hugo/</guid><description>&lt;p>&lt;img src="https://blog.ryanmoore.au/posts/2023/transitioning-from-wordpress-to-hugo/wordpress_hugo_matrix_featured_image_hu6cc20f9c22c514155d613e4409d305e7_348574_1200x0_resize_q75_h2_box.webp" width="1200" height="1200" alt="Transitioning from Wordpress to Hugo">&lt;/p>&lt;p class="lead">I have, for the past few years, &lt;a href="https://ryanmoore.bio">run a little personal blog on &lt;b class="brand">Wordpress&lt;/b> called &amp;ldquo;Getting Out There&amp;rdquo;&lt;/a>. Over the years I&amp;rsquo;ve hosted it at different hosts and domains, and added to it much the same as one might build extra rooms to a renovated house. I&amp;rsquo;ve run a little &lt;b>WooCommerce&lt;/b>, added &lt;b class="brand">GravityForms&lt;/b> and custom post types and photos and before you know it, the bloat is very, very real. With that bloat comes more hosting costs, which for a little personal blog that I am certain nobody reads, is unsustainable.&lt;/p>
&lt;p>&lt;strong>Here&amp;rsquo;s the catch: I love Wordpress.&lt;/strong> I&amp;rsquo;ve developed &lt;b class='brand'>Wordpress&lt;/b> themes from scratch, have built, maintained and then long-forgotten plugins, and have adored how close I was able to blend my loves of back- and front-end web design and development. Some years ago I moved from my own custom theme to one called &lt;a href="https://impreza.us-themes.com/">&lt;b class='brand'>Impreza, by US Themes&lt;/b>&lt;/a>. If you need a professional, &lt;em>highly capable and customisable&lt;/em> Wordpress theme that just does everything you could possibly need, then &lt;b class='brand'>Impreza&lt;/b> is for you. I have held dozens of licenses for this theme. Adore.&lt;/p>
&lt;p>So whilst I recognised the dire need to &lt;span class="sidenote">&lt;q>Marie Kondo&lt;/q> my blog &lt;small>[I actually really detest the commercial drive behind the craze that is &lt;del>&lt;b class='brand'>KonMari&lt;/b>&lt;/del> ruthlessly throwing things away, just to buy some Scandinavian shit to replace it and make your home look like the ones on Instagram. Maybe another blog post for another day… In the meantime, I&amp;rsquo;m referring to: &lt;a href="https://konmari.com/">https://konmari.com/&lt;/a>]&lt;/small>&lt;/span>, I still wanted to keep &lt;em>some&lt;/em> flash. Additionally, or perhaps most critically, I love the front- and back-end maintenance of my blog as a pleasure in and of itself: whilst in one way I love that you&amp;rsquo;re reading this — &lt;em>thank you for honouring me with your presence, Esteemed Guest&lt;/em> &amp;#x1f64f; &amp;#x1f647;&amp;zwj;&amp;#x2642;&amp;#xfe0f; — I truly do not care if anybody reads my blog at all. I like having somewhere to drop my thoughts, collect my adventures, post some photos, and &lt;em>&lt;strong>provide a web geek&amp;rsquo;s playground&lt;/strong>&lt;/em>.&lt;/p>
&lt;p>So I started to look at a static site generator (&lt;abbr title="static site generator">SSG&lt;/abbr>). If you don&amp;rsquo;t know what a &lt;span class="sidenote">SSG &lt;small>[SSG: static site generator]&lt;/small>&lt;/span> is, I have two suppositions to make:&lt;/p>
&lt;ol>
&lt;li>You should &lt;a href="https://letmegooglethat.com/?q=static+site+generator">go &lt;b class="brand">Google&lt;/b> that&lt;/a>.&lt;/li>
&lt;li>You may not actually be that interested in this post. You&amp;rsquo;ve been warned. 😆&lt;/li>
&lt;/ol>
&lt;p>I have yet to delve professionally into static site &amp;ldquo;&lt;span class="sidenote">JAM &lt;small>[JAM: Javascript, API and markup]&lt;/small>&lt;/span>stacks&amp;rdquo;, the tech I use at work utilises them but I&amp;rsquo;ve never configured or set it up myself. I decided to have a crack at &lt;b class='brand'>Hugo&lt;/b> after reading a few subreddits and declaring myself familiar with what &lt;b class='brand'>Hugo&lt;/b> has to offer. I also took a look at a few different frameworks for the &lt;span class="sidenote">CSS &lt;small>[CSS: cascading style sheets]&lt;/small>&lt;/span>, as I decided at the outset not to use a theme. I&amp;rsquo;m doin&amp;rsquo; this meself.&lt;/p>
&lt;p>The key criteria I have for the technologies I&amp;rsquo;ve considered are:&lt;/p>
&lt;ol>
&lt;li>It must be open source.&lt;/li>
&lt;li>No cookies or invasions of my readers&amp;rsquo; privacy. You&amp;rsquo;re welcome.&lt;/li>
&lt;li>No over-reliance on one particular platform.
&lt;ul>
&lt;li>
&lt;p>For example, I do not want to maintain huge &lt;code>package.json&lt;/code> files due to every framework&amp;rsquo;s answer being:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-console" data-lang="console">&lt;span class="line">&lt;span class="cl">&lt;span class="go">npm install this-small-two-lines-of-code-plugin
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/li>
&lt;li>
&lt;p>No, I won&amp;rsquo;t just &lt;code>npm&lt;/code> it. First tell me: &amp;ldquo;Why?!&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Of course, building something &amp;ldquo;on &lt;b class='brand'>Hugo&lt;/b> and &lt;b class='brand'>TailwindCSS&lt;/b>&amp;rdquo; means the platform is a key integrated component, but I want to be able to move &lt;em>my content&lt;/em> elsewhere when I inevitably bore of &lt;b class='brand'>Hugo&lt;/b> and move to the next thing. I am a fickle bastard.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>That said above, no &lt;em>stupid abstractions&lt;/em> or &lt;a href="https://gordonc.bearblog.dev/dry-most-over-rated-programming-principle/">religious adherence to &lt;span class="sidenote">DRY &lt;small>[DRY: don&amp;#39;t repeat yourself]&lt;/small>&lt;/span> principles&lt;/a>.
&lt;ul>
&lt;li>Some things in my site are hard-coded and definitely &lt;em>not&lt;/em> content-agnostic. Why? It&amp;rsquo;s easier. I can always re-do the copyright notice in the next site I build.&lt;/li>
&lt;li>The answer to every question is not always a huge &lt;span class="sidenote">YAML &lt;small>[YAML: Yet Another Markup Language]&lt;/small>&lt;/span> file and another layer of the stack.&lt;/li>
&lt;li>&lt;abbr title="don&amp;#39;t repeat yourself">DRY&lt;/abbr> has kept food on many a developer&amp;rsquo;s table, much as lawyers adore complainants fighting a case on &amp;ldquo;the principle of the thing&amp;rdquo;.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;p>In the end, I decided upon the following:&lt;/p>
&lt;ul>
&lt;li>&lt;b class='brand'>Hugo&lt;/b> to generate the site.&lt;/li>
&lt;li>&lt;b class='brand'>TailwindCSS&lt;/b> to generate the &lt;abbr title="cascading style sheets">CSS&lt;/abbr>.&lt;/li>
&lt;li>&lt;b class='brand'>Gulp&lt;/b> to handle the Javascript, &lt;span class="sidenote">SVG &lt;small>[SVG: Scalable Vector Graphics]&lt;/small>&lt;/span> and any &lt;span class="sidenote">SCSS &lt;small>[SCSS: SASSy cascading style sheets]&lt;/small>&lt;/span> that &lt;em>isn&amp;rsquo;t&lt;/em> &lt;b class='brand'>Tailwind&lt;/b>.&lt;/li>
&lt;li>Git for version control.
&lt;ul>
&lt;li>One main repository for the site code and logic.&lt;/li>
&lt;li>Another repository as a git submodule for the content.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;del>Gitea for hosting my git repository.&lt;/del> Self-hosting my git repository on an instance of &lt;b class='brand'>Charm&amp;rsquo;s&lt;/b> Soft Serve.&lt;/li>
&lt;li>&lt;del>DroneCI for building &amp;ldquo;production Hugo&amp;rdquo;.&lt;/del> I built a little &lt;b class="brand">Raspberry Pi&lt;/b>-powered single board computer to build my &lt;b class='brand'>Hugo&lt;/b> site when not at my desk (i.e. on the bike, at work, travelling, etc&amp;hellip;).&lt;/li>
&lt;li>A &lt;b class='brand'>DigitalOcean&lt;/b> droplet for hosting the files. I&amp;rsquo;m aware I can use cheaper &lt;b class='brand'>GitHub Pages&lt;/b> et al. but I both don&amp;rsquo;t mind paying for the occasional bit of hosting and importantly: I may want to add some dynamic elements (such as &lt;span class="sidenote">PHP &lt;small>[PHP: PHP: Hypertext Preprocessor]&lt;/small>&lt;/span> forms, et cetera) at a later date. No stupid abstractions, remember?&lt;/li>
&lt;/ul></description></item></channel></rss>