the ~karx journals

various musings of ~karx

Make bashblog look the way you want it!

February 06, 2021 — ~karx

bashblog, in its default configuration, looks okay. but usually, it doesn’t fit with the style of the rest of your site. so how did i get it to do that? that’s what i’m going to show you today.

the first thing to do is to take a look at your .config file in the blog directory. it should look something like this:

global_title="my tildelog"
global_description="a blog about tildes"

this config is the file that configures bashblog. all the options are pretty clear as to what they do. now, we will make a head template. make a new file called .header.template. it should look like this:

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <meta name="theme-color" content="#00cc00">


        <!-- Replace with whatever CSS you want to add -->
        <link rel="stylesheet" href="https://tilde.team/css/hacker.css">
        <link rel="stylesheet" href="card.css"> 

        <link rel="alternate" type="application/rss+xml" title="subscribe to this page..." href="feed.rss" />

notice that we didn’t close the <head> tag. now, add this line to your config:

header_file=".header.template"

now we will make a before and after body template. this is used for wrapping the content in some sort of container or card, like i did in this blog. make a file called .beforebody and add something like this:

<div class="container">
    <div class="card">
        <div class="card-body">

be sure not to close these divs unless you’re sure what you’re doing. next, make a file called .afterbody and use it to close out all the divs.

        </div>
    </div>
</div>

once you have added these files, add these lines to your config:

body_begin_file=".beforebody"
body_end_file=".afterbody"

your completed config file should now look like this:

global_title="my tildelog"
global_description="a blog about tildes"
header_file=".header.template"
body_begin_file=".beforebody"
body_end_file=".afterbody"

now all that’s left to do is to run bb rebuild and feast your eyes on your new, beautiful blog!

tags: bashblog, html, css