From 10cb3140292c69451522abeff8bd8f005cf08268 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Mon, 27 Nov 2023 22:34:19 -0600 Subject: Decouple sass, logo, and html generation. --- .gitignore | 1 + Makefile | 12 +++++++++++- README | 8 +++++++- publish | 22 ++++++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8ccaf34..de327d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ html/ html.tgz +*-images-*.tar.gz assets/images/gen_* assets/images/icons/gen_* assets/fonts/ diff --git a/Makefile b/Makefile index a819a09..09d8570 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,14 @@ +DIR_NAME := $(notdir $(CURDIR)) +GIT_HASH := $(shell git rev-list HEAD^!) + all: site: - $(CURDIR)/publish + $(CURDIR)/publish sass logo html +logo: + $(CURDIR)/publish logo + rm -f $(CURDIR)/$(DIR_NAME)-images-${GIT_HASH}.tar.gz + tar -C $(CURDIR)/assets/images -pczf $(CURDIR)/$(DIR_NAME)-images-${GIT_HASH}.tar.gz . + +clean: + rm -fr $(CURDIR)/html diff --git a/README b/README index ecc271d..3fd6bf6 100644 --- a/README +++ b/README @@ -14,6 +14,12 @@ To generate the 'html/' web root directory for upload to web server: $ make site +To generate the 'images/' directory containing generated images for +use elsewhere: + + $ make logo + + installing ---------- @@ -107,7 +113,7 @@ absolutely sure that no external websites use or link to the image(s). license ------- -Copyright 2021 The Adélie Linux Project +Copyright 2023 The Adélie Linux Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/publish b/publish index 8efdda5..aebaffb 100755 --- a/publish +++ b/publish @@ -6,16 +6,36 @@ HTML=html; TEMP=$(mktemp -d); chmod 755 ${TEMP}; +## +# Build options. +# +SASS=0; +LOGO=0; +HTML=0; +for arg; do + case "${ARG}" in + sass) SASS=1; ;; + logo) LOGO=1; ;; + html) HTML=1; ;; + esac +done + ## # CSS # +if test ${SASS} -eq 1; then (cd assets/css && ./compile.sh) +fi # SASS ## # Logo # +if test ${LOGO} -eq 1; then (cd assets/images && ./polyguin.sh) +fi # LOGO + +if test ${HTML} -eq 1; then #=============================================================== docker run -v ${HERE}:${HERE} -e HERE=${HERE} -v ${TEMP}:${TEMP} -e TEMP=${TEMP} --rm -i alpine:3.17 <<'EOF' apk add findutils imagemagick; @@ -69,3 +89,5 @@ cp ${HERE}/robots.txt ${TEMP}; # rm -fr ${HTML}; mv ${TEMP} ${HTML}; + +fi # HTML -- cgit v1.2.3-70-g09d2