|
1 | 1 | SBLG = sblg |
2 | 2 | XSLTPROC = xsltproc |
| 3 | +LOWDOWN = lowdown |
3 | 4 | PREFIX = $(PWD)/site |
4 | 5 | BLOG_SRC_TOP_DIR = blogsource/content |
5 | 6 | BLOG_POST_SRC_DIR = $(BLOG_SRC_TOP_DIR)/post |
6 | 7 | BLOG_POST_OUT_TOP_DIR = blog |
7 | 8 | BLOG_POST_OUT_DIR = $(BLOG_POST_OUT_TOP_DIR)/post |
8 | 9 | BLOG_POSTS = $(wildcard $(BLOG_POST_SRC_DIR)/*.md) |
9 | | -BLOG_POSTS_OUT = $(subst $(BLOG_POST_SRC_DIR), $(BLOG_POST_OUT_DIR), $(BLOG_POSTS:.md=.html)) |
| 10 | +BLOG_POSTS_OUT = $(subst $(BLOG_POST_SRC_DIR), $(BLOG_POST_OUT_DIR), $(BLOG_POSTS:.md=.html)) |
10 | 11 | CONTRIBUTORS_SRC_DIR = blogsource/content/contributors |
11 | 12 | CONTRIBUTORS_OUT_DIR = contributors |
12 | 13 | CONTRIBUTORS = $(wildcard $(CONTRIBUTORS_SRC_DIR)/*.md) |
13 | 14 | PAGES_SRC_DIR = pagesource |
14 | | -PAGES_SRC = $(wildcard $(PAGES_SRC_DIR)/*.xml) |
15 | | -PAGES_SRC += xeps.xml |
16 | | -PAGES = $(subst $(PAGES_SRC_DIR)/,,$(PAGES_SRC:.xml=.html)) |
| 15 | +PAGES_SRC = $(wildcard $(PAGES_SRC_DIR)/*.md) |
| 16 | +PAGES_MD_TO_XML = $(subst $(PAGES_SRC_DIR)/,,$(PAGES_SRC:.md=.xml)) |
| 17 | +PAGES_XML = $(PAGES_MD_TO_XML) |
| 18 | +PAGES_XML += xeps.xml |
| 19 | +PAGES = $(PAGES_XML:.xml=.html) |
17 | 20 | REDIRECTS_DIR = pageredirects |
18 | 21 | REDIRECTS_SRC = $(wildcard $(REDIRECTS_DIR)/*.html) |
19 | 22 | REDIRECTS = $(subst $(REDIRECTS_DIR)/,,$(REDIRECTS_SRC)) |
@@ -42,25 +45,40 @@ install: index.html $(PAGES) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OU |
42 | 45 | cp -p -r tarballs $(PREFIX) |
43 | 46 |
|
44 | 47 |
|
45 | | -index.html: landing-template.xml index.xml profanity_version.txt |
| 48 | +index.html: landing-template.xml index.md profanity_version.txt |
46 | 49 | sed -e 's/$${version}/$(VERSION)/g' \ |
47 | 50 | -e 's/$${tar_xz_sha256}/$(TAR_XZ_SHA256)/g' \ |
48 | | - -e 's/$${zip_sha256}/$(ZIP_SHA256)/g' index.xml > index.gen.xml |
49 | | - $(SBLG) -o $@ -t landing-template.xml -c index.gen.xml |
50 | | - rm -f index.gen.xml |
| 51 | + -e 's/$${zip_sha256}/$(ZIP_SHA256)/g' index.md > index.tmpmd |
| 52 | + echo "<article data-sblg-article=\"1\" data-sblg-set-title=\"Profanity, a console based XMPP client - Home\" data-sblg-set-subtitle=\"A console based XMPP client\">" >$(@:.html=.xml) |
| 53 | + $(LOWDOWN) --html-no-head-ids --html-no-skiphtml --html-no-escapehtml index.tmpmd >>$(@:.html=.xml) |
| 54 | + echo "</article>" >>$(@:.html=.xml) |
| 55 | + sed -e 's|<p>$${div_content}</p>|<div id="content">|g' $(@:.html=.xml) > $(@:.html=.tmpxml) |
| 56 | + sed -e 's|<p>$${div_features}</p>|<div id="features">|g' $(@:.html=.tmpxml) > $(@:.html=.xml) |
| 57 | + sed -e 's|<p>$${div_screenshots}</p>|<div id="screenshots">|g' $(@:.html=.xml) > $(@:.html=.tmpxml) |
| 58 | + sed -e 's|<p>$${div_end}</p>|</div>|g' $(@:.html=.tmpxml) > $(@:.html=.xml) |
| 59 | + $(SBLG) -o $@ -t landing-template.xml -c index.xml |
| 60 | + rm -f index.xml index.tmpxml index.tmpmd |
51 | 61 |
|
52 | | -$(PAGES): manual-template.xml xeplist |
53 | | - cp --preserve=mode,ownership,timestamps $(addprefix $(PAGES_SRC_DIR)/,$(@:.html=.xml)) . |
| 62 | +$(PAGES): manual-template.xml $(PAGES_MD_TO_XML) xeplist |
54 | 63 | $(SBLG) -o $@ -t manual-template.xml -c $(@:.html=.xml) |
55 | | - rm -f $(PAGES:.html=.xml) |
| 64 | + rm -f $(@:.html=.xml) |
| 65 | + |
| 66 | +$(PAGES_MD_TO_XML): $(PAGES_SRC) |
| 67 | + cp $(addprefix $(PAGES_SRC_DIR)/,$(@:.xml=.md)) . |
| 68 | + echo "<article id=\"manual\" data-sblg-article=\"1\" data-sblg-set-title=\"`$(LOWDOWN) -X title $(@:.xml=.md)`\" data-sblg-set-subtitle=\"`$(LOWDOWN) -X subtitle $(@:.xml=.md)`\">" >$@ |
| 69 | + $(LOWDOWN) --html-no-skiphtml --html-no-escapehtml $(subst .xml,.md,$@) >>$@ |
| 70 | + echo "</article>" >>$@ |
| 71 | + sed -e 's|<p>$${section_start}</p>|<section>|g' $@ > $(@:.xml=.tmpxml) |
| 72 | + sed -e 's|<p>$${section_end}</p>|</section>|g' $(@:.xml=.tmpxml) > $@ |
| 73 | + rm -f $(@:.xml=.md) $(@:.xml=.tmpxml) |
56 | 74 |
|
57 | 75 | xeplist: $(PAGES_SRC_DIR)/doap-stylesheet/style.xsl $(PAGES_SRC_DIR)/doap/profanity.doap \ |
58 | 76 | $(PAGES_SRC_DIR)/xeplist/xeplist.xml |
59 | 77 | cp --preserve=mode,ownership,timestamps $(PAGES_SRC_DIR)/xeplist/xeplist.xml \ |
60 | 78 | $(PAGES_SRC_DIR)/doap-stylesheet/ |
61 | 79 | $(XSLTPROC) $(PAGES_SRC_DIR)/doap-stylesheet/style.xsl \ |
62 | 80 | $(PAGES_SRC_DIR)/doap/profanity.doap \ |
63 | | - > $(PAGES_SRC_DIR)/xeps.xml |
| 81 | + > xeps.xml |
64 | 82 | rm $(PAGES_SRC_DIR)/doap-stylesheet/xeplist.xml |
65 | 83 |
|
66 | 84 | themegallery.html: gallery-template.xml |
|
0 commit comments