1 How to set a personalized header or body on each page
Carlos Fenollosa edited this page 2017-01-03 17:08:01 +01:00

Bashblog sets a standard header to every html page. You can customize it to add <meta> tags, custom css, etc, as follows:

  1. Create a file named (for example) .header.template in your blog folder
  2. Edit it to include the standard header items, which are required to include CSS and more:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css" type="text/css" />
<link rel="stylesheet" href="blog.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="Subscribe to this page..." href="feed.rss" />

Bashblog will append the <title> and </head> automatically, don't include them!

  1. Add any custom items, like <meta> tags and such
  2. Point your .config file to this new header, by adding the line header_file=".header.template"
  3. Run bb.sh rebuild if necessary

How to add custom html content on each page

The process is similar to the above, but you need to point the body_begin_file of your configuration, instead of header_file.

For example, create a .body.template file with some content: <p>This will be displayed on each page</p>

Then, add to your .config file:

body_begin_file=".body.template"

Upon rebuild, all pages will display the message at the beginning.