-
Notifications
You must be signed in to change notification settings - Fork 4
site skeleton
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)
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:
-
layout
The layout file you want the page to be processed using (all layout files should be kept in `site/template/layouts) -
title
A Character string for the title (Currently not used anywhere) -
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
- If you don't understand something, please email me