

Show HN: Gugodoc, my static web generator (for what it's worth ) - MeyerDumont
http://gugodoc.free.fr

======
terhechte
Funny, I'm almost done with a fork of a Clojure static web generator and I
really went into the opposite direction. What I wanted was to have one (or
several) html files as templates that I do not need to break up into parts and
that are not plastered with weird template tags. So I'm using Enlive to define
selectors and the generator uses theses selectors to fill the content into the
html structure. That makes it really really easy to edit the html for the blog
without having to go the html -> haml/whatever -> break up -> ... route. I
just relaunched my blog with this generator and it feels so liberating that I
can just work in html without having to do any kind of conversation afterwards
but the content is applied.

I'm currently extending the tests for the generator, and will release it then.
If anyone is interested, drop me a note and I'll notify :)

~~~
MeyerDumont
your solution sounds really good.

~~~
terhechte
I just published the generator. You can see the relevant HN post here:
[https://news.ycombinator.com/item?id=7103742](https://news.ycombinator.com/item?id=7103742)

------
prewett
Is there something like this that operates at a higher level? Unlike the
author, I'm ok with HTML (and I can't stand markdown), except that it's too
low level. I want to break things up by title, author, date, summary, content,
etc. and then generate the HTML by plugging it into a template, so that title,
date, and author become part of the heading at the top of the page and so on.
So something like

<title>...</title> (pretend this isn't already taken) <author>...</author>
<date>...</date> <summary>...</summary> ...

It seems like XSLT is what I want, except that I have to deal with a bunch of
XML nonsense. I could always write my own parser, but I keep hoping someone
already wrote something like this.

~~~
delluminatus
What you're talking about can be pretty easily implemented with template
inheritance that uses blocks/sections. Pretty much any templating language can
do this for you (usually static site generators use templating languages, so
by extension, static site generators will do this for you as well). For
instance, jinja2 is a common one for Python that I use for my website.

You can read about jinja2 template inheritance in their docs [1]. The gist of
it is that you can define a layout in HTML, with placeholders for specific
things like the title, author, content, etc. Then your actual post is just a
file that inherits from that layout template and only defines the relevant
blocks. So in "template pseudocode" your page might look like this:

    
    
        {{ extends site_layout }}
        {{ block title }} Title here {{ endblock }}
        {{ block author }} delluminatus {{ endblock }}
        {{ block content }} 
            <p>Content!</p>
        {{ endblock }}
    

[1]: [http://jinja.pocoo.org/docs/templates/#template-
inheritance](http://jinja.pocoo.org/docs/templates/#template-inheritance)

------
roeme

      I'm a big fan of minimalism.
      I love markdown
      I hate HTML
    

If you hate HTML, are you sure you should write something that outputs exactly
that?

~~~
ama729
> If you hate HTML, are you sure you should write something that outputs
> exactly that?

He probably mean to _write_ HTML.

------
rajeevk
How is this different from Octopress? In Octopress you can simply edit
markdown files and then generate html.

~~~
MeyerDumont
I don't know Octopress, this is just my tool and it's probably worst than all
the others but it fits my needs

~~~
chanux
Just for fun is a perfectly good reason for anything!

Also, I have saved a lot of time looking around for existing solutions than
just doing it myself. :)

------
simlevesque
Dans la section HTML and Bootstrap, la phrase suivante contient au moins deux
fautes : "But, of course, I discourage you fro doing this because, in my
opinion, markdwon files must try to be as lisible/raw/text only as possible."

~~~
MeyerDumont
merci !

------
aaren
where is the source code?

~~~
MeyerDumont
It's too ugly but I will probably try to clean it and put it on github soon.

~~~
aaren
I'm not going to run your binary if I can't see the source and compile it
myself!

~~~
MeyerDumont
I understand that. I will try to publish to source code very soon then.

------
L4mppu
Pretty much impossible to read on phone with that floating shit blocking your
view.

~~~
MeyerDumont
Thanks for the feedback, I will try to fix that ASAP.

