Browse Source

helpers

exp-with-scrum
parent
commit
0426e4a03c
Signed by: yogsototh GPG Key ID: 7B19A4C650D59646
  1. 31
      engine/new-post.sh
  2. 7
      src/demo.org

31
engine/new-post.sh

@ -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

7
src/demo.org

@ -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

Loading…
Cancel
Save