<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Rob Wood</title>
  <subtitle>Updates about anything but probably front end development</subtitle>
  <link href="https://robwood.uk/feed.xml" rel="self" />
  <link href="https://robwood.uk/" />
  <updated>2026-01-05T00:00:00Z</updated>
  <id>https://robwood.uk/</id>
  <author>
    <name>Rob Wood</name>
  </author>
  <entry>
    <title>Using cmus for local music</title>
    <link href="https://robwood.uk/blog/cmus/" />
    <updated>2026-01-05T00:00:00Z</updated>
    <id>https://robwood.uk/blog/cmus/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;https://cmus.github.io/&quot;&gt;cmus&lt;/a&gt; is a fast console-based music player for Linux. It looks like this:&lt;/p&gt;
&lt;img src=&quot;https://robwood.uk/images/cmus.png&quot; alt=&quot;cmus screenshot&quot;&gt;
&lt;p&gt;Although I use Spotify I wanted to try this for a load of music files I&#39;ve got stored on a network drive. It&#39;s not pretty or intuitive but it is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;light and fast&lt;/li&gt;
&lt;li&gt;free&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#39;ve a got a lot of MP3s so I thought I&#39;d give it a try. I&#39;m enjoying it at the moment and it feels good to listen to some things that you can&#39;t get on Spotify. It&#39;s not the most intuitive software so I&#39;ve made a guide on the most common things I use it for (based off &lt;a href=&quot;https://linux.die.net/man/7/cmus-tutorial&quot;&gt;this article&lt;/a&gt;):&lt;/p&gt;
&lt;h2&gt;Load cmus&lt;/h2&gt;
&lt;p&gt;Open up a terminal and type &lt;code&gt;cmus&lt;/code&gt;. On first launch, you&#39;ll see a screen like this (or you can access this by pressing &lt;code&gt;1&lt;/code&gt;):&lt;/p&gt;
&lt;pre class=&quot;language-MD&quot;&gt;&lt;code class=&quot;language-MD&quot;&gt;+---------------------------------------------------------------------+
| Artist / Album             Track                            Library |
|                          |                                          |
|                          |                                          |
|                          |                                          |
|                          |                                          |
|                          |                                          |
|                          |                                          |
|                          |                                          |
|---------------------------------------------------------------------|
| . 00:00 - 00:00 vol: 100                     all from library | C   |
+---------------------------------------------------------------------+&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Adding music&lt;/h2&gt;
&lt;p&gt;Press &lt;code&gt;5&lt;/code&gt; to go to the file browser. It should look like this:&lt;/p&gt;
&lt;pre class=&quot;language-MD&quot;&gt;&lt;code class=&quot;language-MD&quot;&gt;+---------------------------------------------------------------------+
| Browser - /home/username                                            |
| ../                                                                 |
| Desktop/                                                            |
| audio-projects/                                                     |
| audio/                                                              |
| bin/                                                                |
| config/                                                             |
|---------------------------------------------------------------------|
| . 00:00 - 00:00 vol: 100                     all from library | C   |
+---------------------------------------------------------------------+&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use the keyboard to navigate to your music folder. Press &lt;code&gt;a&lt;/code&gt; to add folders/files to your library.&lt;/p&gt;
&lt;h2&gt;Playing music&lt;/h2&gt;
&lt;p&gt;Press &lt;code&gt;2&lt;/code&gt; to go to the library view. You should see your added music files here:&lt;/p&gt;
&lt;pre class=&quot;language-MD&quot;&gt;&lt;code class=&quot;language-MD&quot;&gt;+---------------------------------------------------------------------+
| Library ~/.cmus/lib.pl - 31 tracks sorted by artist album discnumbe |
| Flying Lizards         . Money (That&#39;s What I Want)           02:31 |
| Jason Woofenden        . VoR Theme                       2009 01:20 |
| Keali&#39;i Reichel      06. Wanting Memories                1994 04:28 |
| Molly Lewis            . Tom Cruise Crazy                     03:13 |
| NonMemory              . pista1                          2009 03:18 |
| NonMemory            01. pista1                    2009-04-21 04:13 |
| Ray Charles          06. Halleluja I Love Her So              02:33 |
|---------------------------------------------------------------------|
| . 00:00 - 2:16:25 vol: 100                   all from library | C   |
+---------------------------------------------------------------------+&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use the keyboard to navigate to a track and press &lt;code&gt;Enter&lt;/code&gt; to play it. Press &lt;code&gt;c&lt;/code&gt; to pause/resume playback. Press &lt;code&gt;,&lt;/code&gt;/&lt;code&gt;.&lt;/code&gt; to seek by 1 minute. and &lt;code&gt;←&lt;/code&gt;/&lt;code&gt;→&lt;/code&gt; to seek by 10 seconds.&lt;/p&gt;
&lt;h2&gt;Options&lt;/h2&gt;
&lt;p&gt;There are different options on what to do when a track ends. Press &lt;code&gt;m&lt;/code&gt; to scroll through them. There are also 3 toggles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[C]ontinue - Toggle with by pressing &lt;code&gt;Shift&lt;/code&gt;-&lt;code&gt;C&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;[R]epeat - If this and &#39;Continue&#39; are on, when cmus reaches the end of the group of tracks you&#39;re playing it will start again from the beginning. Press &lt;code&gt;r&lt;/code&gt; to toggle this.&lt;/li&gt;
&lt;li&gt;[S]huffle - cmus will choose a random order to play all the tracks in the current group. Press &lt;code&gt;s&lt;/code&gt; to toggle this option.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Playlist&lt;/h2&gt;
&lt;p&gt;To create your own playlist press 3 to get to the playlist view and then type &lt;code&gt;pl-create name-of-your-playlist&lt;/code&gt;. To set this new playlist as the active one, select it and press &lt;code&gt;Space&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To delete a playlist, select it in the list and press &lt;code&gt;Shift&lt;/code&gt;-&lt;code&gt;D&lt;/code&gt;. It will ask for confirmation.&lt;/p&gt;
&lt;p&gt;To rename a playlist, select it in the list and type &lt;code&gt;pl-rename new-playlist-name&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Add songs to this playlist from any view with &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Keyboard shortcuts&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Keybinding&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;←&lt;/code&gt;/&lt;code&gt;→&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seek by 10 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;/&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seek by 1 minute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pause/Resume playback&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Next song&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Previous song&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;i&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Focus currently playing song&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Toggle &#39;follow&#39; mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pl-create &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create new playlist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;y&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add song to playlist&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://cmus.github.io/&quot;&gt;Official cmus documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ditig.com/cmus-cheat-sheet&quot;&gt;cmus cheat sheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ditig.com/cmus&quot;&gt;https://www.ditig.com/cmus&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Neovim shortcuts</title>
    <link href="https://robwood.uk/blog/neovim-shortcuts/" />
    <updated>2025-10-29T00:00:00Z</updated>
    <id>https://robwood.uk/blog/neovim-shortcuts/</id>
    <content type="html">&lt;p&gt;There are &lt;em&gt;loads&lt;/em&gt; of guides and cheat sheets for Vim but they can be a bit overwhelming. I thought I&#39;d create my own non-exhaustive list of the shortcuts that make sense to me. This will grow and evolve as I learn more about NeoVim. I used &lt;a href=&quot;https://devhints.io/vim&quot;&gt;this Vim cheat-sheet&lt;/a&gt; for inspiration.&lt;/p&gt;
&lt;div class=&quot;table-wrapper&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align:left&quot;&gt;Files&lt;/th&gt;
&lt;th style=&quot;text-align:left&quot;&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Open last file&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;&#39;0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Browse old files&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:browse oldfiles&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Close current file (&#39;buffer&#39;)&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:bd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Search for files (using telescope)&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:Telescope find_files&lt;/code&gt; OR &lt;code&gt;Space&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Save&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:w&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Close&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:q&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Save and close&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;:wq&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;table-wrapper&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align:left&quot;&gt;Navigating&lt;/th&gt;
&lt;th style=&quot;text-align:left&quot;&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Arrow keys&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;h&lt;/code&gt; &lt;code&gt;j&lt;/code&gt; &lt;code&gt;k&lt;/code&gt; &lt;code&gt;l&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Previous/next word&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;b&lt;/code&gt; / &lt;code&gt;w&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Previous/next end of word&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;ge&lt;/code&gt; / &lt;code&gt;e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;First line&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;gg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Last line&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;G&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;table-wrapper&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align:left&quot;&gt;Editing&lt;/th&gt;
&lt;th style=&quot;text-align:left&quot;&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Append&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;a&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Append from end of line&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;A&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Insert&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;i&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Replace character&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;r&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Undo&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;u&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Redo&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;&#39;Ctrl&#39; + r&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;table-wrapper&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align:left&quot;&gt;Clipboard&lt;/th&gt;
&lt;th style=&quot;text-align:left&quot;&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Delete line (Cut)&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;dd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Delete character&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;x&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Yank line (Copy)&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;yy&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Paste&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;p&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;table-wrapper&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;text-align:left&quot;&gt;NvimTree&lt;/th&gt;
&lt;th style=&quot;text-align:left&quot;&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Open NvimTree&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;&#39;Space&#39; + e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Reveal current file in NvimTree&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;&#39;Space + er&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Yank line (Copy)&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;yy&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot;&gt;Paste&lt;/td&gt;
&lt;td style=&quot;text-align:left&quot;&gt;&lt;code&gt;p&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Auto-fill vs auto-fit</title>
    <link href="https://robwood.uk/blog/auto-fill-vs-auto-fit/" />
    <updated>2025-09-21T00:00:00Z</updated>
    <id>https://robwood.uk/blog/auto-fill-vs-auto-fit/</id>
    <content type="html">&lt;p&gt;It always takes me a second to remember which way round these are. Up to a point, they seem to work in the same way.&lt;/p&gt;
&lt;p&gt;When using the &lt;code&gt;minmax()&lt;/code&gt; function in a &lt;code&gt;grid&lt;/code&gt; declaration, &lt;code&gt;auto-fit&lt;/code&gt; will expand the grid items to fill the available space. &lt;code&gt;auto-fill&lt;/code&gt; keeps the available space as if there was an grid item there.&lt;/p&gt;
&lt;p&gt;I&#39;ve found &lt;code&gt;auto-fit&lt;/code&gt; to be useful where I&#39;ve had two columns with different content and I want them to be the same width.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;auto-fill&lt;/code&gt; is useful when you want to keep the grid items the same size but you want to fill the available space.&lt;/p&gt;
&lt;p&gt;Here&#39;s the difference:&lt;/p&gt;
&lt;h2&gt;Auto-fit&lt;/h2&gt;
&lt;div class=&quot;auto-fit-example&quot;&gt;
  &lt;div&gt;1&lt;/div&gt;
  &lt;div&gt;2&lt;/div&gt;
  &lt;div&gt;3&lt;/div&gt;
  &lt;div&gt;4&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Auto-fill&lt;/h2&gt;
&lt;div class=&quot;auto-fill-example&quot;&gt;
  &lt;div&gt;1&lt;/div&gt;
  &lt;div&gt;2&lt;/div&gt;
  &lt;div&gt;3&lt;/div&gt;
  &lt;div&gt;4&lt;/div&gt;
&lt;/div&gt;
&lt;style&gt;
  [class^=&quot;auto-&quot;] {
    display: grid;
    grid-template-columns: repeat( var(--auto), minmax(60px, 1fr) );
    gap: 8px;
  }
  .auto-fit-example {
    --auto: auto-fit;
  }

  .auto-fill-example {
    --auto: auto-fill;
  }

  [class^=&quot;auto-&quot;] &gt; * {
    background-color: var(--color-action);
    color: var(--color-background);
    padding: 8px;
  }
&lt;/style&gt;</content>
  </entry>
  <entry>
    <title>Git commands I find useful</title>
    <link href="https://robwood.uk/blog/git-commands-i-find-useful/" />
    <updated>2025-01-06T00:00:00Z</updated>
    <id>https://robwood.uk/blog/git-commands-i-find-useful/</id>
    <content type="html">&lt;p&gt;One day I&#39;ll memorise these but until then, here are some basic Git commands:&lt;/p&gt;
&lt;h2&gt;Push changes to a remote repository&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Stage all changes&lt;/span&gt;
git add --all&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# See staged changes&lt;/span&gt;
git status&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Commit staged changes&lt;/span&gt;
git commit -m &lt;span class=&quot;token string&quot;&gt;&quot;Your comment here&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Push all local commits to the remote branch&lt;/span&gt;
git push&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;General&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Check out an existing local branch:&lt;/span&gt;
git checkout &amp;lt;local-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Compare local changes to the remote in a local branch&lt;/span&gt;
git diff origin/&amp;lt;MAIN-BRANCH-NAME&gt;..HEAD &lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Branches&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Create a new branch from the currently checked out local branch and check it out:&lt;/span&gt;
git checkout -b &amp;lt;new-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Checkout a tagged branch and create a new branch from it.&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# If a branch has been tagged you can see the code at a particular point:&lt;/span&gt;
git checkout tags/&amp;lt;tag-name&gt; -b &amp;lt;new-branch-name&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Merging&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Merge changes from a local branch into a currently checked out branch:&lt;/span&gt;
git merge &amp;lt;existing-local-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Merge changes from a remote branch into a currently checked out branch:&lt;/span&gt;
git merge origin/&amp;lt;remote-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Remote branches&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Switch to a new local branch, and pull changes from a specific remote branch:&lt;/span&gt;
git switch -c &amp;lt;new-local-branch&gt; origin/&amp;lt;remote-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Same as above but without tracking the remote:&lt;/span&gt;
git switch --no-track -c &amp;lt;new-local-branch&gt; origin/&amp;lt;remote-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Get the latest changes from a remote branch:&lt;/span&gt;
git pull origin &amp;lt;remote-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Deleting&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Delete a local branch:&lt;/span&gt;
git branch --delete &amp;lt;local-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Delete a remote branch:&lt;/span&gt;
git push origin --delete &amp;lt;remote-branch&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Reverting changes&lt;/h2&gt;
&lt;pre class=&quot;language-git&quot;&gt;&lt;code class=&quot;language-git&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Get your local branch to match your remote branch.&lt;/span&gt;
git reset --hard origin/&amp;lt;remote-branch&gt; &lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Building a Euros sweepstake website with 11ty</title>
    <link href="https://robwood.uk/blog/building-a-euros-sweepstake-website/" />
    <updated>2024-07-11T00:00:00Z</updated>
    <id>https://robwood.uk/blog/building-a-euros-sweepstake-website/</id>
    <content type="html">&lt;p&gt;We always have a family sweepstake for the Euros and the World Cup so this year I created a website for it: &lt;a href=&quot;https://euros.robwood.uk&quot;&gt;euros.robwood.uk&lt;/a&gt;. This is a brief write-up of what I can remember.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://github.com/robjwood/euro-2024-sweepstake&quot;&gt;source-code is here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;The basics&lt;/h2&gt;
&lt;p&gt;I built this website with 11ty and I used a &lt;a href=&quot;https://github.com/robjwood/rjw-11ty-starter&quot;&gt;simple starter template&lt;/a&gt; I&#39;d created.&lt;/p&gt;
&lt;p&gt;The data fetching happens in a global data.js file. When I previously made a World Cup sweepstake site I split the data files up and imported them. That made sense as a way to manage the data but I decided to chuck it all in one file this time. Who doesn&#39;t love a bit of chaos?&lt;/p&gt;
&lt;h2&gt;The API&lt;/h2&gt;
&lt;p&gt;I used the free &lt;a href=&quot;https://www.football-data.org/&quot;&gt;football-data.org&lt;/a&gt; API to get all the data for this website.&lt;/p&gt;
&lt;p&gt;The main problem I had is that I haven&#39;t been able to read the API using a token on the client without a CORS error.&lt;/p&gt;
&lt;p&gt;This is either something I&#39;m doing wrong or a limit of the free tier. As the documentation shows how make make a request in various programming languages but not JavaScript, I&#39;m assuming it&#39;s the latter.&lt;/p&gt;
&lt;p&gt;To get around it I make the fetch request during the build process, using &lt;a href=&quot;https://www.11ty.dev/docs/plugins/fetch/&quot;&gt;11ty fetch&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As a result, the website would only update when I deployed the site to Netlify. I needed a way to deploy the site daily so the data was at least correct the following day.&lt;/p&gt;
&lt;h2&gt;Deploying the site daily&lt;/h2&gt;
&lt;p&gt;Before I decided how I&#39;d do this I needed to &lt;a href=&quot;https://docs.netlify.com/configure-builds/build-hooks/&quot;&gt;set up a Netlify Build Hook&lt;/a&gt; first.&lt;/p&gt;
&lt;p&gt;I&#39;d previously used the IFTTT service to hook into this Build Hook. Unfortunately, this ability is now part of the &#39;Pro&#39; tier and is no longer free. I had to look for another way so I decided to give &lt;a href=&quot;https://github.com/features/actions&quot;&gt;GitHub Actions&lt;/a&gt; a go.&lt;/p&gt;
&lt;p&gt;I found an article that shows how to &lt;a href=&quot;https://www.visualstudiogeeks.com/github/netlify/trigger-netlify-build-everyday-using-github&quot;&gt;trigger a netlify build every day&lt;/a&gt;. To create the new workflow in my repo I went to the &#39;Actions&#39; tab then the &#39;set up a workflow yourself&#39; link.&lt;/p&gt;
&lt;p&gt;The only things I changed in the example code were the build hook URL and the time the workflow is triggered.&lt;/p&gt;
&lt;p&gt;This did the job!&lt;/p&gt;
&lt;h2&gt;Assigning the family members&lt;/h2&gt;
&lt;p&gt;The API gave me &lt;em&gt;most&lt;/em&gt; of what I needed but I wanted to be able to assign a family member to each team when it came to the fixtures, results and standings.&lt;/p&gt;
&lt;p&gt;I cloned the teams array and created a new property called &#39;family_member&#39;. I then assigned each team to a family member. I also created an &lt;code&gt;assignFamilyMember&lt;/code&gt; function that I could use for the fixture, results and standings.&lt;/p&gt;
&lt;h2&gt;Graphics&lt;/h2&gt;
&lt;p&gt;I wanted it to look like an old 8-bit football game but that didn&#39;t &lt;em&gt;quite&lt;/em&gt; pan out. The most authentic typefaces I could find were also hard to read so I played it safe with &lt;a href=&quot;https://fonts.google.com/specimen/Roboto+Mono&quot;&gt;Roboto Mono&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I created pixel-art style icons for family members and the country flags. I based the family member&#39;s heads on those in the 90s football game &lt;a href=&quot;https://en.wikipedia.org/wiki/Sensible_Soccer&quot;&gt;Sensible Soccer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&#39;d planned on using some flag icons I found online but in the end I decided to recreate my own 8-bit style versions (inaccurate aspect ratios and all).&lt;/p&gt;
&lt;h2&gt;The PWA&lt;/h2&gt;
&lt;p&gt;I don&#39;t have a lot of experience with PWAs so I created the minimum needed for a user to be able to add the app icon to their homescreens.&lt;/p&gt;
&lt;p&gt;There are two things needed for a PWA (in addition to serving the website over https):&lt;/p&gt;
&lt;h3&gt;Manifest&lt;/h3&gt;
&lt;p&gt;This file tells the browser how it should display the app. It includes things like the name, start URL colours and logos. This is in the JSON format and follows a straightforward convention.&lt;/p&gt;
&lt;h3&gt;Service worker&lt;/h3&gt;
&lt;p&gt;The service worker file runs in the browser separately to the main app.&lt;/p&gt;
&lt;p&gt;It can handle network requests, manage the cache and do all sorts of things I haven&#39;t dug into yet.&lt;/p&gt;
&lt;p&gt;I ended up using an example service worker from Google to fulfill the requirements of a PWA.&lt;/p&gt;
&lt;h2&gt;What I ended up with&lt;/h2&gt;
&lt;p&gt;A website that does the job!&lt;/p&gt;
&lt;p&gt;It&#39;s far from perfect but it&#39;s an improvement on the last sweepstake website I made. I just need to improve it in time for the &lt;a href=&quot;https://www.fifa.com/en/tournaments/mens/worldcup/canadamexicousa2026&quot;&gt;2026 World Cup&lt;/a&gt; in North America!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Digital gardens</title>
    <link href="https://robwood.uk/blog/digital-garden/" />
    <updated>2024-07-07T00:00:00Z</updated>
    <id>https://robwood.uk/blog/digital-garden/</id>
    <content type="html">&lt;p&gt;I&#39;ve been reading about the concept of digital gardens, starting from &lt;a href=&quot;https://maggieappleton.com/garden-history&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My interpretation of these is that they&#39;re a place on the internet where an author can note down their current thoughts about a specific topic rather than a full, polished article.&lt;/p&gt;
&lt;p&gt;This sounds a lot lot like learning in public.&lt;/p&gt;
&lt;p&gt;I like the idea of giving yourself permission to think out loud and change your perspectives as you learn more.&lt;/p&gt;
&lt;p&gt;I think a key part of this is that you revisit what you wrote and develop it.&lt;/p&gt;
&lt;p&gt;I like the idea that I&#39;m writing for me, not any particular audience. I&#39;m writing stuff down to help my future self with topics that I may need to reference in the future.&lt;/p&gt;
&lt;p&gt;It also reinforces the idea that writing is a way of helping you think.&lt;/p&gt;
&lt;h2&gt;Other links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://armstrong.is/miscellaneous/digital-gardening&quot;&gt;https://armstrong.is/miscellaneous/digital-gardening&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://joelhooks.com/digital-garden&quot;&gt;https://joelhooks.com/digital-garden&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Grid template areas</title>
    <link href="https://robwood.uk/blog/grid-template-areas/" />
    <updated>2023-04-15T00:00:00Z</updated>
    <id>https://robwood.uk/blog/grid-template-areas/</id>
    <content type="html">&lt;p&gt;I use grid a fair bit in my work but I realise there&#39;s so much of it I don&#39;t know that well.&lt;/p&gt;
&lt;p&gt;One thing that I&#39;ve not used too much is &lt;code&gt;grid-area&lt;/code&gt;. In creating the header for this site, I created a simple 2 by 2 grid.&lt;/p&gt;
&lt;p&gt;I then placed the logo, theme switcher and nav items in separate areas. To do this, I used &lt;code&gt;&amp;lt;grid-line&amp;gt;&lt;/code&gt;. After a bit of faffing I got it to work.&lt;/p&gt;
&lt;p&gt;It just seems so un-intuitive though. You set 4 values (in this order):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;grid-row-start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grid-column-start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grid-row-end&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grid-column-end&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, you can end up with something like this (assuming you&#39;re using integers as the values):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grid-area: 1 / 1 / 2 / 2&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can omit certain values and certain rules are applied to set the values automatically. This is great but it means it&#39;s not always obvious what&#39;s going on.&lt;/p&gt;
&lt;h2&gt;A nicer way?&lt;/h2&gt;
&lt;p&gt;A better way for my brain to understand is to use a CSS &lt;code&gt;&amp;lt;custom-ident&amp;gt;&lt;/code&gt; data type. This allows you to apply a user-defined string to visually map out how I you want the grid to look. Instead of effectively specifying the co-ordinates of where each item should sit in a 2x2 column grid, you map out the areas in the parent and give them an identifier. That identifier is then referenced in the CSS for the child item.&lt;/p&gt;
&lt;h2&gt;What does that mean in English?&lt;/h2&gt;
&lt;p&gt;This:&lt;/p&gt;
&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;nav&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token property&quot;&gt;grid-template-areas&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token string&quot;&gt;&quot;logo switcher&quot;&lt;/span&gt;
    &lt;span class=&quot;token string&quot;&gt;&quot;link links&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I find this a much easier way to visualise what&#39;s going on and create the grid I need.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>WebC for 11ty</title>
    <link href="https://robwood.uk/blog/webc-for-11ty/" />
    <updated>2023-02-04T00:00:00Z</updated>
    <id>https://robwood.uk/blog/webc-for-11ty/</id>
    <content type="html">&lt;p&gt;I love 11ty and use it for pretty much every personal project.
One of the main things that I&#39;ve wanted for 11ty is a robust way to work with reusable components.
I&#39;ve used Vue for a while now and one of the things I like about it are the single file components.
Being able to have the HTML, scripts and styles all in one place is useful, especially the ability to scope styles to the component.
I&#39;ve always wished that 11ty had something similar.&lt;/p&gt;
&lt;p&gt;Guess what? Now it does!&lt;/p&gt;
&lt;h2&gt;What&#39;s WebC?&lt;/h2&gt;
&lt;p&gt;What it means to me is basically single file components for 11ty. You can find a more thorough and  &lt;em&gt;accurate&lt;/em&gt; explanation on the &lt;a href=&quot;https://www.11ty.dev/docs/languages/webC/&quot;&gt;official site&lt;/a&gt;.
You get reusable components you can use on your website that will render to the client as static HTML.
It also gives you scoped CSS!&lt;/p&gt;
&lt;h2&gt;Single file components for 11ty&lt;/h2&gt;
&lt;p&gt;I&#39;ve used 11ty for a while now and I&#39;ve played around with different methods to to give me a similar experience to what I&#39;m used to in Vue.
The closest I got was using Nunjucks macros.
These gave me the ability to have reusable components with props but it wasn&#39;t perfect.
There was no way to scope the styles so you still had to rely on global styles.
The markup needed to create the macro also made it hard to easily tell what macro was doing.&lt;/p&gt;
&lt;h2&gt;What&#39;s good about WebC?&lt;/h2&gt;
&lt;p&gt;Lots. Here&#39;s are a few of the obvious ones for me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You write the components with HTML (and and some WebC sprinkles).&lt;/li&gt;
&lt;li&gt;They render statically on the client which means they work without JavaScript.&lt;/li&gt;
&lt;li&gt;You can write CSS that is scoped to that component.&lt;/li&gt;
&lt;li&gt;You can also use them to render reusable content (instead of using Nunjucks includes, for example).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What are the downsides?&lt;/h2&gt;
&lt;p&gt;Nothing&#39;s perfect but this isn&#39;t far off!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There&#39;s a bit of a learning curve but it&#39;s really not that steep.&lt;/li&gt;
&lt;li&gt;It requires an additional plugin if that bothers you.&lt;/li&gt;
&lt;li&gt;With my original setup I couldn&#39;t get pages using WebC layouts to render correctly using directory data. It needed a little bit of &lt;code&gt;eleventyConfig&lt;/code&gt;-wrangling to get around it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Where can I learn more?&lt;/h2&gt;
&lt;p&gt;I&#39;m still getting my head around WebC and I know I&#39;ve barely scratched the surface of what it can do. Here are some resources I found useful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.11ty.dev/docs/languages/webc/&quot;&gt;Official 11ty docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://11ty.webc.fun/&quot;&gt;11ty &amp;amp; WebC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://11ty.rocks/posts/introduction-webc/&quot;&gt;Introduction to WebC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://11ty.rocks/posts/understanding-webc-features-and-concepts/&quot;&gt;Understanding WebC Features and Concepts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, there&#39;s a link to my &lt;a href=&quot;https://github.com/robjwood/rjw-11ty-webC-starter&quot;&gt;starter template&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>This website</title>
    <link href="https://robwood.uk/blog/this-website/" />
    <updated>2021-01-29T00:00:00Z</updated>
    <id>https://robwood.uk/blog/this-website/</id>
    <content type="html">&lt;p&gt;I&#39;ve had various versions of this website over the years.
I&#39;ve gone through phases of completely ignoring it for years, or tinkering with it endlessly.
There&#39;s a third phase which is the &lt;em&gt;&#39;rip-it-all-up-and-start-again&#39;&lt;/em&gt; phase. That&#39;s where I am now.&lt;/p&gt;
&lt;p&gt;I&#39;ve decided to focus on making it as light as I can then building on top of it.
This website is static and only contains a few pages so it really needs to be fast, if nothing else.&lt;/p&gt;
&lt;p&gt;I&#39;ve decided (for now) to stick with system fonts as the main change. I&#39;m also aiming to actually start blogging a little.&lt;/p&gt;
</content>
  </entry>
</feed>