summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-11-27 22:34:19 -0600
committerZach van Rijn <me@zv.io>2023-11-27 22:34:19 -0600
commit10cb3140292c69451522abeff8bd8f005cf08268 (patch)
tree5b670cdd65edee2613b0395f08f8fb658192d1a3
parentf800e267b75bf8dce7c3f0a61f66d944eab14d75 (diff)
downloadsite-ng-10cb3140292c69451522abeff8bd8f005cf08268.tar.gz
site-ng-10cb3140292c69451522abeff8bd8f005cf08268.tar.bz2
site-ng-10cb3140292c69451522abeff8bd8f005cf08268.tar.xz
site-ng-10cb3140292c69451522abeff8bd8f005cf08268.zip
Decouple sass, logo, and html generation.
-rw-r--r--.gitignore1
-rw-r--r--Makefile12
-rw-r--r--README8
-rwxr-xr-xpublish22
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
@@ -7,15 +7,35 @@ 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