Skip to content

Commit 95d7ce8

Browse files
committed
I thought there was such a tool in Jekyll
1 parent 9744093 commit 95d7ce8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

crap.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
title="${1}"
5+
filename="$(tr '[:upper:]' '[:lower:]' <<< "${title}" | tr ' ' '-' )"
6+
7+
d="$(date +'%Y-%m-%d')"
8+
dt="$(date +'%Y-%m-%d %H:%M:%S %z')"
9+
10+
cat > "_posts/${d}-${filename}.markdown" << EOF
11+
---
12+
layout: post
13+
title: "${title}"
14+
date: ${dt}
15+
categories:
16+
---
17+
EOF

0 commit comments

Comments
 (0)