summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-12-05 10:11:44 +0800
committerGuangxiong Lin <[email protected]>2022-12-05 10:11:44 +0800
commit2d33970ce5daf2b75bef0959e67f60d94b6d7639 (patch)
tree7aabc3e375f20f67ad48ed32bdda0eafa5310b13
parentf58eb61d80dfc39e4ed33ca0680bd92736d4b452 (diff)
downloadwd-master.tar.gz
wd-master.tar.bz2
wd-master.zip
Support creating yearly notesHEADv0.0.8master
-rwxr-xr-xwd9
1 files changed, 9 insertions, 0 deletions
diff --git a/wd b/wd
index 3da1519..501f601 100755
--- a/wd
+++ b/wd
@@ -51,8 +51,12 @@ cmd_journal () {
local monthly_journal_title="# $(date '+%B %Y')"
local monthly_journal_subtitle="## [Week $week_number $year]($year-week$week_number.md)"
+ local yearly_journal_title="# $(date '+%Y')"
+ local yearly_journal_subtitle="## [$(date '+%B')]($(date '+%Y-%m').md)"
+
local weekly_journal="$WD_JOURNALS_DIR/$year-week$week_number.md"
local monthly_journal="$WD_JOURNALS_DIR/$(date '+%Y-%m').md"
+ local yearly_journal="$WD_JOURNALS_DIR/$(date '+%Y').md"
local file_to_edit="$weekly_journal"
local file_title="$weekly_journal_title"
@@ -64,6 +68,11 @@ cmd_journal () {
file_title="$monthly_journal_title"
file_subtitle="$monthly_journal_subtitle"
;;
+ --yearly|-y) shift;
+ file_to_edit="$yearly_journal"
+ file_title="$yearly_journal_title"
+ file_subtitle="$yearly_journal_subtitle"
+ ;;
esac
[ ! -f "$file_to_edit" ] && echo "$file_title" > "$file_to_edit"