merge branches
This commit is contained in:
commit
8b05e196d8
|
@ -1,8 +1,11 @@
|
|||
TEMPDIR=/tmp/openbsd-webzine/
|
||||
|
||||
generate-site: clean
|
||||
ls | grep issue- | sort -n | xargs ./make_issue.sh
|
||||
./make_issue.sh _index ../public/index.html
|
||||
generate-site:
|
||||
ls | grep issue- | sort -n | xargs tools/make_issue.sh
|
||||
tools/make_issue.sh _index ../public/index.html
|
||||
tools/sitemap.sh webzine.puffy.cafe ../public/ > ../public/sitemap.xml
|
||||
gzip -9 -c ../public/sitemap.xml > ../public/sitemap.gz
|
||||
tools/atom.sh webzine.puffy.cafe > ../public/atom.xml
|
||||
|
||||
all: generate-site
|
||||
|
||||
|
@ -11,12 +14,12 @@ clean:
|
|||
|
||||
test:
|
||||
mkdir -p ${TEMPDIR}
|
||||
./make_issue.sh current ${TEMPDIR}/current-issue.html
|
||||
tools/make_issue.sh current ${TEMPDIR}/current-issue.html
|
||||
xdg-open ${TEMPDIR}/current-issue.html
|
||||
|
||||
testsite: clean
|
||||
ls | grep issue- | sort -n | xargs ./make_issue.sh -t
|
||||
./make_issue.sh _index ../public/index.html
|
||||
ls | grep issue- | sort -n | xargs tools/make_issue.sh -t
|
||||
tools/make_issue.sh _index ../public/index.html
|
||||
mkdir -p ${TEMPDIR}
|
||||
cp -fr ../public ${TEMPDIR}/
|
||||
xdg-open ${TEMPDIR}/public/index.html
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<title>OpenBSD_WEBZINE_ISSUE #__ISSUE__</title>
|
||||
<style>
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
domain="$1"
|
||||
|
||||
# exit if no public issue found
|
||||
ls ../public/issue-*.html >/dev/null 2>&1
|
||||
|
||||
date_updated=$(date +%Y-%m-%dT%TZ)
|
||||
|
||||
cat <<EOF
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<id>https://${domain}/log/</id>
|
||||
<title>OpenBSD Webzine</title>
|
||||
<icon>https://${domain}/favicon.png</icon>
|
||||
<link rel="alternate" type="text/html" href="https://${domain}/" />
|
||||
<link rel="self" type="application/atom+xml" href="https://${domain}/atom.xml" />
|
||||
<author>
|
||||
<name>OpenBSD Webzine contributors</name>
|
||||
</author>
|
||||
<updated>${date_updated}</updated>
|
||||
EOF
|
||||
|
||||
for page in ../public/issue-*.html ; do
|
||||
issue=$(echo $page | grep -oE "issue\-[0-9]+")
|
||||
title=$(echo $issue | awk -F '-' '{ print "Issue #"$NF }')
|
||||
. ./$issue/metadata.sh
|
||||
tag="$(echo -n ${issue} | sha256)"
|
||||
|
||||
cat <<EOF
|
||||
<entry>
|
||||
<title type="text">${title}</title>
|
||||
<id>tag:${domain},2021:${tag}</id>
|
||||
<updated>${PUBLISHED_DATE}</updated>
|
||||
<link rel="alternate" type="text/html" href="https://${domain}/${issue}.html" />
|
||||
<content type="html">
|
||||
<![CDATA[
|
||||
$(cat $page)
|
||||
]]>
|
||||
</content>
|
||||
</entry>
|
||||
EOF
|
||||
done
|
||||
|
||||
echo "</feed>"
|
|
@ -25,7 +25,9 @@ test -d "$DIR" || usage
|
|||
test -d ../public/ || die "You must run this from openbsd-webzine/current"
|
||||
ls $DIR/*.html 2>&1 >/dev/null || die "no html file in $DIR"
|
||||
|
||||
if [ $testsite -eq 0 ] && [ "$(stat -f '%i' $DIR)" -eq "$CURINODE" ]
|
||||
. ./${DIR}/metadata.sh
|
||||
|
||||
if [ "$(stat -f '%i' $DIR)" -eq "$CURINODE" ]
|
||||
then
|
||||
DEST=dev
|
||||
else
|
||||
|
@ -44,4 +46,4 @@ issue="${1#issue-}"
|
|||
sed -i "s/__ISSUE__/${issue}/g" $DESTFILENAME
|
||||
|
||||
# replace date
|
||||
sed -i "s/__DATE__/$(date -u)/" $DESTFILENAME
|
||||
sed -i "s/__DATE__/${PUBLISHED_DATE}/" $DESTFILENAME
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
ndd="$1"
|
||||
|
||||
printf '%s\n' \
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
|
||||
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
|
||||
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
|
||||
|
||||
cd "$2"
|
||||
find . -name \*.html | while read -r l
|
||||
do
|
||||
link="$(printf "%s" ${l} | cut -d'/' -f2-)"
|
||||
printf '<url><loc>%s</loc><lastmod>%s</lastmod></url>\n' \
|
||||
"https://${ndd}/${link}"\
|
||||
"$(date -r $(stat -f %m ${l}) +%Y-%m-%d)"
|
||||
done
|
||||
|
||||
printf '%s' '</urlset>'
|
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 577 B |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,13 @@
|
|||
/* SITE */
|
||||
Site name : OpenBSD Webzine
|
||||
Site url : https://webzine.puffy.cafe
|
||||
Built with (CMS) : coffee, tea and love
|
||||
Created on : 2021
|
||||
Language : English
|
||||
Hosted by : prx's house
|
||||
|
||||
/* AUTHORS */
|
||||
See contributors on https://tildegit.org/solene/openbsd-webzine
|
||||
|
||||
/* LINKS */
|
||||
Follow (ATOM) : https://webzine.puffy.cafe/atom.xml
|
|
@ -0,0 +1,4 @@
|
|||
User-agent: *
|
||||
Disallow:
|
||||
Crawl-delay: 2
|
||||
Sitemap: https://webzine.puffy.cafe/sitemap.gz
|
Loading…
Reference in New Issue