<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ethan Hawksley</title>
    <description>The latest articles on DEV Community by Ethan Hawksley (@ethanhawksley).</description>
    <link>https://dev.to/ethanhawksley</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3654330%2F0c87d677-f886-41ab-b295-b38ae03cb480.png</url>
      <title>DEV Community: Ethan Hawksley</title>
      <link>https://dev.to/ethanhawksley</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethanhawksley"/>
    <language>en</language>
    <item>
      <title>Building An Astro Blog</title>
      <dc:creator>Ethan Hawksley</dc:creator>
      <pubDate>Thu, 11 Jun 2026 18:39:35 +0000</pubDate>
      <link>https://dev.to/ethanhawksley/building-an-astro-blog-1a95</link>
      <guid>https://dev.to/ethanhawksley/building-an-astro-blog-1a95</guid>
      <description>&lt;p&gt;This article was originally published on &lt;a href="https://hawksley.dev/blog/building-astro-blog/" rel="noopener noreferrer"&gt;hawksley.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I've owned the domain name hawksley.dev for a while now, but I've never done much with it aside from sending email. Over the weekend, I thought I might as well make good use of it and decided to create a blog.&lt;/p&gt;

&lt;p&gt;In the beginning, this site had a humble home page with some links to GitHub projects. A blog requires much more infrastructure for me to use it effectively. For one, it'd be great if I could just write my posts in Markdown and have them formatted by my project automatically. Having a look at the options available, the first that stood out was &lt;a href="https://jekyllrb.com/" rel="noopener noreferrer"&gt;GitHub's Jekyll&lt;/a&gt;. It looked nice and had great integration with GitHub Pages, which I'm hosting with at the time of writing. However, it just felt too rigid. I needed something modern that I felt I could get my hands dirty with.&lt;/p&gt;

&lt;p&gt;Enter Astro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Astro
&lt;/h2&gt;

&lt;p&gt;In the grand scheme of things, &lt;a href="https://astro.build/" rel="noopener noreferrer"&gt;the Astro framework&lt;/a&gt; is pretty new at just 5 years old. That hasn't prevented it from gaining popularity rapidly. It holds performance as a key design principle, anything that can be static will render statically. By default, it ships absolutely no JS to the browser, which felt perfect for my use case. I have no need for advertising or heavy tracking scripts weighing down my site. All I need is a place to write.&lt;/p&gt;

&lt;p&gt;Learning how to work with Astro was completely painless. I created a new GitHub repository and followed along with their very high-quality documentation to create a blog of my own. At the very end of it, I’d created a nice neat blog that loaded instantly and was easy to write for.&lt;/p&gt;

&lt;p&gt;I wasn't satisfied by using the tutorial's blog for my site, though, as it felt too cookie-cutter, and so I started again, now with confidence in the framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Design Decisions
&lt;/h2&gt;

&lt;p&gt;There were some definite design decisions I knew I wanted from the get-go. First-class light mode and dark mode support were a must. Plenty of blogs offered just one or the other, and after a bit of digging, it didn't seem technically hard to implement at all.&lt;/p&gt;

&lt;p&gt;Another key principle was mobile-first design. Many of my previous projects started with the key assumption that the reader will be on a laptop or desktop, but that often isn't the case. Mobile devices account for approximately two-thirds of global internet traffic, with the remaining third coming from desktops. I wanted this site to stand the test of time until I inevitably rebuild it again, so it's only natural I designed it with mobile devices in mind.&lt;/p&gt;

&lt;p&gt;My final decision I knew I wanted was to have excellent performance scores, one of the very reasons that I chose Astro for the job. Components are almost a certainty in modern web design to ensure consistency across pages, but I needed to write components used at compile time, rather than at run time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Actually Programming the Site
&lt;/h2&gt;

&lt;p&gt;After creating an experimental fork of my main repository and wiping the directory, I initialised a new blank Astro project with &lt;code&gt;pnpm create astro@latest&lt;/code&gt; and scaffolded the directory structure I'd need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public // Assets such as robots.txt and favicons.
src
  assets // Any assets displayed in the actual site.
  components // Reusable components representing sections of UI.
  content // Markdown files representing the blog.
  layouts // The base layout each page uses.
  pages // The actual pages rendered, combining all parts together.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Development went very smoothly over two days and 15 full hours, with only some minor hiccups along the way.&lt;/p&gt;

&lt;p&gt;Google's PageSpeed Insights flagged my planned accent colour International Orange &lt;code&gt;#FF4F00&lt;/code&gt; as having insufficient contrast in light mode, so I had to split into separate accents for light and dark mode. By using global CSS variables that change depending on the theme, I implemented this change painlessly.&lt;/p&gt;

&lt;p&gt;I also encountered some CLS issues surrounding my choice of font. I personally love the look of the &lt;a href="https://rsms.me/inter/" rel="noopener noreferrer"&gt;Inter font&lt;/a&gt; and included it in my project&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. However, although 300&amp;nbsp;KiB may not sound like a lot, on a slow connection it’s a noticeable delay. After some research I discovered the &lt;a href="https://github.com/fonttools/fonttools" rel="noopener noreferrer"&gt;fontTools library&lt;/a&gt; and managed to shrink the Inter font to 70&amp;nbsp;KiB by subsetting the font to only the character sets I need.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Conclusion
&lt;/h2&gt;

&lt;p&gt;Astro has been a pleasure to work with, and I can easily see myself using it in future projects now I've adjusted to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztryiypec0hqw9jeex91.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztryiypec0hqw9jeex91.webp" alt="Perfect hawksley.dev Google PageSpeed score"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A perfect score has got to be one of the most satisfying feelings after doing a site redesign.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;I'm now using IBM Plex Sans and IBM Plex Mono, but they are subsetted to 62KiB and 9KiB respectively, so the advice still holds.&amp;nbsp;↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>astro</category>
      <category>webdev</category>
      <category>programming</category>
      <category>portfolio</category>
    </item>
  </channel>
</rss>
