Skip to content
David Springate edited this page Jun 3, 2013 · 2 revisions
Set up directories for a new site:

Before you start building pages , you need to build the directory structure of your site. Set site to the full path to your site or relative to the current position (Not using ~, this is important for the markdown renderer later on).

site <- "/home/david/testsite"
Skeleton(site)
To render pages and posts

Pages are R files that are processed through a template file (also an R file). They must be located inside the site/template/pages directory. All page files should have the following variables:

  1. layout The layout file you want the page to be processed using (all layout files should be kept in `site/template/layouts)
  2. title A Character string for the title (Currently not used anywhere)
  3. page A character string of the html of the body of the page

Here is an example of a very simple page file:

# This gives a list of all posts in the site
layout <- "default.R"
title <- "home"

page <- content(m("h2", "My scribblings:"), html.postlist(site))

Pages are built using the render.page() function:

render.page(site, "testpage.R")

This outputs a...

No longer true: They are automatically put in the correct place in the blog itself. If the page file is in site/template/pages, the corresponding html file is put in the top level of site/site/ (this is good for index files). If the page file is in site/template/pages/pages, the html file will be put in site/site/pages

Contents

Introduction

Installation and setup

HTML generation

Building a new static site

Posts and Pages

The Samatha engine

RSS Feeds

Testing your site

Samatha Online

Clone this wiki locally