Skip to content

Commit 9fee1b0

Browse files
author
John Mee
committed
Migrate pages to Hugo posts; redesign home page and post layout
- Move all posts from pages/ to content/posts/ with Hugo front matter (date, tags, draft); reflow prose to 80-char line width - Fix all Hugo v0.159.0 warnings: replace raw HTML (FA icons, <sup>, <small>, <del>/<ins>) with markdown equivalents; remove goldmark unsafe renderer setting - Home page: unified post list with flexbox title+date header; first 3 posts show .Summary, remainder show a short tagline; meejinnz linked as static entry - Single post: add breadcrumb nav and share-link button above heading; fix share button double-click label bug - Add tagline front matter field to all posts - Fix image paths from /static/images/ to /images/ across all posts - Move meejinnz/ photo diary to static/ for verbatim Hugo serving
1 parent ef1956d commit 9fee1b0

74 files changed

Lines changed: 4044 additions & 3165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.hugo_build.lock
2+
.claude/
23
public/

README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# johnmee.com
2+
3+
Personal website for John Mee at [www.johnmee.com](https://www.johnmee.com). A minimalist blog and portfolio publishing technical articles, book reviews, and professional information.
4+
5+
## Architecture
6+
7+
A static site built with [Hugo](https://gohugo.io), deployed automatically to GitHub Pages on every push to `master`.
8+
9+
```
10+
johnhugo/
11+
├── .github/workflows/hugo.yml # CI/CD: builds and deploys to GitHub Pages
12+
├── archetypes/
13+
│ └── default.md # Template for new content (hugo new)
14+
├── assets/
15+
│ └── css/main.css # All site styles (light/dark theme, responsive)
16+
├── content/
17+
│ ├── posts/ # Blog posts (date-ordered)
18+
│ └── disclaimer.md # Disclaimer page (custom URL)
19+
├── layouts/
20+
│ └── _default/
21+
│ ├── baseof.html # Base template: header, footer, theme toggle
22+
│ ├── home.html # Homepage: latest 5 posts
23+
│ ├── single.html # Individual post/page
24+
│ └── list.html # Section index pages
25+
├── static/ # Served as-is: images, documents, favicon
26+
└── hugo.toml # Site config: baseURL, title, tagline
27+
```
28+
29+
No external theme is used — all templates are custom and contained in `layouts/`.
30+
31+
## Requirements
32+
33+
- [Hugo](https://gohugo.io/installation/) (extended version recommended)
34+
35+
```sh
36+
hugo version
37+
```
38+
39+
## Local Development
40+
41+
```sh
42+
git clone https://github.com/johnmee/johnhugo.git
43+
cd johnhugo
44+
45+
# Start local dev server with drafts visible
46+
hugo server -D
47+
48+
# Visit http://localhost:1313
49+
```
50+
51+
## Deployment
52+
53+
Pushing to `master` triggers the GitHub Actions workflow (`.github/workflows/hugo.yml`), which builds the site and deploys it to GitHub Pages automatically. No manual steps required.
54+
55+
---
56+
57+
## How to Add a Post
58+
59+
**1. Create the file**
60+
61+
```sh
62+
hugo new posts/my-post-title.md
63+
```
64+
65+
This generates `content/posts/my-post-title.md` with front matter pre-filled from the archetype. The title is derived from the filename.
66+
67+
**2. Edit the front matter and content**
68+
69+
```markdown
70+
+++
71+
date = '2026-03-24T00:00:00+00:00'
72+
draft = true
73+
title = 'My Post Title'
74+
+++
75+
76+
Your content here in Markdown.
77+
```
78+
79+
- Set `draft = false` (or remove the line) when ready to publish.
80+
- `date` controls sort order on the homepage and post list.
81+
82+
**3. Preview locally**
83+
84+
```sh
85+
hugo server -D # -D shows drafts
86+
```
87+
88+
**4. Publish**
89+
90+
Set `draft = false` in the front matter, commit, and push to `master`. The site deploys automatically.
91+
92+
---
93+
94+
## How to Modify Templates and Layouts
95+
96+
All templates live in `layouts/_default/`. Hugo uses Go's `html/template` package.
97+
98+
### Base Template — `baseof.html`
99+
100+
Every page inherits from this. It defines the outer HTML shell:
101+
102+
- **Header** — site title (links to homepage), dark mode toggle button
103+
- **Main content block**`{{ block "main" . }}` — overridden by each template below
104+
- **Footer** — copyright year and disclaimer link
105+
- **CSS** — loaded from `assets/css/main.css` via Hugo's asset pipeline (minified + fingerprinted)
106+
- **Theme script** — inline JS that reads/writes `localStorage` to persist light/dark preference
107+
108+
To change the site-wide header, footer, or add scripts that appear on every page, edit `baseof.html`.
109+
110+
### Homepage — `home.html`
111+
112+
Overrides the `main` block. Displays the five most recent posts from the `posts` section with their date, title, and summary. To change the number of posts shown, update the `first` parameter:
113+
114+
```html
115+
{{ range first 5 (where .Site.RegularPages "Section" "posts") }}
116+
```
117+
118+
### Single Post/Page — `single.html`
119+
120+
Renders an individual piece of content. Displays publish date, estimated reading time, and the full content body. Applied to every post in `content/posts/` and any standalone page like `content/disclaimer.md`.
121+
122+
### List Page — `list.html`
123+
124+
Renders section index pages (e.g. `/posts/`). Lists all pages in the section sorted by date, newest first. Each entry shows the date and a link to the page.
125+
126+
### Styles — `assets/css/main.css`
127+
128+
The stylesheet uses CSS custom properties for theming:
129+
130+
```css
131+
:root { --bg: #fff; --text: #222; --accent: #0057b8; }
132+
[data-theme="dark"] { --bg: #111; --text: #ddd; --accent: #58a6ff; }
133+
```
134+
135+
- Edit `:root` and `[data-theme="dark"]` to change the colour scheme.
136+
- The layout is a single centred column, max-width 860px.
137+
- No external CSS frameworks are active — `normalize.css` and `skeleton.css` in `static/` are not currently loaded.
138+
139+
### Site Configuration — `hugo.toml`
140+
141+
```toml
142+
baseURL = 'https://www.johnmee.com/'
143+
languageCode = 'en-au'
144+
title = 'John'
145+
146+
[params]
147+
tagline = 'The daily frustrations of man'
148+
```
149+
150+
- `title` appears in the browser tab and is referenced in templates as `{{ .Site.Title }}`.
151+
- `params.tagline` is available in templates as `{{ .Site.Params.tagline }}`.

assets/css/main.css

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ header a {
6666
nav a {
6767
color: var(--muted);
6868
text-decoration: none;
69-
margin-left: 1.5rem;
7069
font-size: 0.95rem;
7170
}
7271

@@ -156,17 +155,31 @@ p {
156155
margin-bottom: 1rem;
157156
}
158157

158+
ol, ul {
159+
padding-left: 1.5rem;
160+
margin-bottom: 1rem;
161+
}
162+
159163
a {
160164
color: var(--accent);
161165
}
162166

163167
/* Post list (home page) */
164168
.post-list {
165169
list-style: none;
170+
padding-left: 0;
166171
}
167172

168173
.post-list li {
169-
margin-bottom: 2.5rem;
174+
margin-bottom: 2rem;
175+
}
176+
177+
.post-header {
178+
display: flex;
179+
justify-content: space-between;
180+
align-items: baseline;
181+
gap: 1rem;
182+
margin-bottom: 0.3rem;
170183
}
171184

172185
.post-list .post-title {
@@ -185,7 +198,7 @@ a {
185198

186199
.post-meta {
187200
color: var(--muted);
188-
font-size: 0.85rem;
201+
font-size: 0.95rem;
189202
margin-bottom: 0.4rem;
190203
}
191204

@@ -194,9 +207,63 @@ a {
194207
font-size: 0.95rem;
195208
}
196209

197-
.read-more {
210+
211+
/* Breadcrumb + share bar */
212+
.post-nav {
213+
display: flex;
214+
justify-content: space-between;
215+
align-items: center;
198216
font-size: 0.85rem;
199-
margin-left: 0.5rem;
217+
margin-bottom: 0.75rem;
218+
}
219+
220+
.breadcrumb {
221+
display: flex;
222+
align-items: center;
223+
gap: 0.4rem;
224+
color: var(--muted);
225+
min-width: 0;
226+
}
227+
228+
.breadcrumb a {
229+
color: var(--muted);
230+
text-decoration: none;
231+
flex-shrink: 0;
232+
}
233+
234+
.breadcrumb a:hover {
235+
color: var(--accent);
236+
}
237+
238+
.breadcrumb-sep {
239+
flex-shrink: 0;
240+
color: var(--muted);
241+
}
242+
243+
.breadcrumb span:last-child {
244+
min-width: 0;
245+
color: var(--text);
246+
overflow: hidden;
247+
text-overflow: ellipsis;
248+
white-space: nowrap;
249+
}
250+
251+
.share-btn {
252+
background: none;
253+
border: 1px solid var(--border);
254+
color: var(--muted);
255+
font-size: 0.8rem;
256+
padding: 0.15rem 0.6rem;
257+
border-radius: 4px;
258+
cursor: pointer;
259+
white-space: nowrap;
260+
flex-shrink: 0;
261+
margin-left: 1rem;
262+
}
263+
264+
.share-btn:hover {
265+
color: var(--accent);
266+
border-color: var(--accent);
200267
}
201268

202269
/* Single post */

0 commit comments

Comments
 (0)