Skip to content

Commit 71c63e0

Browse files
authored
Merge pull request #131 from bkmgit/sblg
Ensure man pages get published
2 parents ec2a4ba + 0a948cb commit 71c63e0

4 files changed

Lines changed: 32 additions & 18 deletions

File tree

Makefile

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
SBLG = sblg
2-
PREFIX = $(HOME)/profanity
3-
BLOG_POST_SRC_DIR = blogsource/content/post
4-
BLOG_POST_OUT_DIR = blog
2+
PREFIX = $(PWD)/site
3+
BLOG_SRC_TOP_DIR = blogsource/content
4+
BLOG_POST_SRC_DIR = $(BLOG_SRC_TOP_DIR)/post
5+
BLOG_POST_OUT_TOP_DIR = blog
6+
BLOG_POST_OUT_DIR = $(BLOG_POST_OUT_TOP_DIR)/post
57
BLOG_POSTS = $(wildcard $(BLOG_POST_SRC_DIR)/*.md)
68
BLOG_POSTS_OUT = $(subst $(BLOG_POST_SRC_DIR), $(BLOG_POST_OUT_DIR), $(BLOG_POSTS:.md=.html))
79
CONTRIBUTORS_SRC_DIR = blogsource/content/contributors
810
CONTRIBUTORS_OUT_DIR = contributors
911
CONTRIBUTORS = $(wildcard $(CONTRIBUTORS_SRC_DIR)/*.md)
1012
PAGES_SRC_DIR = pagesource
11-
PAGES = $(wildcard $(PAGE_SRC_DIR)/*.xml)
12-
PAGES_OUT = $(subst $(PAGES_SRC_DIR),, $(PAGES:.xml=.html))
13+
PAGES_SRC = $(wildcard $(PAGES_SRC_DIR)/*.xml)
14+
PAGES = $(subst $(PAGES_SRC_DIR)/,,$(PAGES_SRC:.xml=.html))
1315
REDIRECTS_DIR = pageredirects
1416
REDIRECTS_SRC = $(wildcard $(REDIRECTS_DIR)/*.html)
1517
REDIRECTS = $(subst $(REDIRECTS_DIR)/,,$(REDIRECTS_SRC))
1618

17-
all: index.html $(PAGES_OUT) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \
19+
all: index.html $(PAGES) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \
1820
$(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html $(REDIRECTS)
1921

20-
install: index.html $(PAGES_OUT) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \
22+
install: index.html $(PAGES) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \
2123
$(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html $(REDIRECTS)
2224
mkdir -p $(PREFIX)
2325
install -m0444 *.html $(PREFIX)
24-
install -m0444 -p -D -t $(PREFIX)/blog blog/*.html
25-
install -m0444 -p -D -t $(PREFIX)/blog/img blog/img/*.png
26-
install -m0444 -p -D -t $(PREFIX)/contributors contributors/*.html
27-
install -m0444 -p -D -t $(PREFIX)/contributors/img contributors/img/*jpg
26+
install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_TOP_DIR) $(BLOG_POST_OUT_TOP_DIR)/index.html
27+
install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR) $(BLOG_POST_OUT_DIR)/*.html
28+
install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR)/img $(BLOG_POST_OUT_DIR)/img/*.png
29+
install -m0444 -p -D -t $(PREFIX)/$(CONTRIBUTORS_OUT_DIR) $(CONTRIBUTORS_OUT_DIR)/*.html
30+
install -m0444 -p -D -t $(PREFIX)/$(CONTRIBUTORS_OUT_DIR)/img $(CONTRIBUTORS_OUT_DIR)/img/*jpg
2831
cp -p -r css $(PREFIX)
2932
cp -p -r guide $(PREFIX)
3033
cp -p -r images $(PREFIX)
3134
cp -p -r js $(PREFIX)
3235
cp -p -r plugins $(PREFIX)
3336
cp -p -r tarballs $(PREFIX)
3437

38+
3539
index.html: landing-template.xml
3640
$(SBLG) -o $@ -t landing-template.xml -c index.xml
3741

38-
$(PAGES_OUT): manual-template.xml
39-
$(SBLG) -o $@ -t manual-template.xml -c $(addprefix $PAGES_SRC_DIR)/,($(subst .html,.xml,$@))
42+
$(PAGES): manual-template.xml
43+
cp --preserve=mode,ownership,timestamps $(addprefix $(PAGES_SRC_DIR)/,$(@:.html=.xml)) .
44+
$(SBLG) -o $@ -t manual-template.xml -c $(@:.html=.xml)
45+
rm -f $(PAGES:.html=.xml)
4046

4147
themegallery.html: gallery-template.xml
4248
$(SBLG) -o $@ -t gallery-template.xml -c themegallery.xml
4349

4450
$(BLOG_POST_OUT_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/index.html $(BLOG_POSTS_OUT): $(BLOG_POSTS)
4551
$(MAKE) -C $(BLOG_POST_SRC_DIR)
46-
mkdir $(BLOG_POST_OUT_DIR)
52+
mkdir -p $(BLOG_POST_OUT_DIR)
53+
cp --preserve=mode,ownership,timestamps $(BLOG_SRC_TOP_DIR)/index.html $(BLOG_POST_OUT_TOP_DIR)/
4754
mv $(BLOG_POST_SRC_DIR)/*.html $(BLOG_POST_OUT_DIR)/
4855
mv $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/
4956
cp --preserve=mode,ownership,timestamps --recursive $(BLOG_POST_SRC_DIR)/img $(BLOG_POST_OUT_DIR)/
@@ -62,6 +69,6 @@ $(REDIRECTS): $(REDIRECTS_SRC)
6269
clean:
6370
$(MAKE) -C $(BLOG_POST_SRC_DIR) clean
6471
$(MAKE) -C $(CONTRIBUTORS_SRC_DIR) clean
65-
rm -f index.html $(PAGES_OUT) themegallery.html $(REDIRECTS)
66-
rm -r $(BLOG_POSTS_XML) $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)
72+
rm -f index.html $(PAGES) themegallery.html $(REDIRECTS)
73+
rm -r $(BLOG_POSTS_XML) $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_TOP_DIR)
6774
rm -r $(CONTRIBUTORS_XML) $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)

blogsource/content/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<head>
3+
</head>
4+
</body>
5+
<script>window.location = "http://profanity-im.github.io/blog/content/post/index.html";</script>
6+
</body>
7+
</html>

blogsource/content/post/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $(BLOG_POSTS_XML): $(BLOG_POSTS)
1818
echo "<article id=\"manual\" data-sblg-article=\"1\">" >$@
1919
echo " <header>" >>$@
2020
echo " <h3>`lowdown -X title $(subst .xml,.md,$@)`</h3>" >>$@
21-
echo " <address><a href=\"../contributors/`lowdown -X authors $(subst .xml,.md,$@)`.html\">`lowdown -X authors $(subst .xml,.md,$@)`</a></address>" >>$@
21+
echo " <address><a href=\"../../contributors/`lowdown -X authors $(subst .xml,.md,$@)`.html\">`lowdown -X authors $(subst .xml,.md,$@)`</a></address>" >>$@
2222
echo " <time datetime=\"`lowdown -X date $(subst .xml,.md,$@) | cut -f1 -dT`\">`lowdown -X date $(subst .xml,.md,$@) | cut -f1 -dT`</time>" >>$@
2323
echo " </header>" >>$@
2424
lowdown $(subst .xml,.md,$@) >>$@

blogsource/content/post/blog-post-template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</head>
1212

1313
<body id="blogpost">
14-
<img class="overlay" src="../images/profanity_mouth-only.png" alt="Profanity Illustration" />
14+
<img class="overlay" src="../../images/profanity_mouth-only.png" alt="Profanity Illustration" />
1515
<header>
1616
<h1>
1717
<a href="index.html">

0 commit comments

Comments
 (0)