Browse Source

Added Tupfile

master
dirkson 3 years ago
parent
commit
15156d2c91
  1. 84
      .gitignore
  2. 2
      README.md
  3. 27
      Tupfile

84
.gitignore

@ -1,77 +1,9 @@
# ---> C
# Prerequisites
*.d
#Vim files
*.un~
*.swp
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
# ---> Vim
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# ---> Ninja
.ninja_deps
.ninja_log
obj/*
# Build framework
.tup
# Output
web/*

2
README.md

@ -1,3 +1,3 @@
# gwb
Gopher Was Better. Minimal semi-static website gen in C89.
Gopher Was Better. Minimal semi-static website gen using tup, cmark, imagemagick, minify, and linux tools.

27
Tupfile

@ -0,0 +1,27 @@
#Figure out newest article
: |> cp src/news/`ls src/news -t | head -1` %o; |> obj/news.md
#Cmark all the .md
: foreach src/*.md obj/*.md |> cmark %f > %o |> obj/cmark/%B.html
#minify all html
: foreach src/theme/*.html |> minify %f > %o |> obj/theme/%B.html
: foreach obj/cmark/*.html |> minify %f > %o |> obj/min/%B.html
#Concat all webpages
: foreach obj/min/*.html | obj/theme/*.html |> cat obj/theme/header.html %f obj/theme/footer.html > %o |> web/%B.html
#Scour and output svg
#: foreach src/svg/* |> scour3 --shorten-ids --set-precision=1 --no-line-breaks --strip-xml-space --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --strip-xml-prolog --indent=none %f %o |> web/%b
#Hi! My name is svgcleaner. I eat SVGs. No idea why.
#: foreach src/svg/* |> svgcleaner %f %o |> web/%b
#Minify css
: src/theme/style.css |> minify %f > %o |> web/style.css
#Move all our unchanged stuff to the final output dir
: foreach src/img/svg/*.svg src/img/ico/*.ico src/vid/*.mp4 src/vid/*.webm src/*.php obj/theme/*.html |> cp %f %o |> web/%b
: foreach src/dep/*.php |> cp %f %o |> web/dep/%b
#Brotli compression
: foreach web/*.html web/*.svg web/*.css |> brotli %f -o %o |> web/%b.br
Loading…
Cancel
Save