Initial commit: Astro 6 static blog site
All checks were successful
Deploy / deploy (push) Successful in 49s
All checks were successful
Deploy / deploy (push) Successful in 49s
- German (default) and English i18n support - Categories and tags - Blog posts with hero images - Dark/light theme switcher - View Transitions removed to fix reload ghost images - Webmentions integration - RSS feeds per locale Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
commit
5bb63bacf5
95 changed files with 12199 additions and 0 deletions
68
scripts/new-note.sh
Executable file
68
scripts/new-note.sh
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/env bash
|
||||
# Usage: new-note.sh "Note Title" [--mdx]
|
||||
# Creates a new note in the Obsidian vault with correct frontmatter and folder structure.
|
||||
# Use --mdx for notes that need a cover image or custom components (creates .mdx file).
|
||||
set -euo pipefail
|
||||
|
||||
VAULT='/Users/adrian/Obsidian/Web/adrian-altner-com'
|
||||
|
||||
if [[ -z "${1:-}" ]]; then
|
||||
echo "Usage: new-note.sh \"Note Title\" [--mdx]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TITLE="$1"
|
||||
MDX=false
|
||||
if [[ "${2:-}" == "--mdx" ]]; then
|
||||
MDX=true
|
||||
fi
|
||||
|
||||
SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9 -]//g' | sed 's/ \+/-/g' | sed 's/^-\+//;s/-\+$//')
|
||||
DATE_FOLDER=$(date +%Y/%m/%d)
|
||||
PUBLISH_DATE=$(date +%Y-%m-%d)
|
||||
DIR="$VAULT/content/notes/$DATE_FOLDER"
|
||||
|
||||
if $MDX; then
|
||||
EXT="mdx"
|
||||
else
|
||||
EXT="md"
|
||||
fi
|
||||
|
||||
FILE="$DIR/$SLUG.$EXT"
|
||||
|
||||
mkdir -p "$DIR"
|
||||
|
||||
if [[ -f "$FILE" ]]; then
|
||||
echo "File already exists: $FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if $MDX; then
|
||||
cat > "$FILE" << EOF
|
||||
---
|
||||
title: "$TITLE"
|
||||
publishDate: $PUBLISH_DATE
|
||||
description: ""
|
||||
cover: "./$SLUG.jpg"
|
||||
coverAlt: ""
|
||||
tags:
|
||||
-
|
||||
draft: false
|
||||
syndication:
|
||||
---
|
||||
EOF
|
||||
else
|
||||
cat > "$FILE" << EOF
|
||||
---
|
||||
title: "$TITLE"
|
||||
publishDate: $PUBLISH_DATE
|
||||
description: ""
|
||||
tags:
|
||||
-
|
||||
draft: false
|
||||
syndication:
|
||||
---
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo "Created: $FILE"
|
||||
Loading…
Add table
Add a link
Reference in a new issue