Move zet
This commit is contained in:
parent
247ff913b3
commit
b96f5b114c
60 changed files with 0 additions and 0 deletions
45
old/zet/run.local
Executable file
45
old/zet/run.local
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
function clean {
|
||||
rm -fr output_*
|
||||
}
|
||||
|
||||
# Create a new note.
|
||||
function new {
|
||||
if [[ "$1" == "" ]]; then
|
||||
echo "Usage: ./run new <title>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
title="$1"
|
||||
zet_path="source/_zets"
|
||||
zet_count=$(find "$zet_path" -type f | wc -l)
|
||||
next_zet=$((zet_count + 1))
|
||||
next_zet_path="$zet_path/$next_zet.md"
|
||||
date=$(date +"%Y-%m-%d %T")
|
||||
|
||||
{
|
||||
echo "---"
|
||||
echo "title: ${title}"
|
||||
echo "date: ${date}"
|
||||
echo "tags: []"
|
||||
echo "---"
|
||||
echo ""
|
||||
} > "$next_zet_path"
|
||||
|
||||
git add "$next_zet_path"
|
||||
git commit -m "$title"
|
||||
}
|
||||
|
||||
# Generate and publish a new version of the website.
|
||||
function publish {
|
||||
git push
|
||||
|
||||
clean
|
||||
APP_ENV=production generate
|
||||
rsync -avz output_prod/ ssh.oliverdavies.uk:/var/www/vhosts/zet.oliverdavies.uk
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue