generated from vilor/hyde-template
Ivan Polyakov
3 years ago
5 changed files with 89 additions and 24 deletions
@ -0,0 +1,58 @@ |
|||||||
|
# Copyright (C) 2022 Ivan Polyakov
|
||||||
|
#
|
||||||
|
# This file is part of vilor's website.
|
||||||
|
#
|
||||||
|
# Vilor's website is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Vilor's website is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
include config.mk |
||||||
|
|
||||||
|
DIRS := $(shell find $(SRCDIR)/pages/* -type d | sed 's/$(SRCDIR)\/pages/$(OUTDIR)/')
|
||||||
|
|
||||||
|
SRCPAGES := $(shell find $(SRCDIR)/pages/* -name '*.scm')
|
||||||
|
|
||||||
|
SRCSTYLES := $(shell find $(SRCDIR)/styles/* -name '*.scm')
|
||||||
|
OUTSTYLES := $(shell find $(SRCDIR)/styles/ -type f -name '*.scm' | sed 's/$(SRCDIR)\/styles/$(OUTDIR)/')
|
||||||
|
OUTSTYLES := $(OUTSTYLES:%.scm=%.css)
|
||||||
|
|
||||||
|
SRCJS := $(shell find $(SRCDIR)/scripts/* -name '*.js')
|
||||||
|
OUTJS := $(shell find $(SRCDIR)/scripts/ -type f -name '*.js' | sed 's/$(SRCDIR)\/scripts/$(OUTDIR)/')
|
||||||
|
|
||||||
|
all: $(OUTDIR) $(STATICDIR) pages $(OUTSTYLES) $(OUTJS) |
||||||
|
|
||||||
|
pages: $(SRCPAGES) |
||||||
|
for page in $(SRCPAGES) ; do \
|
||||||
|
$(SCHEME) $(SCHEMEFLAGS) $$page \
|
||||||
|
| sed -f scripts/minify-html.sed \
|
||||||
|
> $$(echo $$page | sed 's/.*\/pages/dist/' | sed 's/scm/xhtml/') \
|
||||||
|
; done
|
||||||
|
|
||||||
|
$(OUTSTYLES): $(SRCSTYLES) |
||||||
|
$(SCHEME) $(SCHEMEFLAGS) $< > $@
|
||||||
|
|
||||||
|
$(OUTJS): $(SRCJS) |
||||||
|
for script in $(SRCJS) ; do \
|
||||||
|
cp $$script $$(echo $$script | sed 's/.*\/scripts/dist/') \
|
||||||
|
; done
|
||||||
|
|
||||||
|
$(OUTDIR): |
||||||
|
mkdir -p $(OUTDIR)
|
||||||
|
mkdir -p $(DIRS)
|
||||||
|
|
||||||
|
$(STATICDIR): $(OUTDIR) |
||||||
|
cp -rf $@/* $< || echo $(STATICDIR) "dir is empty"
|
||||||
|
cp COPYING dist/
|
||||||
|
|
||||||
|
clean: |
||||||
|
rm -rf $(OUTDIR)
|
||||||
|
|
||||||
|
.PHONY: all $(OUTDIR) $(STATICDIR) clean |
@ -0,0 +1,23 @@ |
|||||||
|
# Copyright (C) 2022 Ivan Polyakov
|
||||||
|
#
|
||||||
|
# This file is part of vilor's website.
|
||||||
|
#
|
||||||
|
# Vilor's website is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Vilor's website is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
SCHEME=csi
|
||||||
|
SCHEMEFLAGS=-s
|
||||||
|
|
||||||
|
SRCDIR=src
|
||||||
|
STATICDIR=public
|
||||||
|
OUTDIR=dist
|
@ -1,20 +0,0 @@ |
|||||||
;; Copyright (C) 2022 Ivan Polyakov |
|
||||||
;; |
|
||||||
;; This file is part of vilor's website. |
|
||||||
;; |
|
||||||
;; Vilor's website is free software: you can redistribute it and/or modify |
|
||||||
;; it under the terms of the GNU General Public License as published by |
|
||||||
;; the Free Software Foundation, either version 3 of the License, or |
|
||||||
;; (at your option) any later version. |
|
||||||
;; |
|
||||||
;; Vilor's website is distributed in the hope that it will be useful, |
|
||||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
;; GNU General Public License for more details. |
|
||||||
;; |
|
||||||
;; You should have received a copy of the GNU General Public License |
|
||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
(import hyde) |
|
||||||
|
|
||||||
(output-dir "dist") |
|
Loading…
Reference in new issue