-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_note.sh
More file actions
executable file
·63 lines (43 loc) · 1005 Bytes
/
create_note.sh
File metadata and controls
executable file
·63 lines (43 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#
# Time-stamp: <Friday 2025-02-28 15:55:02 Jess Moore>
#
# Create a jekyll website blog note markdown file
# with some template text
#
# Usage: bash create_note.sh install-openhab "How to install OpenHAB"
NAME=`id -F`
# Datetime of now in jekyll blog post format
NOW=`date "+%Y-%m-%d %H:%M:%S %z"`
# Abbreviated title
FILEPARTNAME=$1
# Blog post title
TITLE=$2
# Date for post filename
NOW_DATE_ONLY=`date "+%Y-%m-%d"`
FILENAME=${NOW_DATE_ONLY}-${FILEPARTNAME}.md
cat > ${FILENAME} << EOF
---
layout: post
title: "${TITLE}"
date: ${NOW}
published: false
toc: true
---
Short 1-2 sentence introduction.
**Summary**
1. [command] - 1 line explanation
2. [command] - 1 line explanation
## Procedure
### Sub heading 1
Text.
See [other post]({% post_url 2021-03-02-how-to-setup-jekyll %}) for how to do xyz.
[command block]
### Sub heading 2
Text.
[command block]
**References**
- [url1]
- [url2]
EOF
echo "Successfully created note type post ${FILENAME} with template text."