1. 24
  1.  

  2. 7

    You can also use m4; e.g. https://github.com/vkitchen/apostl

    1. 1

      I remember investigating m4, I forgot why I didn’t use it, maybe I prefered the PHP way.

    2. 4

      I’ve found a decent way to make static web page builders is to just use shell scripts that call cat with heredocs, like:

      cat <<EOF
      <!doctype html>
      <meta charset=utf-8>
      <title>foo</title>    
      EOF
      ./header
      ./content
      ./footer
      echo "</html>"
      

      and stuff like that…

      1. 1

        Yeah, I just automated the echos. Heredocs are slow overall.

      2. 4

        I will always stan Pollen for this kind of thing.

        1. 2

          Mixing the HTML with code resembles good old PHP :-) It is quite good for certain use cases. Sometimes I still use PHP this way (however I prefer languages like Java for not so small projects). Also old (pre-XML) JSP worked similarly.

          I did some websites with XSLT+Make, so I know how powerful and simple this approach is.

          1. 2

            PHP was an inspiration for pp(1). :)

          2. 1

            Thanks for sharing.

            I love seeing simple static site generators like this. I am currently using ssg.

            1. 1

              Cool. Reminds me of @romanzolotarev’s ssg.

              1. 1

                Or use Hugo. Or gatsby. There is dozens of preprocessors or static site generators. Your is using sh.