Oh blog, where art thou
Years ago I started a journey of documenting code snippets and issues I encountered while reading and coding. Yet they were never released here, or anywhere, other than an increasingly cluttered table in Notion. Why is that?
I had trouble with showing things the way I wanted to, and instead had them stuck in Notion as a draft to later put here.
What did I want to show, you ask?
Let’s say there was some code snippet I wanted to display, but at some point wanted to change the language or perhaps give the option to switch between Swift, SwiftUI or Obj-C syntax highlighting. Squarespace (the host for this site) has a few options for code - but can it do what I need?
Before I jump into any Swift, here’s the issue with showing the code as I had intended on Squarespace:
If I wanted to insert any code, I’d have to click the + at the bottom of my window
After clicking the +, a few options display for blocks. I search code and have the options for either Markdown or Code. Markdown can work, but won’t give me the flexibility of switching between languages so I’m left with code. That sounds like what I need…
Side thought: One of the issues I was working on figuring out was how to make the presentation a bit clearer. Instead of spending a lot of time polishing, I decided on leaving the imperfections to show progress later on.
When clicking “Code” a “Hello, World!” appears in HTML with a few options for languages.
Hello, World!
OK. So the options are CSS, HTML, JavaScript, Markdown and Plain Text. Well, that’s not what I wanted.
What is the best way to show code snippets on SquareSpace?
And thus, for 2 years, this blog has stalled on this question - and will continue to sit a bit longer until I figure out a way to show code snippets without using Markdown. Perhaps a tutorial on embedding code snippets from GitHub is on the way?
Resources
Resizing an image - https://support.squarespace.com/hc/en-us/articles/206566727#toc-resize-with-other-blocks
Embed Blocks vs. Code Blocks - https://support.squarespace.com/hc/en-us/articles/206543227