summaryrefslogtreecommitdiffstats
path: root/gen.sh
diff options
context:
space:
mode:
authorTyler Davis <tyler@gluecode.net>2025-02-12 19:47:14 +0000
committerTyler Davis <tyler@gluecode.net>2025-02-12 19:50:38 +0000
commit2acbb0cdb6e4ecf3cf38fcec208c1434737f14ae (patch)
treeafdc0df3e2bd0aee01dece145525438f25f61669 /gen.sh
parent457d3721724877d4eb9c6936b5d7556007f92353 (diff)
downloadjournal-2acbb0cdb6e4ecf3cf38fcec208c1434737f14ae.tar.gz
journal-2acbb0cdb6e4ecf3cf38fcec208c1434737f14ae.zip
Move posts to subdir, update gen.sh
Diffstat (limited to 'gen.sh')
-rwxr-xr-xgen.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/gen.sh b/gen.sh
index c7b015d..c0d2f12 100755
--- a/gen.sh
+++ b/gen.sh
@@ -86,10 +86,12 @@ if [ ! -d "${OUTDIR}" ]; then mkdir ${OUTDIR} ; fi
MDLIST=$(eval "find ${WORKDIR} -type f -name \"*.md\" ")
for m in $MDLIST; do
- # shortpath trims the working directory prefix and the '.git' suffix from the directory
+ # shortpath trims the working directory prefix
shortpath=$(eval "echo $m | sed -e 's,${WORKDIR}/,,' ")
- dirpath=$(eval "echo $m | sed -e 's,${WORKDIR}/,,' -e 's,/.*.md$,,' ")
- filename=$(eval "echo $m | sed -e 's,${WORKDIR}/,,' -e 's,${dirpath}/,,' -e 's,\.md,,' ")
+
+ BNAME=$(eval "basename $m")
+ dirpath=$(eval "echo $m | sed -e 's,${WORKDIR}/,,' -e 's,${BNAME},,' ")
+ filename=$(eval "echo ${BNAME} | sed -e 's,\.md,,' ")
if [ $verbose -gt 0 ]; then
echo "Processing: ${shortpath}"
fi