From f98c228b3cd7255359a45724ebfafacb3fe48332 Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Mon, 16 Jun 2025 20:18:04 -0700 Subject: [PATCH] Add post titles and blurbs --- ...open-an-iex-shell-from-an-elixir-script.md | 2 ++ ...alyzer-with-gui-from-a-docker-container.md | 2 ++ ...ming-multiview-projections-to-isometric.md | 1 + ...erated-html-with-docker-on-digitalocean.md | 2 ++ docs/2023-11-15-test-mix-task-file-modify.md | 2 ++ ...1-build-static-website-generator-part-1.md | 2 ++ posts.moon | 31 +++++++++---------- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md b/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md index f3825cf..81288e5 100644 --- a/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md +++ b/docs/2023-09-15-open-an-iex-shell-from-an-elixir-script.md @@ -1,5 +1,7 @@ { id: "open-an-iex-shell-from-an-elixir-script" + title: "Open An IEx Shell From An Elixir Script" + blurb: "We can run an Elixir script with either the elixir or the iex command. Both will execute the code, but the second command opens an interactive IEx shell afterward. What if, we won't know until runtime whether we want a shell or not? How can we start an IEx session even when we use elixir, instead of iex, to run our script?" } --- diff --git a/docs/2023-10-08-start-erlangs-dialyzer-with-gui-from-a-docker-container.md b/docs/2023-10-08-start-erlangs-dialyzer-with-gui-from-a-docker-container.md index 76079d4..44ae3bb 100644 --- a/docs/2023-10-08-start-erlangs-dialyzer-with-gui-from-a-docker-container.md +++ b/docs/2023-10-08-start-erlangs-dialyzer-with-gui-from-a-docker-container.md @@ -1,5 +1,7 @@ { id: "start-erlangs-dialyzer-with-gui-from-a-docker-container" + title: "Start Erlang's Dialyzer With GUI From A Docker Container" + blurb: "Everything in OTP is command-line driven, so using containers during development has been without issue. But, Dialyzer, Erlang's static analysis tool, actually has a Graphical User Interface. How can we still use Dialyzer and its GUI even though Elixir is running inside a container?" } --- diff --git a/docs/2023-10-16-fix-distortion-introduced-when-transforming-multiview-projections-to-isometric.md b/docs/2023-10-16-fix-distortion-introduced-when-transforming-multiview-projections-to-isometric.md index 5f26c52..baab015 100644 --- a/docs/2023-10-16-fix-distortion-introduced-when-transforming-multiview-projections-to-isometric.md +++ b/docs/2023-10-16-fix-distortion-introduced-when-transforming-multiview-projections-to-isometric.md @@ -1,5 +1,6 @@ { id: "fix-distortion-introduced-when-transforming-multiview-projections-to-isometric" + blurb: "One thing we learned from a week of trying to make isometric vector drawings." } --- diff --git a/docs/2023-11-01-deploy-elixir-generated-html-with-docker-on-digitalocean.md b/docs/2023-11-01-deploy-elixir-generated-html-with-docker-on-digitalocean.md index e7e69ad..36b005b 100644 --- a/docs/2023-11-01-deploy-elixir-generated-html-with-docker-on-digitalocean.md +++ b/docs/2023-11-01-deploy-elixir-generated-html-with-docker-on-digitalocean.md @@ -1,5 +1,7 @@ { id: "deploy-elixir-generated-html-with-docker-on-digitalocean" + title: "Deploy Elixir-Generated HTML With Docker On DigitalOcean" + blurb: "This is a simple proof of concept where we create a boilerplate HTML file with Elixir, containerize our build process with Docker, and deploy our markup live with DigitalOcean's hosting service." } --- diff --git a/docs/2023-11-15-test-mix-task-file-modify.md b/docs/2023-11-15-test-mix-task-file-modify.md index c3720d7..639153d 100644 --- a/docs/2023-11-15-test-mix-task-file-modify.md +++ b/docs/2023-11-15-test-mix-task-file-modify.md @@ -1,5 +1,7 @@ { id: "test-mix-task-file-modify" + title: "Temporary Directories For Testing Mix Tasks That Modify Files" + blurb: "Writing a test for a simple Mix task gets surprisingly complex. Application environment variables, temporary test directories, and IO capture are all involved." } --- diff --git a/docs/2023-12-01-build-static-website-generator-part-1.md b/docs/2023-12-01-build-static-website-generator-part-1.md index 3d76a1a..1f6ead0 100644 --- a/docs/2023-12-01-build-static-website-generator-part-1.md +++ b/docs/2023-12-01-build-static-website-generator-part-1.md @@ -1,5 +1,7 @@ { id: "build-static-website-generator-part-1" + title: "Build A Static-Website Generator With Elixir, Part 1" + blurb: "We take the first steps in designing and implementing the \"world's simplest static-website generator\". Building on tools and knowledge we acquired previously, and utilizing an incremental and iterative development process, we go through the entire software life-cycle from creating the initial project files to deploying to production. We spare nothing, from spelling out every command, to ensuring application integrity with tests, and even updating the README file. Grab a drink and some snacks, and dive right in!" } --- diff --git a/posts.moon b/posts.moon index 3e24b13..c58e0cb 100644 --- a/posts.moon +++ b/posts.moon @@ -41,7 +41,7 @@ -- -- date = require "date" -date! +-- date! -- return { -- format: "markdown" -- title: "My Site's Title" @@ -54,27 +54,26 @@ path = require "sitegen.path" moon = require("moon") common = require("sitegen.common") -get_date = (str) -> str +extract_date = (source) -> string.match path.filename(source), "%d+%-%d%d%-%d%d" +format_date = (str) -> date(str)\fmt "%b %d, %Y" +publish_date = (path) -> format_date extract_date path html -> posts = [{ id: p.meta.id - target: p.meta.target - source: p.source + tgt: p.meta.target + src: p.source + title: p.meta.title or p.meta.id + blurb: p.meta.blurb } for _, p in pairs page.site.pages when p.meta.template == "blog"] + -- require("moon").p [p.meta for _, p in pairs page.site.pages] + table.sort posts, (a, b) -> a.src > b.src + [tag["section"] { - tag["h3"] { tag["a"] { href: p.target .. ".html", p.id }} - tag["time"] { - -- p.source - -- tostring(date(2011, 11, 26)) - -- one = string.match(path.filename(p.source), "%d+%-%d%d%-%d%d%-") - -- r = string.gsub(one, "%-", " ") - -- r - get_date string.match(path.filename(p.source), "%d+%-%d%d%-%d%d") - -- common.slugify path.filename(p.target) - } - "— blurb here" - tag["a"] { class: "read-post-link", href: p.target .. ".html", "Read post →"} + tag["h3"] { tag["a"] { href: p.tgt .. ".html", p.title }} + tag["time"] { publish_date p.src } + "—" .. if p.blurb then " #{p.blurb}" else "" + tag["a"] { class: "read-post-link", href: p.tgt .. ".html", "Read post →"} } for _, p in ipairs posts]