Improvements to site compiler
This commit is contained in:
parent
30e37785ed
commit
4d3bde3d9d
|
@ -17,6 +17,7 @@ OUTPUT_DIR=~/public_html
|
|||
|
||||
pushd ~
|
||||
|
||||
# Recursively iterate over directories, calling process_file on .md files
|
||||
traverse_dir() {
|
||||
local dir=$1
|
||||
for d in $dir; do
|
||||
|
@ -26,13 +27,40 @@ traverse_dir() {
|
|||
traverse_dir "$d/*"
|
||||
elif [[ $d == *.md ]]; then
|
||||
OUTPUT=${OUTPUT%.md}.html
|
||||
OUTPUT=${OUTPUT// /_}
|
||||
echo $OUTPUT
|
||||
pandoc -f markdown -t html -o $OUTPUT "$d"
|
||||
#OUTPUT=${OUTPUT// /_}
|
||||
process_file "$d" "$OUTPUT"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Take a Markdown file and process it to HTML
|
||||
process_file() {
|
||||
local INPUT=$1
|
||||
local OUTPUT=$2
|
||||
local TITLE=${INPUT%.md}
|
||||
TITLE=${TITLE##*/}
|
||||
if [ "$TITLE" == 'index' ]; then
|
||||
TITLE='Home'
|
||||
fi
|
||||
echo $INPUT
|
||||
echo $OUTPUT
|
||||
pandoc -f markdown -t html -o "$OUTPUT" -i "$INPUT" --standalone --template ~/code/site/template.html --variable=pagetitle:"$TITLE"
|
||||
replace_links "$OUTPUT"
|
||||
}
|
||||
|
||||
# Replace links in Markdown files with working links to the new HTML files
|
||||
replace_links() {
|
||||
local FILE=$1
|
||||
# Add .html extensions
|
||||
# sed -i 's/\(href="\)\([^"]*\)/\1\2.html/g' "$FILE"
|
||||
sed -Ei.bak '/https|\.[a-z]+/!s/href="[^"]*/&.html/' "$FILE"
|
||||
}
|
||||
|
||||
setup_files() {
|
||||
cp ~/code/site/style.css ~/public_html
|
||||
}
|
||||
|
||||
traverse_dir $INPUT_DIR/\*
|
||||
setup_files
|
||||
|
||||
popd
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<meta name="author" content="Trevor Vallender">
|
||||
<meta name="description" content="Personal site of Trevor Vallender, software engineer">
|
||||
<title>index | T S Vallender</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>T S Vallender</h1>
|
||||
<h4>Software Engineer, nerd, maker and dad.</h4>
|
||||
</header>
|
||||
<main>
|
||||
<h2 id="learning-plan"><a href="Learning%20plan">Learning
|
||||
plan</a></h2>
|
||||
<h2 id="foxsoft-todo">Foxsoft Todo</h2>
|
||||
<ul class="incremental" class="task-list">
|
||||
<li><input type="checkbox" disabled="" />Set up devenv on OxEd</li>
|
||||
<li><input type="checkbox" disabled="" />Solve <a
|
||||
href="https://github.com/bobvanderlinden/nixpkgs-ruby/issues/6">SSL
|
||||
issue</a></li>
|
||||
<li><input type="checkbox" disabled="" />Use pgcli</li>
|
||||
<li><input type="checkbox" disabled="" />Create CI command</li>
|
||||
<li><input type="checkbox" disabled="" />SLA Redmine script</li>
|
||||
<li><input type="checkbox" disabled="" />Git changelog script</li>
|
||||
</ul>
|
||||
<h2 id="personal-todo">Personal Todo</h2>
|
||||
<ul class="incremental">
|
||||
<li><input type="checkbox" disabled="" checked="" />Secure email
|
||||
passwords and commit accounts to repo</li>
|
||||
<li><input type="checkbox" disabled="" />Fix issues with aerc (w3m
|
||||
links/images, non-clickable links in kitty)</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Set up tmux
|
||||
pairing nicely</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Set up tmux
|
||||
keybindings</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Move NixOS
|
||||
config to Flakes</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Set up
|
||||
Hyprland</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Solve Neovim
|
||||
vimwiki errors</li>
|
||||
<li><input type="checkbox" disabled="" />Move from gitea to standard
|
||||
git UI</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Fix note
|
||||
sync</li>
|
||||
<li><input type="checkbox" disabled="" />Fix photo sync issues</li>
|
||||
<li><input type="checkbox" disabled="" />Set up separate hosts
|
||||
correctly in Nix config</li>
|
||||
<li><input type="checkbox" disabled="" />Move kernighan to nix</li>
|
||||
<li><input type="checkbox" disabled="" />Fix personal site</li>
|
||||
<li><input type="checkbox" disabled="" />Compile vimwiki notes
|
||||
automatically</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Move
|
||||
HomeAssistant Pi to other case</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Fix
|
||||
HomeAssistant lighting</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Download all
|
||||
audiobooks</li>
|
||||
<li><input type="checkbox" disabled="" />Set up ‘routine’
|
||||
script</li>
|
||||
<li><input type="checkbox" disabled="" />Look into
|
||||
folder-per-branch</li>
|
||||
<li>Finish Hyprland setup</li>
|
||||
<li><input type="checkbox" disabled="" />Wallpaper per-desktop
|
||||
https://github.com/hyprwm/hyprpaper</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Codeium
|
||||
https://github.com/jcdickinson/codeium.nvim/issues/18</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Set up Compose
|
||||
key</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Dunst
|
||||
notifications</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Screenshots</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Persist network
|
||||
connection</li>
|
||||
<li><input type="checkbox" disabled="" checked="" />Try out
|
||||
qutebrowser</li>
|
||||
<li><input type="checkbox" disabled="" />Set up Pass password
|
||||
manager</li>
|
||||
<li><input type="checkbox" disabled="" />Integrate pass with
|
||||
qutebrowser</li>
|
||||
</ul>
|
||||
<h2 id="notes">Notes</h2>
|
||||
<ul class="incremental">
|
||||
<li><a href="Wishlist">Wishlist</a></li>
|
||||
<li><a href="Stop%20branching">Stop branching</a></li>
|
||||
<li><a href="Oxed%20Estimates">OxEd Estimates</a></li>
|
||||
</ul>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue