add site rebuilder / updater update-fish.fish

This commit is contained in:
exquisitecorp 2024-03-24 22:04:21 -05:00
parent 113ff48031
commit 2a85c8b654
1 changed files with 28 additions and 0 deletions

28
update-site.fish Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env fish
#usage: add-page path/to/file.gmi
function convert_page
#set title via argv
set title (basename $argv .gmi)
echo "Converting $title page"
node geminut ~/public_gemini/$argv ~/public_html/$title.html
end
function convert_indexes
#recreate index, categories pages
echo "Rebuilding index page"
node geminut ~/public_gemini/index.gmi ~/public_html/index.html
echo "Rebuilding categories page"
node geminut ~/public_gemini/categories.gmi ~/public_html/categories.html
end
if test -d $argv
#no argument, so just rebuild index/categories pages
convert_indexes
exit
else
convert_page $argv
convert_indexes
end