Back to Notenik Docs


Intro to Website Creation using Notenik

2. Add content to your website ↑

2.6. Review the merge template

Here we are going to use the same HTML offered by Blake, but place it in our template file, instead of our content.

Use your trusty text editor to look at the updated merge template file named chapter 02 - page template.html, which you will find within the factory/templates folder.

Here’s what you should see.

<?nextrec?>
<?output "../../web/=$title&f$=.html"?>
<!doctype html>
<html>
  <head>
  	<meta charset="utf-8">
	<title>=$header$=</title>
  </head>
  <body>
    <h1>=$header$=</h1>
    =$body&fo$=
<?copyimages?>
  </body>
</html>
<?loop?>

Notice that the nextrec, output and loop lines are unchanged.

Following the nextrec and output lines you should see HTML tags much like the ones described by Blake.

The =$header$= variable is being used for the web page’s title and for its first heading.

We can still see the =$body$= variable, but now we’ve added a couple of useful variable modifiers with the embedded string &fo. Here the ampersand indicates that one or more variable modifiers will be following, the o requests that the body text be converted from Markdown to HTML, and the f requests that any local image file names be converted to a web-frienldy format, if they are not already formatted in that way.

And then we have the addition of the copyimages command, which will copy any referenced local image files from the content folder to the web folder.

One important thing to remember is that merge commands, such as <?nextrec?> and <?copyimages?>, must always start in the first column of a new line, and be on a line by themselves. Merge variables such as =$body$=, on the other hand, can appear anywhere.

So that’s it for the merge template.


Next: 2.7. Review the script file