alexkarle.com

Source for alexkarle.com
git clone git://git.alexkarle.com/alexkarle.com.git
Log | Files | Refs | README | LICENSE

commit 51791b5c84db4e4adcda268880f905f5a385a423 (patch)
parent ff4a9ead849225aa5d90ea4c2519cce98153138c
Author: Alex Karle <alex@alexkarle.com>
Date:   Wed, 30 Dec 2020 23:58:43 -0500

www: Change generated .7 files to .html (instead of .7.html)

I'm not 100% sure why I settled on .7.html. I think it made sense at the
time because it was the fastest way to adapt build.sh (prior to writing
the Makefile recipe), and it was the way man.openbsd.org did it.

But in reality, I don't plan on using any extension other than .7 (and
if I did the chance of a name conflict is low). I think dropping the .7
from the extension just makes the URL much cleaner looking!

Diffstat:
M.gitignore | 3+--
MMakefile | 24++++++++++++------------
Mmy-old-man.7 | 10+++++-----
3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,3 +1,2 @@ # generated html from man pages -*.[1-9].html -index.html +*.html diff --git a/Makefile b/Makefile @@ -2,14 +2,14 @@ HIDE = @ HTML := \ index.html \ - intro.7.html \ - blog.7.html \ - a-new-hope.7.html \ - domain-names.7.html \ - BLM.7.html \ - self-hosted.7.html \ - on-writing.7.html \ - my-old-man.7.html + intro.html \ + blog.html \ + a-new-hope.html \ + domain-names.html \ + BLM.html \ + self-hosted.html \ + on-writing.html \ + my-old-man.html .PHONY: build build: $(HTML) @@ -19,11 +19,11 @@ clean: rm -f $(HTML) index.html: - ln -sf intro.7.html $@ + ln -sf intro.html $@ -.SUFFIXES: .7 .7.html -.7.7.html: +.SUFFIXES: .7 .html +.7.html: @echo "mandoc $<" - $(HIDE)mandoc -Thtml -O 'man=%N.%S.html;https://man.openbsd.org/%N.%S,style=style.css' $< \ + $(HIDE)mandoc -Thtml -O 'man=%N.html;https://man.openbsd.org/%N.%S,style=style.css' $< \ | sed 's#</head>#<meta name="viewport" content="width=device-width,initial-scale=1">&# ' \ > $@ diff --git a/my-old-man.7 b/my-old-man.7 @@ -21,7 +21,7 @@ from a markdown based templated site to a based site. .Pp After pointing out that -.Lk https://alexkarle.com/git/alexkarle.com/file/intro.7.html I really did +.Lk /git/alexkarle.com/file/intro.7.html I really did rewrite my site in .Xr mdoc 7 , you might be wondering @@ -78,12 +78,12 @@ to the master branch. Doing so involved two steps. .Ss Building the mdoc I created a small Makefile that builds each HTML file from each man page source. .Pp -The relevant bit is the implicit suffix rule to convert each .7 file to .7.html: +The relevant bit is the implicit suffix rule to convert each .7 file to .html: .Bd -literal -offset indent -\).SUFFIXES: .7 .7.html -\).7.7.html: +\).SUFFIXES: .7 .html +\).7.html: @echo "mandoc $<" - $(HIDE)mandoc -Thtml -O 'man=%N.%S.html;https://man.openbsd.org/%N.%S,style=style.css' $< \\ + $(HIDE)mandoc -Thtml -O 'man=%N.html;https://man.openbsd.org/%N.%S,style=style.css' $< \\ | sed 's#</head>#<meta name="viewport" content="width=device-width,initial-scale=1">&# ' \\ > $@ .Ed