Skip to content

Commit

Permalink
fix(posts): render subtitle as meta description
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-kashitsyn committed Jan 18, 2024
1 parent cae47dc commit ae41975
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PORT ?= 9090
DEST ?= site

.PHONY: help
help:
@echo "Supported targets"
@echo "================="
@echo "serve - serve the blog content on the PORT"
@echo "render - render the website into the DEST directory"

.PHONY: serve
serve: build
./blogware/blogware -serve localhost:$(PORT)

.PHONY: render
render: build
./blogware/blogware -output $(DEST)

.PHONY: build
build:
pushd blogware; go build; popd
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ This repository contains the full source of my personal blog hosted at https://m

# Build instructions

You’ll need [Go](https://go.dev/) installed to build the website.
You’ll need [Go](https://go.dev/) and [Make](https://www.gnu.org/software/make/) installed to build the website.
Execute the following commands in the root repository:

```bash
pushd blogware; go build; popd
./blogware/blogware -output site
make render DEST=site
```

The `site` directory will contain the full website contents that you can host statically.
Expand Down
1 change: 1 addition & 0 deletions blogware/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func renderPostAt(i int, articles []Article) (contents []byte, err error) {
ctx := PostRenderContext{
AbsoluteURL: rootURL + article.URL,
Title: article.Title,
Subtitle: article.Subtitle,
CreatedAt: article.CreatedAt,
ModifiedAt: article.ModifiedAt,
Keywords: article.Keywords,
Expand Down
4 changes: 2 additions & 2 deletions post.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta name="author" content="Roman Kashitsyn">
<meta name="keywords" content="{{ StringsJoin .Keywords "," }}"/>
{{ if .Subtitle }}
{{ if .Subtitle -}}
<meta name="description" content="{{ .Subtitle }}"/>
{{ end }}
{{- end }}
<title>{{ .Title }}</title>
<link rel="stylesheet" href="/css/tufte.css">
<link rel="icon" href="/images/favicon.svg">
Expand Down
2 changes: 1 addition & 1 deletion posts/13-icp-ledger.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\documentclass{article}

\title{IC internals: the ICP ledger}
\subtitle{The treasury of the Internet Computer utility tokens.}
\subtitle{The design of the Internet Computer utility token treasury.}
\date{2022-12-19}
\modified{2022-12-19}

Expand Down

0 comments on commit ae41975

Please sign in to comment.