summaryrefslogtreecommitdiff
path: root/wd
diff options
context:
space:
mode:
Diffstat (limited to 'wd')
-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"