This is Zavier Lombain.
Perfect.
Well, it sounded very German to me, but it could be more French, but it's great.
It's great.
Okay, great.
Thank you very much.
And he's going to talk about Nexus S, which is an
opportunity for building static sites.
Please, one welcome and a round of applause for Zavier Lombain.
Thank you.
Zavier Lombain.
Zavier Lombain, look forward to your presentation.
Thank you.
So this is just a tiny library that I made for my own static site that I
generate.
It's called Nix.
It pronounced it like your a snake.
So if you just need to make a static site, probably your best
bet is to use something like 11T or Jkill.
You might have weird needs like me.
For example, when I build my site, I also generate a bunch of
PNGs from a bunch of SVGs.
And I just want to script that in a certain way.
I also have like an L web app that I want to build at the same
time.
And I also want to like display some source code in like custom
programming languages with like custom tree set or
grammar.
So weird stuff.
And if you need to do weird stuff to generate your websites,
you're best bet is to probably roll your own.
It's not extremely difficult.
It's like you need a file conversion and a build system.
And so you could basically just use make and
time doc.
That works relatively well.
Pondoc is amazing and make gets the job done.
You know.
But there's something better than make than you can use.
Of course.
This is the next step room.
So Nix is a library that basically takes pages.
A page in your website would be a derivation in Nix.
It takes pages and then provides you functions that convert pages from
one format to another and aggregates them together.
So here I have a basic example of a website that has a bunch of
knockdown pages in a directory.
And then I define a processor that as I call them,
which is knockdown to HTML.
It uses Pondoc to convert knockdown pages into HTML.
And then just below that.
I use this map directory function to convert every page in
a folder into month-down and then finally at the end I
aggregate them in a directory.
And this is already basically a kind of a website.
Each page in Nix comes with a few attributes on top of the derivation attributes.
So I have a file name.
I have the text of the page which can be used to like transform it
some ways.
I also have the metadata which is usually extracted from the page.
For example, if you use Pondoc, you can use it to extract the title of a
knockdown document and like a Janelle preemble from a knockdown document
to get some additional metadata.
And then you can use this to generate some more complex things.
Like here I have an example of the same website but I want to
generate an index page for it.
And so the first thing that I do is I build a list of HTML links
from the page title and the file names that are in the metadata.
I mean, more generally in the attributes of the pages.
And then I concat all these links into a new page index.html.
And then I create a new directory with all my pages plus my new index
that I just created.
Yeah.
And then if you're using a static site generator typically you won't
use a templating language like moustache.
You could use that with nix.
But we already have a programming language that works pretty well.
So might as well reuse it.
And what is practice I do with this is I use nix as the templating
language.
So here I define a functiononeyat that takes a title in a content and
those are again like used from like those attributes of the page.
And so it's a function that will cool because with the attributes of the page.
And then be used to interpret them into it.
So at the bottom I have this like nix.html.šats template,
it's template, and then I feed it whatever page I want to
instantiate in that template.
But we can do something much worse than this, which
is abuse import from derivation and with index to do
something like you have here at the bottom, which is
it's a knockdown file, but in practice it's going to be
inserted, like it behave like it's in a like nix double
quoted string, and so you can do string into a
position in it, like it was nix, and you can
call nix functions in it and everything.
And it's kind of awful theoretically, but it works really well.
This is what I use for my websites.
It's very convenient, and you can use nix, like it's
php.
And that's it for me.
You can check out the website at this code
Berkeley, and this is my website, which is built with this.
Thank you.