-
Notifications
You must be signed in to change notification settings - Fork 230
How to set a personalized header or body on each page
Carlos Fenollosa edited this page Jan 3, 2017
·
1 revision
Bashblog sets a standard header to every html page. You can customize it to add <meta>
tags, custom css, etc, as follows:
- Create a file named (for example)
.header.template
in your blog folder - 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!
- Add any custom items, like
<meta>
tags and such - Point your
.config
file to this new header, by adding the lineheader_file=".header.template"
- Run
bb.sh rebuild
if necessary
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.