No description
Find a file
Sami Samhuri 0748053a82 Roll the feed plugins into PostsPlugin
You can't have feeds without posts that they link to. Doesn't make sense to have feeds without posts.
2019-12-11 00:18:19 -08:00
bin Add a site URL override for building beta.samhuri.net 2019-12-11 00:01:12 -08:00
drafts Render the post archive at /posts and redirect /archive 2019-12-04 23:17:03 -08:00
images new favicon 2014-03-02 15:58:36 -08:00
posts Fix incorrect Markdown link syntax 2019-12-10 21:52:22 -08:00
public Hide .html extensions on all pages by default 2019-12-10 00:27:56 -08:00
SiteGenerator Roll the feed plugins into PostsPlugin 2019-12-11 00:18:19 -08:00
templates Render an RSS feed 2019-12-10 21:52:10 -08:00
Tests Explicitly activate plugins via site.json 2019-12-11 00:00:05 -08:00
wayback wat? 2014-04-06 22:14:56 -07:00
.gitignore Format the cv page correctly 2019-12-01 22:37:54 -08:00
.tm_properties Format the cv page correctly 2019-12-01 22:37:54 -08:00
Gemfile Exorcise harp and node.js, server, and add Swift plan 2019-12-01 10:59:05 -08:00
Gemfile.lock Exorcise harp and node.js, server, and add Swift plan 2019-12-01 10:59:05 -08:00
Makefile Add a site URL override for building beta.samhuri.net 2019-12-11 00:01:12 -08:00
projects.json Migrate projects to the new site generator 2019-12-03 08:45:56 -08:00
Readme.md Update plan 2019-12-10 23:54:21 -08:00
site.json Explicitly activate plugins via site.json 2019-12-11 00:00:05 -08:00

samhuri.net

The source code for samhuri.net.

New version using Swift

The idea is to create a bespoke set of tools, not a general thing like Jekyll. If something can be factored out later that's a bonus, not a goal.

This is a plan for migrating from a mix of node.js (harp) and Ruby to Swift. Use Ink, John Sundell's Markdown parser, to render posts, and some other library for generating HTML. Will probably try generating HTML from code because I've never tried it and it seems fun. The pointfree.com guys have one already and Sundell is releasing one Real Soon(tm).

This version will go back to its roots and use headers at the top of markdown files. It was so much easier than indexing everything. Check out the old repo to see how nice it was back in the day. The code that renders it was separate and is available at 9af9d75.

Execution, trying TDD for the first time:

  • Replace harp with custom Swift code

    • Write a test harness that renders a site and then checks the output with diff -r

    • Write a site generator that renders www/index.html from site.json

    • Add support for site styles

    • Add support for page styles

    • Add support for site scripts

    • Add support for page scripts

    • Add support for CSS files

    • Transform LESS into CSS

    • Migrate static pages to the new site generator

      • About

      • 404 / missing (configure via .htaccess as well)

      • cv

      • check and delete _data.json

    • Migrate projects to the new site generator

      • Migrate projects page

      • Migrate project page

      • Check and delete _data.json

    • Migrate posts to markdown with headers somehow

      • Define the new format

      • Decide whether to migrate from 9af9d75 or the current harp format (probably easier to migrate the new format because posts may have been updated since then)

      • Migrate posts

      • Migrate year indexes

      • Migrate month indexes

      • Migrate index / recent posts

      • Migrate archive and put it at /posts/index.html, duh!

      • 301 redirect /archive to /posts, and update the header link

      • Check and delete _data.json files

    • Search for other _data.json and .ejs files and eliminate any that are found

  • Link years to year indexes in the posts archive

  • Fix missing days on post dates in the archive and year indexes

  • Find a way to add the site name to HTML titles rendered by plugins

  • Clean up the posts plugin

    • Why don't plain data structures always work with Stencil? Maybe computed properties are a no-go but we can at least use structs instead of dictionaries for the actual rendering

    • Separate I/O from transformations

    • Factor the core logic out of PostsPlugin ... separate I/O from transformations? Is that an improvement or does it obscure what's happening?

    • Stop validating metadata in Post, do that when rendering markdown

    • Remove RenderedPost

    • Move all dictionary conversions for use in template contexts to extensions

    • Stop using dictionaries for template contexts, use structs w/ computed properties

  • Consider using Swift for samhuri.net as well, and then making SiteGenerator a package that it uses ... then we can use Plot or pointfree.co's swift-html

  • Replace remaining Ruby with Swift

    • Generate RSS feed (ditch mustache templates)

    • Generate JSON feed

    • Munge HTML files to make them available without an extension (index.html hack, do it in the SiteGenerator)

    • Use perf tools on beta.samhuri.net and compare to samhuri.net to see if inlining css and minifying JS is actually worthwhile

    • Inline CSS?

    • Minify JS? Now that we're keeping node, why not ...

  • Add a server for local use and simple production setups (or use a file watcher + python -m SimpleHTTPServer?)

  • Figure out an iPad workflow with minimal code. Maybe a small app with some extensions and shortcuts?