This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/create
2023-03-11 12:16:06 -08:00

23 lines
No EOL
318 B
Text
Executable file

#/bin/bash
TITLE=$@
TITLEF=$(echo $TITLE | tr " " "-")
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
mkdir -p "src/posts/$YEAR/$MONTH"
FILENAME="src/posts/$YEAR/$MONTH/$TITLEF.md"
cat <<EOF > $FILENAME
---
title: "$TITLE"
date: "$(date '+%Y-%m-%d')"
tags:
-
---
<!-- excerpt -->
EOF
echo "Created new post at $FILENAME"