Let's create a new directory and add a first HTML page:
mystog/index.html
Hello world !
^D]]>
Now let's run stog on the mystog directory
to generate the result in the (automatically created) stog-output
directory:
$ stog --local mystog
Warning: Creating non-existent configuration directory "mystog/.stog"
Warning: Creating default template file "mystog/.stog/templates/page.tmpl"
0 error, 2 warnings
$ ls stog-output
index.html
Now browse the stog-output/index.html file. Hum,
it misses some style.
Let's add a default stylesheet to our source directory and run
stog again:
$ wget http://zoggy.github.io/stog/style.css -O mystog/style.css
$ stog --local mystog
Now the page stog-output/index.html looks better.
We start by adding a post, which is a document of type "post",
as the first node in the file indicates. We create the file
in a new posts directory to keep things clean:
mystog/posts/first-post.html
This is the first post of this blog.
Lorem ipsum bla bla bla
^D]]>
Let's run stog and browse the resulting file
in stog-output/posts/first-post.html:
$ stog --local mystog
Warning: Creating default template file "mystog/.stog/templates/post.tmpl"
Warning: Creating default template file "mystog/.stog/templates/doc-in-list.tmpl"
Warning: Creating default template file "mystog/.stog/templates/by-month.tmpl"
0 error, 3 warnings
$ tree stog-output
stog-output
|-- 2013_11.html
|-- index.html
|-- posts
| `-- first-post.html
`-- style.css
1 directory, 4 files
We see that the original file hierarchy (in mystog)
is mapped to the destination directoy (in stog-output).
An additional file is present, 2013_11.html, which is automatically
created to list documents of november 2013, since at least one document has
this date (out first blog post).
Let's add another page, here a mystog/blog.html file, containing
the list of documents of type "post", with 4 documents maximum, and generating
a index.rss file on the fly:
mystog/blog.html
Most recent posts:
^D
$ stog --local mystog]]>
Let's retrieve two images into our source directory and run stog again: