logseq-to-org-roam/add_title

10 lines
172 B
Text
Raw Normal View History

2024-04-20 09:49:30 +00:00
#!/bin/bash
graphdir=$1
pagepath=$(sed 's/^\///' <<<"${2#"$graphdir"}")
title=${pagepath%.org}
echo "#+title: $title" > "$2".temp
cat "$2" >> "$2".temp
mv "$2".temp "$2"