Skip to content

malcyon/donaldmorton.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

donaldmorton.net

Personal site of Donald Morton, built as three independent sites in one repo, deployed to Cloudflare Pages on separate (sub)domains:

Directory Stack Domain Role
portfolio/ Hugo / Toha donaldmorton.net + www.donaldmorton.net The homepage: splash + resume sections and blog. A Terminal navbar item links to the terminal. (Timeline lives here for now; final home TBD.)
terminal/ Hugo / terminalCV terminal.donaldmorton.net A CLI-styled companion / easter egg. Type startx to launch the desktop.
os/ Vite / React / ProzillaOS os.donaldmorton.net A graphical pseudo-OS desktop (windows, folders, apps), launched by startx.

The portfolio's Terminal menu item (customMenus in portfolio/data/en/site.yaml) opens /terminal.html, which embeds the terminal in an iframe inside the Toha chrome. The terminal's startx command (startxLocation in terminal/config.yml) navigates the top window to the portfolio's /os.html, which embeds the ProzillaOS desktop the same way (a larger window). Both embed pages — layouts/terminal/list.html and layouts/os/list.html — define Toha's navbar/content blocks so the iframe sits on the landing-page background with navbar + footer. The framed sites allow this via frame-ancestors (terminal/static/_headers, os/public/_headers).

Prerequisites

  • Hugo extended ≥ 0.146 (hugo version should say +extended)
  • Go ≥ 1.19 and Node ≥ 16 — required by the Toha portfolio only
  • Clone with submodules (the terminal theme is a submodule):
    git clone --recurse-submodules git@github.com:malcyon/donaldmorton.net.git
    # or after a plain clone:
    git submodule update --init

Local development

The whole site (portfolio + embedded terminal) runs locally with one command:

./dev.sh

This starts all three dev servers — portfolio on http://localhost:1313, terminal on http://localhost:1314, and the ProzillaOS desktop on http://localhost:3000 (Vite) — and stops them all on Ctrl-C. The portfolio's terminal embed (/terminal.html) and the terminal's startx redirect detect hugo server (via hugo.IsServer) and automatically point at these localhost URLs, so no config editing is needed. The first run also installs the portfolio's npm assets and the os/ dependencies if their node_modules are missing.

To run them separately:

Portfolio (Hugo + Go modules + npm):

cd portfolio
hugo mod npm pack      # generate package.json from theme modules
npm install            # populates node_modules (fonts, flags, katex)
hugo server -p 1313

Terminal (just Hugo):

cd terminal
hugo server -p 1314

Editing content

  • Terminal CV / commands: terminal/config.yml
  • Portfolio identity & hero: portfolio/data/en/author.yaml
  • Portfolio resume sections: portfolio/data/en/sections/*.yaml
  • Portfolio images/logos/avatar: portfolio/assets/images/
  • Timeline: portfolio/data/timeline.yaml (rendered by portfolio/layouts/timeline/list.html + assets/css/timeline.css)

Updating themes

# terminalCV (submodule)
git submodule update --remote terminal/themes/terminalcv

# Toha (Hugo module)
cd portfolio && hugo mod get -u github.com/hugo-toha/toha/v4 && hugo mod tidy

Terminal theme overrides

The terminal deliberately keeps as few theme overrides as possible — each file under terminal/layouts/ shadows the same path in the terminalCV submodule, so it silently stops receiving upstream changes. Prefer terminal/config.yml over copying templates. After bumping the submodule (git submodule update --remote terminal/themes/terminalcv), re-check the files below against the new theme version and re-apply the changes.

Currently based on terminalCV v3.8.0. Three overrides (largest first — the order to re-check after a theme bump):

  1. terminal/layouts/index.html — full copy of the theme's index.html (~700 lines) with two changes: the optional source command disabled (paired with source: false in config.yml), and the startx/exit redirects changed from window.location to window.top.location so they break out of the /terminal.html embed iframe (with startx targeting the local portfolio dev server under hugo server). The largest, most fragile override — re-check it first. Re-apply: copy the theme's index.html, remove the source references (the completion list entry, the help-map entry, the var source definition, and the case 'source' handler; keep source: false in config.yml), and in the startx/exit cases change window.location to window.top.location (wrap startx with the hugo.IsServer → http://localhost:1313/ toggle).

  2. terminal/layouts/partials/head.html — copy of the theme's head.html with two changes: (a) all jquery.terminal CDN URLs pinned to a matching 2.45.2 (core, less.min.js, CSS) and jQuery pinned to 3.7.1 — the theme mixes unpinned/@latest URLs with pinned ones, and the version skew breaks the less pager; (b) the autocomplete_menu.js <script> line removed, disabling the live autocomplete dropdown (Tab completion via core jQuery Terminal completion still works). Re-apply: copy the theme's head.html, pin every jquery.terminal/jQuery URL to a single matching version, and delete the autocomplete_menu.js line.

  3. terminal/layouts/posts/single.html — copy of the theme's posts/single.html with one line changed to support a raw: true front-matter flag (shows a post's markdown source verbatim in a <pre>, like a real cat, instead of rendered HTML). This raw flag is ours; the theme has no such concept.

    • theme: {{ .Content }}
    • ours: {{ if .Params.raw }}<pre>{{ .RawContent }}</pre>{{ else }}{{ .Content }}{{ end }}

    Re-apply: copy the theme's posts/single.html and swap that line.

Everything else is configuration, not an override — see terminal/config.yml.

ProzillaOS desktop (os/)

os/ is a standalone Vite + React + TypeScript app built on the prozilla-os library — not a Hugo site. It renders a graphical desktop (windows, taskbar, file explorer, apps) and is what startx opens. Key files:

  • src/components/App.tsx — mounts <ProzillaOS>; set systemName / tagLine here.
  • src/config/appsConfig.ts — which apps appear (add/remove built-ins or custom apps).
  • src/config/skin.ts — wallpaper / theming.

Develop with npm run dev (or ./dev.sh from the repo root, port 3000); build with npm run builddist/. See docs.prozilla.dev for custom apps and seeding the virtual filesystem with folders/files.

Cloudflare Pages

Cloudflare Pages gives each project a single build command, so this repo is deployed as three Pages projects (all connected to this same repo, each with its own "Root directory"):

Project Root directory Build command Output Custom domain
portfolio portfolio npm ci && hugo --minify public donaldmorton.net + www.donaldmorton.net
terminal terminal hugo --minify public terminal.donaldmorton.net
os os npm ci && npm run build dist os.donaldmorton.net

Environment variables:

  • portfolio + terminal: HUGO_VERSION=0.162.1, HUGO_EXTENDED=true
  • portfolio also: GO_VERSION=1.22 (Toha is a Hugo module, fetched via Go at build), NODE_VERSION=18
  • os: Node ≥ 20 (Vite 7 requires it; pinned via os/.node-version)

Notes:

  • The output directory is relative to the root directory (Cloudflare serves terminal/public, portfolio/public, and os/dist).
  • The terminalCV submodule is cloned by Pages automatically.
  • By default all three projects rebuild on every push. To avoid that, set each project's Build watch paths to its own subdir (e.g. terminal/*, portfolio/*, os/*).
  • Fallback if the Pages image's Go ever causes trouble: run cd portfolio && hugo mod vendor, commit _vendor/, and the portfolio builds with no Go dependency (also pins the theme version).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors