====== bashblog ====== A complete blog engine in one ~1,000-line bash script: [[https://github.com/cfenollosa/bashblog|cfenollosa/bashblog]]. Zero dependencies beyond coreutils. The tilde-appropriate blog tool: drop ''bb.sh'' in a public folder and post. ===== Setup ===== mkdir -p ~/blog && cd ~/blog curl -fsSLO https://raw.githubusercontent.com/cfenollosa/bashblog/master/bb.sh chmod +x bb.sh ./bb.sh # shows the command list On a pubnix, put it in ''~/public_html/blog/'' and posts appear at ''host.tld/~you/blog/'' instantly. See [[tilde:publishing|Publishing on a Pubnix]]. ===== Writing a Post ===== ./bb.sh post # opens $EDITOR on a new markdown file Saves as ''Title-Of-Post.html'' and updates index, RSS, and tag pages automatically. ./bb.sh list # all posts ./bb.sh edit post.html # edit (keeps original timestamp) ./bb.sh edit -n post.md # edit the markdown source ./bb.sh rebuild # regenerate everything from sources ./bb.sh delete post.html ./bb.sh preview draft.md # render without publishing Drafts: quit the editor without publishing and the file stays as a draft. ''./bb.sh post draft.md'' finishes it later. ===== Config ===== Create ''.config'' next to ''bb.sh''. It overrides defaults without touching the script: global_software_name="my log" global_author="you" global_url="https://tilde.town/~you/blog" global_email="you@tilde.town" global_description="notes" Full variable list: ''grep '^global_' bb.sh''. Notables: ''global_title'', ''global_date_format'', ''global_posts_per_page'', and ''markdown_bin'' (point it at pandoc: ''markdown_bin="pandoc -f markdown -t html"''). ===== What It Generates ===== * ''index.html'': recent posts * ''all_posts.html'', ''all_tags.html'', per-tag pages * ''blog.rss'': the feed (what tilde.town's planet aggregator wants) * ''bb.css'': replace or symlink your own stylesheet, then ''./bb.sh rebuild'' ===== Limits ===== * No comments engine. That is the point: ''guestbook.txt'' is the tilde-native answer. * Post URLs come from titles. Renaming a title changes the URL. * ''edit'' preserves the page timestamp; ''rebuild'' regenerates pages. ===== See Also ===== * [[indieweb:tiny_ssg|Minimal Static Site Generators]] * [[indieweb:rss_by_hand|RSS by Hand]] * [[indieweb:blogging|Blogging Platforms]] * [[indieweb:start|IndieWeb Index]] * [[start|Return to wiki home]]