add site rebuilder / updater update-fish.fish
This commit is contained in:
parent
113ff48031
commit
2a85c8b654
|
@ -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
|
Loading…
Reference in New Issue