How masasam/emacs-easy-hugo works
Main Components
• Emacs Host
• Emacs core process
• Major-mode package:
– easy-hugo.el (core commands & file‐management logic)
– easy-hugo-transient.el (optional Transient UI)
• External Editors/Modes
• markdown-mode, org-mode, adoc-mode, rst-mode, mmark, web-mode
• Hugo Static-Site Generator (CLI)
• File System
• Hugo project directory (easy-hugo‐basedir)
– content/post (or content/home)
– static/images (easy-hugo-image-directory)
– archetypes/*.md/.org/.ad/.rst/.mmark/.html
– deploy.sh (when used)
• Search Backends
• consult-ripgrep, counsel-ag, helm-ag, the_silver_searcher
• Deployment Services/CLIs
• SSH/rsync (easy-hugo-publish via sshd)
• AWS CLI (amazon-s3)
• Google Cloud SDK (gcloud)
• Firebase CLI (firebase-tools)
• GitHub Pages (deploy.sh or GitHub Actions)
• Magit (Git commits for Netlify)
• Web Browser (Preview & Published Site)
Relationships & Data Flows
• User → Emacs Keybindings/Commands → easy-hugo.el
• easy-hugo.el → File System (create/edit .md/.org/.ad/… files)
• Preview: easy-hugo.el → Hugo CLI (hugo server) → HTTP → Browser
• Search: easy-hugo.el → consult-ripgrep / counsel-ag / helm-ag → results in Emacs buffer
• Publish/Clever: easy-hugo.el → chooses one of (SSH/rsync, AWS CLI, GCloud CLI, Firebase CLI, deploy.sh) → remote server or object storage → Browser (optional)
• Transient UI: easy-hugo-transient.el → wraps commands in pop-up menu → invokes core functions
Architectural Patterns
• Plugin Modularization:
• Core “model” layer = file and Hugo‐CLI interactions
• Controller = command functions bound to keys
• View = Emacs buffers + Transient menus
• Strategy/Provider Pattern for deployment:
• easy-hugo-publish-clever dynamically selects the deployment strategy based on which variables/CLIs are configured
• Extension Points:
• Hooks & user variables (easy-hugo-basedir, easy-hugo-image-directory, easy-hugo-default-ext, etc.)
• Pluggable search backends and markup modes
Technologies & Libraries
• Emacs Lisp & Cask (package metadata)
• transient (optional interactive menus)
• markdown-mode, org-mode, web-mode, AsciiDoc, reStructuredText, mmark
• consult-ripgrep / counsel-ag / helm-ag / the_silver_searcher
• Hugo binary (v0.25+)
• AWS CLI, Google Cloud SDK, Firebase Tools, SSH/Rsync, GitHub Actions, Magit
Detail Without Overthinking
• Post creation
• Preview server management
• Publish & deploy strategies
• Search integration
• Image insertion & upload
• How Transient UI wraps core functions.