Copies and modifies markdown notes to publish to a GoHugo static site.
- Create folder
~/.local/bin
:
mkdir ~/.local/bin
- Add
mudpub
file to~/.local/bin
with contents:#!/usr/bin/env bash source /home/username/path/to/mudpub/venv/bin/activate /usr/bin/env python3 /home/username/path/to/mudpub/mudpub.py
- Change
mudpub
permissions:
chmod u+x mudpub
- Add
~/.local/bin
toPATH
in~/.profile
:# set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi
- All external links should be qualified with the protocol
https://
orhttp://
- Only markdown files from the specified directory will be published (no subfolders)
- Attachments will be sourced from markdown directory, or a specified attachments sub directory
- All attachments are published to an attachments directory in Hugo's root content folder
- Selective publishing does not yet work for attachments
- Written to run on POSIX systems
- Publishes to Hugo's content folder only (at present)
Pages will be published only of they have valid YAML front-matter and configured with publish: yes
. This results in
some local links leading nowhere (i.e. the referenced page isn't published). Links to such pages are deactivated prior
to publishing and look like this: old link text*
- Remove invalid local links
- Publish attachments
- Output exceptions
- Only allow alpha chars and spaces in publish names
- Refactor to run as command line app
- Ensure local links have
.md
suffix - Add deactivated links to parse exceptions
- Add logging throughout
- Handle errors cleanly
- Refactor OO code
- Build tests
- Enable selective attachment publishing
- Index publish target directory (
path.walk
, notlistdir
) - Ensure links to previously published sub-folder pages are not deactivated/cleansed
- Automate git staging
- Add formatted git diffs to Chronolog
- Accommodate sub-folder publish targets