Stone is a static website generator: it takes a template, a css stylesheet, the content itself written in a high-level formatting syntax, and generates the corresponding html pages.
However, Stone isn't a generalistic one: its goal is to provide a very easy way to generate simple websites like a portfolio, or the pages of documentation for a small project. That is quite limitated, but Stone tries to be good at what it aims.
So, let's generate our first Stone-based website!
First, install Stone:
opam install stone
The stone
program should now be available. Type stone --help
to
have some explanations on how to use the binary. Let's start by
generating a default website:
stone -i my-portfolio
This initializes a my-portfolio
directory with a default project,
which consists in:
config.stone
), which holds the title of the
website, the list of the pages to display in the title bar and other
things;data
directory, which contains the template and the
stylesheet. As long as you use the default theme, you won't need to
modify them;pages
directory. This is where you put your content. In
particular, you can put here files written in
Markdown
syntax, with extension .md
or .markdown
.You can now tweak the config.stone
a bit, write things in pages
,
or just leave the default config. Finally, generate the html content:
stone my-portfolio
A new directory has appeared: site
. It contains the html pages,
generated by Stone from the markdown files. Any other file you put
in pages
that Stone does not know how to pre-process will be
copied as-is in site
. If you have a FTP access to a web server
somewhere, just upload on it the contents of site
. You can also
directly browse its contents locally with your favorite browser.