logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git

configure (741B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+blog@hacktivis.me>
  3. # SPDX-License-Identifier: MIT
  4. templates_en="./templates/head.xml ./templates/en/nav.xsl ./templates/en/footer.shtml"
  5. cat >|config.ninja <<-EOF
  6. # Generated by: $0 $@
  7. rule gen_config
  8. command = $0 "$@"
  9. generator = 1
  10. build config.ninja: gen_config configure | ./articles
  11. build entry.xsl: xinclude entry.xsl.in | ${templates_en}
  12. build bookmarks.xsl: xinclude bookmarks.xsl.in | ${templates_en}
  13. build nginx_autoindex.xsl: xinclude nginx_autoindex.xsl.in | ${templates_en}
  14. EOF
  15. for i in articles/*.xml
  16. do
  17. i="${i//$/\$\$}" # '$' → '$$'
  18. i="${i// /$ }" # ' ' → '$ '
  19. echo "build ${i//.xml/.html}: article entry.xsl ${i}"
  20. done >>config.ninja