Skip to content

Instantly share code, notes, and snippets.

@jakevoytko
Created February 28, 2026 01:16
Show Gist options
  • Select an option

  • Save jakevoytko/ca2cb77f521b9f89e9c064596f7054c7 to your computer and use it in GitHub Desktop.

Select an option

Save jakevoytko/ca2cb77f521b9f89e9c064596f7054c7 to your computer and use it in GitHub Desktop.
You are a planning agent and may only create beans tasks for subagents to implement.
Port an XML export of a Wordpress blog onto a Golang-powered blog server. You can find it in the current directory, it is the only XML file.
The site will have its own plugin framework for adding new page types. A single plugin will be called a Feature. There will be a single registry that collects all of the Features and calls them to register endpoints, collect their pages, etc. Each Feature will get its own directory. The PageFeatures to start with will be Page, Post, Sitemap, Tag, and Category. Example usage: each PageFeature will implement a GetAllURLs function that returns a list of all of the URLs that have that particular feature type. The Sitemap PageFeature will be able to call this to get a list of URLs, filter itself out, and generate the Sitemap from it.
It will use the Gin framework and the regular Golang template system. It will use external libraries for frontmatter, XML parsing, and markdown to HTML.
The site is www.bitlog.com. When in doubt, the current behavior of bitlog.com is the source of truth for how the site should behave.
Build tools for the following behaviors:
Parsing the XML dump into pages and posts, especially focusing on putting Markdown and not HTML into the files.
Scraping the image URLs from the posts and downloading the images
The content will be stored in Markdown files with Frontmatter under /content/pages and /content/posts. Posts will be organized into year/month folders, for example, /content/posts/2025/12/sample-blog-post.md. Pages will always be relative to content root.
The URLs will be accessible via paths in the format https://$domain/2026/01/04/2025-year-in-review/. Pages will be accessible via their path and slug, similar to https://$domain/about-me/
Tags will be accessible via https://$server/tag/interviewing/. Categories will be accessible via https://$server/category/interviewing. The tags and categories will be converted to lowercase for the purposes of the URL.
The server will first validate that the URL incoming path is correct and does not contain a directory of just `.` or `..`. It will then read the content relative to the content directory root and generate the page. It will cache this version for 15 minutes instead of rereading the file from disk. After the 15 minutes have finished, it should re-read from the disk.
It will have a RSS feed at https://$server/feed/
It will have a sitemap, referenced in the footer. The footer will have a copyright notice, from the year of the earliest post to the current year.
Styling will be minimalist. Black text and a white background around the content. Links will always be blue and underlined. There will be a thick black border on the left and right of the content. If there is more than 1 post, there will be a thick black line between them. The header will contain a large www.bitlog.com in the header, with the slogan "Jake Voytko's personal log of bits" below that. Below the header will be the nav bar, which will contain links to Home and About Me. The current page will be bolded, if applicable. The title of the post will be the largest font in the post. Outside of the black border on the left and right of the content, the background of the site will be gray with 50% luminance.
Set a Content Security Policy header that only permit same-origin. If there is an embed on the page, add it to the CSP.
The homepage will have the full text of 3 posts. Below the content on the left-hand side will be the text "< Older posts" and "Newer Posts >" when appropriate, and it will paginate in the format https://$server/page/2/
In the rendered markup, the <head> will contain meta tags with property="og:*". Look at the current bitlog.com to see what og tags should be supported. It will contain link rel=canonical/prev/next. It will contain meta name="twitter:*" metadata. Look at the current bitlog.com to see what ones need to be supported.
The site will have its own styled 4xx and 5xx error pages, which will use the same styling as the rest of the site, give an error message appropriate for the error code. It will also redirect back to the homepage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment