Add some tooling to help with writing microblogs

This commit is contained in:
R Tyler Croy 2021-02-17 22:48:24 -08:00
parent 50b8bf5221
commit 889453db68
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
6 changed files with 44 additions and 20 deletions

View File

@ -4,31 +4,31 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
concurrent-ruby (1.1.8)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.13.1)
ffi (1.14.2)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
jekyll (4.1.1)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
terminal-table (~> 2.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
@ -45,28 +45,26 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
listen (3.4.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
multi_json (1.15.0)
nuggets (1.6.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
pygments.rb (1.2.1)
multi_json (>= 1.0.0)
rake (13.0.1)
pygments.rb (2.1.0)
rake (13.0.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdiscount (2.2.0.2)
rexml (3.2.4)
rouge (3.24.0)
rouge (3.26.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)

View File

@ -15,4 +15,7 @@ publish: tags
find files -iname "*.png" -type f -exec pngcrush -ow -noforce -reduce {} \;
jekyll build
.PHONY: all drafts tags publish
.PHONY: all drafts tags publish microblog
microblog:
_scripts/new-microblog && git add _microblog tweets && git commit --no-gpg-sign

View File

@ -12,11 +12,10 @@ plugins:
- jekyll-include-cache
- jekyll-seo-tag
gopher:
feed: false
tags: true
gophermap: _gopher/index.gph
base_path: /blog
collections:
microblog:
output: true
permalink: microblog/:year/:month/:title/
lsi: false
exclude:

20
_scripts/new-microblog Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -xo
DATE_DIR=$(date +%Y/%m/%d)
POST_TITLE=$(openssl rand 100000 | shasum | cut -c1-8)
POST_DATE=$(date +%Y-%m-%d)
POST_TIME=$(date +%Y-%m-%d\ %T\ %z)
TWEET_FILE=tweets/${DATE_DIR}/${POST_TITLE}.tweet
POST_FILE=_microblog/${DATE_DIR}/${POST_TITLE}.md
MICROBLOG_TEMPLATE=_templates/microblog
mkdir -p tweets/${DATE_DIR}
mkdir -p _microblog/${DATE_DIR}
vim ${TWEET_FILE}
cat ${MICROBLOG_TEMPLATE} | \
sed "s/%CURRENT_DATE%/${POST_TIME}/g" | \
sed "s/%POST_TITLE%/${POST_TITLE}/g" > ${POST_FILE} && cat ${TWEET_FILE} >> ${POST_FILE}

5
_templates/microblog Normal file
View File

@ -0,0 +1,5 @@
---
layout: microblog
date: %CURRENT_DATE%
title: %POST_TITLE%
---

View File

@ -1 +0,0 @@
This is a test