summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-02-07 19:20:16 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-02-08 19:56:29 +0100
commit40d193b330443ea074f42674ed18f463fc8e422e (patch)
treec3abfa115f38923afbadea6d38b4da0ca5e8e7ef
parent0990b4df19b1e8c42c8a1c22fc77fb9e836b379c (diff)
downloadquatuorbellefeuille.com-40d193b330443ea074f42674ed18f463fc8e422e.tar.xz
Move images and stylesheets in subfolders
-rw-r--r--Makefile22
-rwxr-xr-xbuild.sh3
-rw-r--r--images/calendar.svg (renamed from calendar.svg)0
-rw-r--r--images/close.svg (renamed from close.svg)0
-rw-r--r--images/menu.svg (renamed from menu.svg)0
-rw-r--r--images/share.svg (renamed from share.svg)0
-rw-r--r--stylesheets/actualités.css (renamed from actualités.css)0
-rw-r--r--stylesheets/commun.css (renamed from commun.css)0
-rw-r--r--stylesheets/contact.css (renamed from contact.css)0
-rw-r--r--stylesheets/gallerie.css (renamed from gallerie.css)0
-rw-r--r--stylesheets/index.css (renamed from index.css)2
-rw-r--r--stylesheets/membre.css (renamed from membre.css)0
-rw-r--r--stylesheets/programmes.css (renamed from programmes.css)0
-rw-r--r--stylesheets/quatuor.css (renamed from quatuor.css)0
-rw-r--r--template.html10
15 files changed, 25 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 811ceab..af585b7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,39 @@
OUTDIR = public
+dirname = $(patsubst %/,%,$(dir $(1)))
+dirnames = $(sort $(call dirname,$(1)))
+
pages_src = $(filter-out template.html,$(wildcard *.html))
pages = $(foreach p,$(pages_src),$(OUTDIR)/$(p))
-sheets = $(wildcard *.css)
-images = $(wildcard *.svg)
feeds = $(wildcard *.xml)
-resources_src = $(sheets) $(images) $(feeds)
+resources_src = $(feeds)
resources = $(foreach f,$(resources_src),$(OUTDIR)/$(f))
+images = $(foreach img,$(shell find images -type f),$(OUTDIR)/$(img))
+images_folders = $(call dirnames,$(images))
+
+stylesheets = $(foreach img,$(shell find stylesheets -type f),$(OUTDIR)/$(img))
+stylesheets_folders = $(call dirnames,$(stylesheets))
.PHONY: all clean site
all: site
-site: $(pages) $(resources)
+site: $(pages) $(resources) $(images) $(stylesheets)
-$(OUTDIR):
+$(OUTDIR) $(images_folders) $(stylesheets_folders):
mkdir $@
$(resources): $(OUTDIR)/%: % | $(OUTDIR)
cp $< $@
+$(images): $(OUTDIR)/%: % | $(images_folders)
+ cp $< $@
+
+$(stylesheets): $(OUTDIR)/%: % | $(stylesheets_folders)
+ cp $< $@
+
# TODO: optional dependency to .sh template parameters.
$(pages): $(OUTDIR)/%.html: %.html template.html | $(OUTDIR)
./build.sh $< $@
diff --git a/build.sh b/build.sh
index b4fc8f8..617645c 100755
--- a/build.sh
+++ b/build.sh
@@ -38,7 +38,8 @@ sed -i s/'{TITLE}'/"${title}"/ ${output}
link_stylesheets=''
for s in "${stylesheets[@]}"
do
- link_stylesheets+=$(printf '<link rel="stylesheet" href="%s.css">\n' "${s}")
+ link_template='<link rel="stylesheet" href="stylesheets/%s.css">\n'
+ link_stylesheets+=$(printf "${link_template}" "${s}")
done
sed -i /'{STYLESHEETS}'/'c\'"${link_stylesheets}" ${output}
diff --git a/calendar.svg b/images/calendar.svg
index 1c2ec99..1c2ec99 100644
--- a/calendar.svg
+++ b/images/calendar.svg
diff --git a/close.svg b/images/close.svg
index 7d5875c..7d5875c 100644
--- a/close.svg
+++ b/images/close.svg
diff --git a/menu.svg b/images/menu.svg
index e8a84a9..e8a84a9 100644
--- a/menu.svg
+++ b/images/menu.svg
diff --git a/share.svg b/images/share.svg
index 09b1c7b..09b1c7b 100644
--- a/share.svg
+++ b/images/share.svg
diff --git a/actualités.css b/stylesheets/actualités.css
index d8f04b8..d8f04b8 100644
--- a/actualités.css
+++ b/stylesheets/actualités.css
diff --git a/commun.css b/stylesheets/commun.css
index b432aab..b432aab 100644
--- a/commun.css
+++ b/stylesheets/commun.css
diff --git a/contact.css b/stylesheets/contact.css
index 6bd68ec..6bd68ec 100644
--- a/contact.css
+++ b/stylesheets/contact.css
diff --git a/gallerie.css b/stylesheets/gallerie.css
index a75faf7..a75faf7 100644
--- a/gallerie.css
+++ b/stylesheets/gallerie.css
diff --git a/index.css b/stylesheets/index.css
index 56c94ba..94e2d57 100644
--- a/index.css
+++ b/stylesheets/index.css
@@ -12,7 +12,7 @@ main {
height: 20ex;
width: 10em;
text-align: center;
- background: no-repeat center/contain url('calendar.svg');
+ background: no-repeat center/contain url('/images/calendar.svg');
}
#next-concert a {
diff --git a/membre.css b/stylesheets/membre.css
index 86d370b..86d370b 100644
--- a/membre.css
+++ b/stylesheets/membre.css
diff --git a/programmes.css b/stylesheets/programmes.css
index 98a1a4f..98a1a4f 100644
--- a/programmes.css
+++ b/stylesheets/programmes.css
diff --git a/quatuor.css b/stylesheets/quatuor.css
index f72c9af..f72c9af 100644
--- a/quatuor.css
+++ b/stylesheets/quatuor.css
diff --git a/template.html b/template.html
index 59b9996..e9b9080 100644
--- a/template.html
+++ b/template.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{TITLE} - Quatuor Camelot</title>
- <link rel="stylesheet" href="commun.css">
+ <link rel="stylesheet" href="stylesheets/commun.css">
{STYLESHEETS}
<link rel="alternate" type="application/rss+xml" href="feed.xml">
</head>
@@ -19,8 +19,8 @@
<header class="menu togglable">
<input type="checkbox" class="toggle" id="menu">
- <img class="button open" src="menu.svg">
- <img class="button close" src="close.svg">
+ <img class="button open" src="images/menu.svg">
+ <img class="button close" src="images/close.svg">
<label for="menu">Menu</label>
<div class="content">
<nav>
@@ -48,8 +48,8 @@
<footer class="social togglable">
<input type="checkbox" class="toggle" id="social">
- <img class="button open" src="share.svg">
- <img class="button close" src="close.svg">
+ <img class="button open" src="images/share.svg">
+ <img class="button close" src="images/close.svg">
<label for="social">Nous contacter</label>
<div class="content">
<img src="https://upload.wikimedia.org/wikipedia/en/9/9f/Twitter_bird_logo_2012.svg">