Compare commits
2 Commits
67b2aa6e45
...
6e96d78503
Author | SHA1 | Date | |
---|---|---|---|
|
6e96d78503 | ||
|
1260335265 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*/
|
33
Makefile
Normal file
33
Makefile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
INFILES := $(shell find ./ -name '*.md' -type f)
|
||||||
|
OUTFILES := $(patsubst %.md,%.html,$(INFILES))
|
||||||
|
CLEANFILES = $(shell find ./ -mindepth 2 -name '*.html' -type f)
|
||||||
|
INDEXFILES := $(patsubst %navigation.md,%index.html,$(filter %navigation.md,$(INFILES)))
|
||||||
|
NAVFILES := $(patsubst %navigation.md,%navigation.html,$(filter %navigation.md,$(INFILES)))
|
||||||
|
HEADFILES := $(patsubst %navigation.html,%header.html,$(NAVFILES))
|
||||||
|
SPACE := $(eval) $(eval)
|
||||||
|
|
||||||
|
|
||||||
|
all: $(OUTFILES) $(INDEXFILES) $(HEADFILES) header.txt footer.html
|
||||||
|
|
||||||
|
%navigation.html: %navigation.md
|
||||||
|
sed s/".md"/".html"/ $^ |pandoc -o $*navigation.html
|
||||||
|
|
||||||
|
%header.html: header.txt $(NAVFILES)
|
||||||
|
cat header.txt $(filter ./$(@D)%, $(NAVFILES)) > $@
|
||||||
|
|
||||||
|
%index.html: $(HEADFILES) footer.html
|
||||||
|
cat $(filter ./$(@D)%, $(HEADFILES)) footer.html > $@
|
||||||
|
|
||||||
|
%.html: %.md $(HEADFILES) footer.html
|
||||||
|
sed 's|href="|href="$(subst $(SPACE),,$(patsubst %,../,$(wordlist 2,3,$(subst /, ,$(@D)))))|g' $(filter ./$(word 1, $(subst /, ,$(@D)))/%, $(HEADFILES)) > $(@D)/tmpnav.html
|
||||||
|
cat endnav.txt >> $(@D)/tmpnav.html
|
||||||
|
pandoc --toc -s $(filter %.md,$^) -H head.txt -B $(@D)/tmpnav.html -A footer.html -o $*.html
|
||||||
|
|
||||||
|
header.txt:
|
||||||
|
|
||||||
|
footer.html:
|
||||||
|
|
||||||
|
cleanhtml:
|
||||||
|
rm $(CLEANFILES)
|
||||||
|
|
||||||
|
|
12
README.md
12
README.md
@ -2,3 +2,15 @@
|
|||||||
|
|
||||||
Petit test en Makefile pour générer un site web statique.
|
Petit test en Makefile pour générer un site web statique.
|
||||||
Utilise pandoc et make
|
Utilise pandoc et make
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## howto
|
||||||
|
```
|
||||||
|
mkdir sitename
|
||||||
|
vi sitename/page.md
|
||||||
|
vi sitename/nav.md
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
pour un peu de custom, ne pas hésiter a changer les fichiers .txt
|
||||||
|
1
endnav.txt
Normal file
1
endnav.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
</nav>
|
5
footer.html
Normal file
5
footer.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
</nav>
|
||||||
|
<footer>
|
||||||
|
<p>jeanjack was here</p>
|
||||||
|
</footer>
|
||||||
|
</body></html>
|
2
head.txt
Normal file
2
head.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<link rel="stylesheet" href="../style.css">
|
||||||
|
<pwetest/>
|
13
header.txt
Normal file
13
header.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<header>
|
||||||
|
<div style="font-family: monospace, fixed; font-weight: bold;">
|
||||||
|
<span style="">                                                                      </span><br />
|
||||||
|
<span style="">m     m mmmmm  m    m mmmmm  m    m mmmm   m    m   mm   m    m mmmmmm</span><br />
|
||||||
|
<span style="">#  #  #   #    #  m"    #    ##  ## #   "m ##  ##   ##   #  m"  #     </span><br />
|
||||||
|
<span style="">" #"# #   #    #m#      #    # ## # #    # # ## #  #  #  #m#    #mmmmm</span><br />
|
||||||
|
<span style=""> ## ##"   #    #  #m    #    # "" # #    # # "" #  #mm#  #  #m  #     </span><br />
|
||||||
|
<span style=""> #   #  mm#mm  #   "m mm#mm  #    # #mmm"  #    # #    # #   "m #mmmmm</span><br />
|
||||||
|
<span style="">                                                                      </span><br />
|
||||||
|
<span style="">                                                                      </span><br />
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<nav>
|
Loading…
Reference in New Issue
Block a user