diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-03-10 22:21:35 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2021-03-10 22:25:44 +0100 |
| commit | 9f74233ffedb0609d43d54b6169dc47dd6337803 (patch) | |
| tree | 724af2631940cf523ae2b3ac62376ae6b89e2dbc /Makefile | |
| parent | 1e44953621928120f5ee674c4582e33d6e625e62 (diff) | |
| download | quatuorbellefeuille.com-9f74233ffedb0609d43d54b6169dc47dd6337803.tar.xz | |
Add plumbing for English website
No link to switch from one language to the other yet.
Also, some pages are now out-of-date wrt their French version; not a
big deal, since we'll need to go over each page anyway.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -3,10 +3,17 @@ OUTDIR = public dirname = $(patsubst %/,%,$(dir $(1))) dirnames = $(sort $(call dirname,$(1))) -pages_src = $(filter-out template.html,$(wildcard *.html)) +languages = en +languages_folders = $(foreach l,$(languages),$(OUTDIR)/$(l)) + +pages_src = $(filter-out template.html,$(wildcard *.html)) \ +$(foreach l,$(languages), \ +$(filter-out $(l)/template.html,$(wildcard $(l)/*.html))) + pages = $(foreach p,$(pages_src),$(OUTDIR)/$(p)) -members_src = $(wildcard *.membre.in) +members_src = $(wildcard *.membre.in \ +$(foreach l,$(languages),$(l))/*.membre.in) members_pages = $(patsubst %.membre.in,$(OUTDIR)/%.html,$(members_src)) feeds = $(wildcard *.xml) @@ -31,22 +38,32 @@ site: $(pages) $(members_pages) $(resources) $(images) $(stylesheets) $(resources) $(images) $(stylesheets): $(OUTDIR)/%: % cp $< $@ -$(pages): $(OUTDIR)/%.html: %.html %.sh template.html - ./build.sh $< $*.sh $@ +.SECONDEXPANSION: + +# 🔪 HACK ATTACK 🔪 +# Ideally I'd like to just stick $$(<D)/template.html in the +# prerequisite list, but unlike $$(@D), $$(<D) seems to expand to +# nothing. No idea if that's a bug or if I'm just Doing It Wrong. +langdir = . +$(OUTDIR)/en/%: langdir = en + +$(pages): $(OUTDIR)/%.html: %.html %.sh $$(langdir)/template.html + ./build.sh $< $*.sh $(langdir)/template.html $@ -$(members_pages): $(OUTDIR)/%.html: %.membre.in build-member.sh template.html - ./build-member.sh $< $@ +$(members_pages): $(OUTDIR)/%.html: %.membre.in build-member.sh $$(langdir)/template.html + ./build-member.sh $< $(langdir)/template.html $@ $(OUTDIR)/quatuor.html: quatuor.md $(OUTDIR)/programmes.html: programs.in +$(OUTDIR)/en/quartet.html: en/quartet.md +$(OUTDIR)/en/programs.html: en/programs.in # Rules for automatic, incremental folder creation. # Our lists of target directories are created from the lists of leaf # resources; some intermediate directories that only hold subdirs do # not appear in these lists. Work around that with -p. -$(OUTDIR) $(images_folders) $(stylesheets_folders): +$(OUTDIR) $(languages_folders) $(images_folders) $(stylesheets_folders): mkdir -p $@ -.SECONDEXPANSION: $(resources) $(images) $(stylesheets) $(pages) $(members_pages): | $$(@D) |
