This commit is contained in:
Yann Esposito (Yogsototh) 2021-05-26 23:06:17 +02:00
parent 9ce3afee97
commit 0426e4a03c
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
2 changed files with 37 additions and 1 deletions

31
engine/new-post.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env zsh
postsdir=src/posts
title="$*"
scrub=$(echo "$title" | tr '[:upper:]' '[:lower:]' | perl -pe 's/[^a-z0-9_]+/-/g;s/-+$//')
lastnumber () {
for d in "$postsdir"/*; do
number=$(echo "${d:t}" | sed 's/-.*$//')
echo "$number"
done | sort -n | tail -n 1
}
n=$(lastnumber)
newdir=$(printf "%04d-%s" $((n+1)) "$scrub")
dst="$postsdir/$newdir/index.org"
today=$(date +"[%Y-%m-%d %a]")
mkdir "${dst:h}"
cat > "$dst" <<EOF
#+title: $title
#+description:
#+keywords: blog static
#+author: Yann Esposito
#+email: yann@esposito.host
#+date: $today
#+lang: en
#+options: auto-id:t
#+startup: showeverything
EOF

View File

@ -86,8 +86,13 @@ k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J
K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j
k l m n o p q r s t u v w x y z
* \Alpha\rightarrow\Omega
:PROPERTIES:
:CUSTOM_ID: -latex
:END:
Testing https://orgmode.org/manual/Special-Symbols.html#Special-Symbols
\alpha \beta
* Math
:PROPERTIES:
:CUSTOM_ID: math