2022-11-07 11:26:50 +00:00
. \" Automatically generated from an mdoc input file. Do not edit.
2022-11-07 11:54:33 +00:00
. \" Use mandoc -T man ./bb.1.mdoc > bb.1.man to conver to the old
. \" (but still actively encouraged) Linux "an" format.
2022-11-07 11:26:50 +00:00
.TH "BB" "1" "November 7, 2022" "Linux 3.10.0-1160.76.1.el7.x86_64" "General Commands Manual"
.nh
.if n .ad l
.SH "NAME"
\fB bb\fR
\- A single bash script to create blogs
.SH "SYNOPSYS"
\fB bb\fR
\fB post\fR
[\fB \- html\fR ]
[\fI filename\fR ]
.PP
\fB bb\fR
\fB edit\fR
[\fB \- n\fR
2022-11-06 19:35:19 +00:00
|
2022-11-07 11:26:50 +00:00
\fB \- f\fR ]
\fI filename\fR
.PP
\fB bb\fR
\fB delete\fR
\fI filename\fR
.PP
\fB bb\fR
\fB rebuild|reset|list\fR
.PP
\fB bb\fR
\fB tags\fR
[\fB \- n\fR ]
.SH "DESCRIPTION"
2022-11-06 19:35:19 +00:00
When invoked without arguments or with invalid arguments,
2022-11-07 11:26:50 +00:00
\fB bb\fR
2022-11-06 19:35:19 +00:00
will print usage. Before you go any further, you may want to check the CONFIGURATION section.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB post\fR
2022-11-06 19:35:19 +00:00
will open your
2022-11-07 11:26:50 +00:00
\fR $EDITOR\fR
2022-11-06 19:35:19 +00:00
to author a new post in markdown. if available, else in html directly. Use
2022-11-07 11:26:50 +00:00
\fB bb\fR
\fB post\fR
\fB \- html\fR
2022-11-06 20:07:43 +00:00
to start a new post using HTML even when markdown is available. After you
2022-11-07 11:22:57 +00:00
save and exit your editor, you will be asked if you want to post
2022-11-07 11:54:33 +00:00
(\(la p\(ra ),
2022-11-07 11:22:57 +00:00
edit
2022-11-07 11:54:33 +00:00
(\(la E\(ra )
2022-11-07 11:22:57 +00:00
or keep this for later as a draft
2022-11-07 11:54:33 +00:00
(\(la d\(ra ).
2022-11-06 19:35:19 +00:00
Posts will be served at
2022-11-07 11:54:33 +00:00
\fB https://tilde.club/~you/blog/\fR
2022-11-06 19:35:19 +00:00
Specifying a
2022-11-07 11:26:50 +00:00
\fI filename\fR
2022-11-06 19:35:19 +00:00
will pre-load the editor with the contents of that file.
2022-11-07 11:26:50 +00:00
\fI filename\fR
2022-11-06 19:35:19 +00:00
is relative to
2022-11-07 11:26:50 +00:00
\fI ~/public_html/blog/.\fR
.PP
\fB bb\fR
\fB edit\fR
\fI filename\fR
2022-11-06 19:35:19 +00:00
allows you to edit an already published .html or .md file.
2022-11-07 11:26:50 +00:00
\fI filename\fR
is relative to
\fR ~/public_html/blog\fR
2022-11-06 19:35:19 +00:00
and can be either the .md or .html.
2022-11-07 11:26:50 +00:00
\fB Never\fR
2022-11-06 19:35:19 +00:00
manually edit a published .html file, always use this function as it
keeps internal data and rebuilds the blog.
Use
2022-11-07 11:26:50 +00:00
\fB \- n\fR
2022-11-06 19:35:19 +00:00
to give the file a new name, if the title is changed.
Use
2022-11-07 11:26:50 +00:00
\fB \- f\fR
2022-11-06 19:35:19 +00:00
to edit the full html.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB delete\fR
\fI filename\fR
2022-11-06 19:35:19 +00:00
will delete a post and rebuild the blog.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB rebuild\fR
2022-11-06 19:35:19 +00:00
regenerates all pages and posts, preserving the content of the entries.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB reset\fR
2022-11-06 19:35:19 +00:00
deletes everything. Use with caution and
2022-11-07 11:26:50 +00:00
\fI backup everything\fR
2022-11-06 19:35:19 +00:00
first.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB list\fR
2022-11-06 19:35:19 +00:00
lists all posts.
2022-11-07 11:26:50 +00:00
.PP
\fB bb\fR
\fB tags\fR
2022-11-06 19:35:19 +00:00
lists all tags in alphabetical order.
2022-11-07 11:26:50 +00:00
\fB \- n\fR
2022-11-06 19:35:19 +00:00
sorts by number of posts under each tag.
2022-11-07 11:26:50 +00:00
.SH "ENVIRONMENT"
2022-11-06 19:35:19 +00:00
The following environment variables are used by
2022-11-07 11:26:50 +00:00
\fB bb\fR
2022-11-06 19:35:19 +00:00
:
2022-11-07 11:26:50 +00:00
.TP 9 n
\fR EDITOR\fR
2022-11-06 19:35:19 +00:00
Tell
2022-11-07 11:26:50 +00:00
\fB bb\fR
2022-11-06 19:35:19 +00:00
which editor you want to use to edit your posts.
2022-11-07 11:26:50 +00:00
.SH "FILES"
.TP 20 n
\fI ~/public_html/blog\fR
2022-11-06 19:35:19 +00:00
The default path for your production blog folder. Make sure to create this,
otherwise you will see strange behaviour.
2022-11-07 11:26:50 +00:00
\fI All paths are relative to this directory.\fR
.TP 20 n
\fI .config\fR
2022-11-06 19:35:19 +00:00
Configuration file overriding the global defaults.
2022-11-07 11:26:50 +00:00
.TP 20 n
\fI drafts/\fR
2022-11-06 20:07:43 +00:00
Folder where you drafts are saved if you choose the
2022-11-07 11:26:50 +00:00
\(oq d\(cq
2022-11-06 20:07:43 +00:00
option after exiting your
2022-11-07 11:26:50 +00:00
\fR EDITOR\fR .
.TP 20 n
\fI .backup.tar.gz\fR
2022-11-06 19:35:19 +00:00
Backup from before you did something silly.
2022-11-07 11:26:50 +00:00
.TP 20 n
\fI .yesterday.tar.gz\fR
2022-11-06 19:35:19 +00:00
A backup from yesterday in case
2022-11-07 11:26:50 +00:00
\fI .backup.tar.gz\fR
2022-11-06 19:35:19 +00:00
already includes the silly mistake.
2022-11-07 11:26:50 +00:00
.SH "CONFIGURATION"
2022-11-06 19:35:19 +00:00
Global defaults are kept within the
2022-11-07 11:26:50 +00:00
\fB bb\fR
2022-11-06 19:35:19 +00:00
sh script itself, in the
2022-11-07 11:26:50 +00:00
\fB global_variables\fR ()
2022-11-06 19:35:19 +00:00
function.
2022-11-07 11:26:50 +00:00
.PP
2022-11-06 19:35:19 +00:00
You can create
2022-11-07 11:26:50 +00:00
\fI ~/public_html/blog/.config\fR
which allows you to set
\fB bash\fR
2022-11-06 19:35:19 +00:00
variables which override the global defaults.
2022-11-07 11:26:50 +00:00
\fI Note,\fR
2022-11-06 19:35:19 +00:00
this is a bash script, so the format is
2022-11-07 11:26:50 +00:00
.RS 6 n
var="value"
.RE
2022-11-06 20:07:43 +00:00
Please do not try to get fancy.
2022-11-07 11:26:50 +00:00
.SS "General Blog Settings"
.TP 24 n
global_title
2022-11-06 19:35:19 +00:00
Blog title
2022-11-07 11:26:50 +00:00
.TP 24 n
global_description
2022-11-06 19:35:19 +00:00
The typical subtitle for each blog.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_url
2022-11-06 20:07:43 +00:00
The public base URL for this blog.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_author
2022-11-06 20:07:43 +00:00
Your name
2022-11-07 11:26:50 +00:00
.TP 24 n
global_author_url
2022-11-06 20:07:43 +00:00
You can use your tildehome, Twitter, Facebook, etc. as your
2022-11-07 11:26:50 +00:00
\(oq global_author_url\(cq
.TP 24 n
global_email
2022-11-06 20:07:43 +00:00
Your email address.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_license
2022-11-06 20:07:43 +00:00
CC by-nc-nd is a good starting point, but you can pick a different license. You can change this to
2022-11-07 11:26:50 +00:00
\(oq ©\(cq
2022-11-06 20:07:43 +00:00
for Copyright.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_feedburner
2022-11-07 11:22:57 +00:00
Set to empty
2022-11-07 11:26:50 +00:00
(\(oq \(cq )
2022-11-07 11:22:57 +00:00
if you don't use feedburner, otherwise point it to your URL.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_twitter_username
.br
2022-11-06 20:07:43 +00:00
Set this to your username if you want to use Twitter for comments.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_twitter_cookieless
2022-11-06 20:07:43 +00:00
Set this to
2022-11-07 11:26:50 +00:00
\(oq false\(cq
2022-11-07 11:22:57 +00:00
for a Twitter button with a share count. The cookieless version is just a link. This is to comply to EU GDPR regulations.
2022-11-07 11:26:50 +00:00
.TP 24 n
global_twitter_search
2022-11-06 20:07:43 +00:00
Default search page, where tweets more than a week old are hidden.
2022-11-07 11:26:50 +00:00
.SS "Blog Generated Files Settings"
.TP 24 n
index_file
2022-11-06 20:07:43 +00:00
The index page of the blog. Probably a good idea to stick with
2022-11-07 11:26:50 +00:00
\(oq index.html\(cq
.TP 24 n
number_of_index_articles
2022-11-06 20:07:43 +00:00
How many posts to show on the index page.
2022-11-07 11:26:50 +00:00
.TP 24 n
archive_index
Page name of your
\(lq all posts\(rq
2022-11-06 20:07:43 +00:00
page.
2022-11-07 11:26:50 +00:00
.TP 24 n
tags_index
2022-11-06 20:07:43 +00:00
Page name of your
2022-11-07 11:26:50 +00:00
\(lq all tags\(rq
2022-11-06 20:07:43 +00:00
page.
2022-11-07 11:26:50 +00:00
.TP 24 n
gophermap
2022-11-06 20:07:43 +00:00
Ignore gophermap?
2022-11-07 11:26:50 +00:00
.TP 24 n
non_blogpost_files
A bash array of files that
\fB bb\fR
2022-11-06 20:07:43 +00:00
will ignore. Useful for static resources. E.g.
2022-11-07 11:26:50 +00:00
.RS 30 n
.RE
.RS 24 n
2022-11-06 20:07:43 +00:00
non_blogpost_files=("news.html" "test.html")
2022-11-07 11:26:50 +00:00
.RE
.TP 24 n
blog_feed
2022-11-06 20:07:43 +00:00
RSS feed file name.
2022-11-07 11:26:50 +00:00
.TP 24 n
number_of_feed_articles
.br
2022-11-06 20:07:43 +00:00
How many posts to put in the RSS feed.
2022-11-07 11:26:50 +00:00
.TP 24 n
cut_do
\(lq cut\(rq
2022-11-06 20:07:43 +00:00
blog entry when putting it to index page. Leave blank for full
2022-11-07 11:26:50 +00:00
articles in front page, i.e. include only up to first
\(oq <hr>\(cq
or
\(oq ----\(cq
2022-11-06 20:07:43 +00:00
in markdown.
2022-11-07 11:26:50 +00:00
.TP 24 n
cut_tags
When cutting, cut also tags? If
\(oq no\(cq
, tags will appear in index page for cut articles. If
\(oq yes\(cq ,
2022-11-07 11:22:57 +00:00
they won't.
2022-11-07 11:26:50 +00:00
.TP 24 n
cut_line
regex(7)
2022-11-07 11:22:57 +00:00
matching the HTML line where to do the cut.
2022-11-07 11:26:50 +00:00
\fI Note\fR
2022-11-07 11:22:57 +00:00
that the slash is regexp separator so you need to prepend it with backslash
2022-11-07 11:26:50 +00:00
(\(oq \e \(cq ).
.TP 24 n
save_markdown
If
\(oq yes\(cq ,
2022-11-07 11:22:57 +00:00
save markdown file when posting with
2022-11-07 11:26:50 +00:00
\(oq bb post\(cq
2022-11-07 11:22:57 +00:00
(and markdown is available).
2022-11-07 11:26:50 +00:00
.TP 24 n
prefix_tags
2022-11-07 11:22:57 +00:00
Prefix for tags/categories files. Please make sure no other html file starts with this prefix.
2022-11-07 11:26:50 +00:00
.TP 24 n
header_file
.TP 24 n
footer_file
2022-11-07 11:22:57 +00:00
Personalized header and footer (only if you know what you're doing).
2022-11-07 11:26:50 +00:00
\fI DO NOT\fR
2022-11-07 11:22:57 +00:00
name them
2022-11-07 11:26:50 +00:00
\(oq .header.html\(cq ,\(oq .footer.html\(cq
2022-11-07 11:22:57 +00:00
or they will be overwritten. Leave blank
("")
to generate them, which is recommended.
2022-11-07 11:26:50 +00:00
.TP 24 n
body_begin_file
2022-11-07 11:22:57 +00:00
Extra content to add just before we open the
2022-11-07 11:26:50 +00:00
\(oq <body>\(cq
2022-11-07 11:22:57 +00:00
tag and before the actual blog content.
2022-11-07 11:26:50 +00:00
.TP 24 n
body_end_file
2022-11-07 11:22:57 +00:00
Extra content to add just before we close
2022-11-07 11:26:50 +00:00
\(oq <body>\(cq
2022-11-07 11:22:57 +00:00
tag (just before
2022-11-07 11:26:50 +00:00
\(oq </body>\(cq ).
.TP 24 n
css_include
2022-11-07 11:22:57 +00:00
CSS files to include on every page, e.g.
2022-11-07 11:26:50 +00:00
.RS 30 n
css_include=('main.css' 'blog.css')
.RE
.RS 24 n
2022-11-07 11:22:57 +00:00
Leave blank ("") to use the generated ones.
2022-11-07 11:26:50 +00:00
.RE
.TP 24 n
html_exclude
2022-11-07 11:22:57 +00:00
HTML files to exclude from index, e.g.
2022-11-07 11:26:50 +00:00
.RS 30 n
html_exclude=('imprint.html' 'aboutme.html')
.RE
.SS "Localization and Internationalization"
.TP 24 n
template_comments
\(lq Comments?\(rq
2022-11-07 11:22:57 +00:00
(used in twitter link after every post).
2022-11-07 11:26:50 +00:00
.TP 24 n
template_read_more
\(lq Read more...\(rq
2022-11-07 11:22:57 +00:00
(link under cut article on index page).
2022-11-07 11:26:50 +00:00
.TP 24 n
template_archive
\(lq View more posts\(rq
2022-11-07 11:22:57 +00:00
(used on bottom of index page as link to archive).
2022-11-07 11:26:50 +00:00
.TP 24 n
template_archive_title
\(lq All posts\(rq
2022-11-07 11:22:57 +00:00
(title of archive page).
2022-11-07 11:26:50 +00:00
.TP 24 n
template_tags_title
\(lq All tags\(rq
.TP 24 n
template_tags_posts
\(lq posts\(rq
2022-11-07 11:22:57 +00:00
(on
2022-11-07 11:26:50 +00:00
\(lq All tags\(rq
2022-11-07 11:22:57 +00:00
page, text at the end of each tag line, like
2022-11-07 11:26:50 +00:00
\(lq 2.Music-15posts\(rq )
.TP 24 n
template_tags_posts_2_4
.br
2022-11-07 11:22:57 +00:00
Some slavic languages use a different plural form for 2-4 items.
2022-11-07 11:26:50 +00:00
.TP 24 n
template_tags_posts_singular
2022-11-07 11:22:57 +00:00
Word to use for one post.
2022-11-07 11:26:50 +00:00
.TP 24 n
template_tag_title
\(lq Posts tagged\(rq
2022-11-07 11:22:57 +00:00
(text on a title of a page with index of one tag, like
2022-11-07 11:26:50 +00:00
\(lq My Blog - Posts tagged \(oq Music\(cq \(rq )
.TP 24 n
template_tags_line_header
\(lq Tags:\(rq
2022-11-07 11:22:57 +00:00
(beginning of line in HTML file with list of all tags for this article)
2022-11-07 11:26:50 +00:00
.TP 24 n
template_archive_index_page
\(lq Back to the index page\(rq
2022-11-07 11:22:57 +00:00
(used on archive page, it is link to blog index)
2022-11-07 11:26:50 +00:00
.TP 24 n
template_subscribe
\(lq Subscribe\(rq
2022-11-07 11:22:57 +00:00
(used on bottom of index page, it is link to RSS feed)
2022-11-07 11:26:50 +00:00
.TP 24 n
template_subscribe_browser_button
\(lq Subscribe to this page...\(rq
2022-11-07 11:22:57 +00:00
(used as text for browser feed button that is embedded to html)
2022-11-07 11:26:50 +00:00
.TP 24 n
template_twitter_button
.br
\(lq Tweet\(rq
2022-11-07 11:22:57 +00:00
(used as twitter text button for posting to twitter)
2022-11-07 11:26:50 +00:00
.TP 24 n
template_twitter_comment
2022-11-07 11:22:57 +00:00
Default comment used to prepopulate the form.
2022-11-07 11:26:50 +00:00
.TP 24 n
date_format
strftime(3)
2022-11-07 11:22:57 +00:00
format to use for dates.
2022-11-07 11:26:50 +00:00
.TP 24 n
date_locale
locale(1)
2022-11-07 11:22:57 +00:00
to use for dates.
2022-11-07 11:26:50 +00:00
.TP 24 n
date_inpost
\(oq bashblog_timestamp\(cq
.TP 24 n
convert_filename
2022-11-07 11:22:57 +00:00
Perform the post title -> filename conversion. Experts only. You may need to tune the locales too. Set to empty ("") for no conversion, which is not recommended. The default filter respects backwards compatibility.
2022-11-07 11:26:50 +00:00
.TP 24 n
preview_url
2022-11-07 11:22:57 +00:00
URL where you can view the post while it's being edited. By default, it is
2022-11-07 12:01:13 +00:00
\(oq global_url\(cq \& .
2022-11-07 11:22:57 +00:00
You can change it to the path on your computer, if you write posts locally, before copying them to the server.
2022-11-07 11:26:50 +00:00
.SH "EXAMPLES"
2022-11-07 11:54:33 +00:00
Post a markdown file:
.RS 6 n
bb post ~/my_new_post.md
.RE
then hit
2022-11-07 12:01:13 +00:00
\(la p\(ra \& .
2022-11-07 11:54:33 +00:00
.PP
Continue editing a draft:
.RS 6 n
bb post drafts/the-title-I-was-thinking-of.md
.RE
2022-11-07 11:26:50 +00:00
.SH "SEE ALSO"
2022-11-07 11:54:33 +00:00
bash(1),
for a reference on variable assignments.
2022-11-07 11:26:50 +00:00
.SH "AUTHORS"
cfenollosa \(la \fI https://github.com/cfenollosa\fR \(ra
.PP
man page by Vlad Me\[ u0219]co \(la \fI alzwded@tilde.club\fR \(ra
2022-11-07 11:54:33 +00:00
.SH "CAVEATS"
The tilde.club version imposes that the
\fI blog\fR
root directory is
\fI ~/public_html/blog\fR ,
and it will
cd(1)
to that directory before doing anything else. This makes all
\fI paths\fR
be relative to that directory.
.PP
As a side effect, if the
\fI ~/public_html/blog/\fR
directory does not exist,
\fB bb\fR
will get confused and dump files where you don't expect them. Make sure
you create that path before running
\fB bb\fR :
.RS 6 n
mkdir -p ~/public_html/blog/
.RE
.PP
Post file names might get de-unicoded, so if
\fB bb\fR
complains it couldn't find your file, use
find(1)
or
grep(1)
in
\fI ~/public_html/blog/\fR
to find them.