I started my first blog-like site in 1999 running on code I wrote atop Zope. My next site ran Movable Type before I migrated to WordPress for quite a few years. Sometime in the 2010s, I decided that I wanted to simplify and use static site generators.
When I made the transition from WordPress to a static site for KevinDangoor.com, I made a small attempt to migrate the content, but it would have been more work than it was worth. So, I just slurped down all of the pages directly and dumped the HTML and CSS into static directories. All of my older (2014 and earlier) content looked completely different from the rest of the site and wasn’t indexed in the same way.
My most recent transition involved using [Hugo](https://www.kevindangoor.com/posts/…
I started my first blog-like site in 1999 running on code I wrote atop Zope. My next site ran Movable Type before I migrated to WordPress for quite a few years. Sometime in the 2010s, I decided that I wanted to simplify and use static site generators.
When I made the transition from WordPress to a static site for KevinDangoor.com, I made a small attempt to migrate the content, but it would have been more work than it was worth. So, I just slurped down all of the pages directly and dumped the HTML and CSS into static directories. All of my older (2014 and earlier) content looked completely different from the rest of the site and wasn’t indexed in the same way.
My most recent transition involved using Hugo along with a custom tool which helped me translate from Obsidian to a static site, preserving wikilinks and backlinks. I left the static files untouched.
It’s a new era
I was finally ready to revive this site and wanted to double down on using Obsidian to manage it. I considered using Obsidian Publish, but Quartz came onto my radar as a more powerful choice for someone like me who can run a slightly more complex setup.
GitHub Copilot was the biggest difference between now and my previous site transitions. Even though I have plenty of experience with Copilot, I couldn’t believe how smooth the transition was. Right from the comfort of VS Code, I ran through a series of four prompts (along with a small number of commands at the regular macOS command prompt). For each of the prompts, Copilot wrote a small JavaScript tool to do the work.
First, fix up the file format to go from Hugo to Quartz. I noticed in Copilot’s thinking that it even figured out that I was moving from Hugo to Quartz.
The .md files in the content directory have TOML frontmatter right now. I need to replace that with YAML frontmatter. Also, the ”+++” used to set the frontmatter apart from the content should be replaced by ”—“.
Next, change my processed links back into wikilinks:
In the .md files in the content/posts directory, there are links in the standard markdown form like this: Link text. I need those to turn into wikilinks and they don’t need to include the path or trailing slash. They do need to match the case of the markdown file that’s the target of the wikilink. A link like diagramming should become Diagramming.
Then I wanted to tackle the static files, converting them to Markdown while preserving syntax highlighting that I used in some posts:
In the “static” directory, I have some old blog posts that have been converted from another blog to HTML. I’d like to convert the content to Markdown files that will live in the “content” directory in a path that matches the old path. So, static/2014/05/simplifying-code-with-react/index.html will become content/2014/05/simplifying-code-with-react.md. The <title> tag will become “title” front matter in the md file (without ”- kevindangoor.com” at the end). Everything outside of the <section> with the id=“main” can go away. If you see <pre><code class=“language-javascript”> in a file, that should become a fenced code block in the markdown.
That one took a little back-and-forth with Copilot Agent. The Agent would run the tool to convert a single file and let me inspect the result before running across all of the files. For example, Quartz can attach a date to a post based on when it was updated in git, but my git history for these static files wasn’t going to be right. I noticed the HTML had a date in them:
There’s a <meta property=“article:modified_time” content=“2014-05-12”/> tag in the HTML files. I’d like that value to appear in the “date” frontmatter.
After peeking at the output, I saw that the date wasn’t being picked up by Quartz and that a time was needed in addition to the date:
The output date in the frontmatter needs a time. We can just go with 08:00:00. So something like date: “2014-05-12T08:00:00Z”.
Again, more viewing of the output and I spotted that my YouTube embeds weren’t working:
There are some YouTube embeds and a slideshare embed that appear as <iframe> in the original .html files. Can you bring those across into the markdown?
I don’t put these prompts here as an example of great “prompt engineering”, which is my point. I didn’t need to do anything tricky to get Copilot to give me exactly the transformation I wanted.
Finally, I wanted to get rid of my old “backlinks” sections that my code had put into the Markdown files, since Quartz natively supports that feature in its output.
Some of the .md files in the content directory have a ”## Backlinks” section at the end of the file. I’d like to remove those sections
The end result
I was truly pleased with how quickly I was able to migrate this site from Hugo to Quartz, including the static files which had previously been way too much trouble to deal with. Now, even old content like my introduction to our use of React in Adobe Brackets is available in this site.
I don’t know precisely how I’m going to evolve this site, but I do want to gradually migrate more of my notetaking to here as a digital garden and to have more of the links I save appear here as well. Obsidian and Quartz gives me a nice basis to explore this.