summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/feed.uppxml42
-rw-r--r--share/l.upphtml30
-rw-r--r--share/man/man1/lmt.155
-rw-r--r--share/man/man1/mkws.191
-rw-r--r--share/man/man1/pp.146
-rw-r--r--share/s.uppcss119
-rw-r--r--share/sitemap.uppxml21
7 files changed, 404 insertions, 0 deletions
diff --git a/share/feed.uppxml b/share/feed.uppxml
new file mode 100644
index 0000000..3203ecf
--- /dev/null
+++ b/share/feed.uppxml
@@ -0,0 +1,42 @@
+<?xml version='"1.0"' encoding='"UTF-8"'?>
+<rss version='2.0' xmlns:atom='"http://www.w3.org/2005/Atom"' xmlns:content='http://purl.org/rss/1.0/modules/content/'>
+ <channel>
+ <title>Become Digitally Sovereign</title>
+ <link>https://copyleftculture.com</link>
+ <description>Blog posts on digital sovereignty</description>
+ <language>en-gb</language>
+ <atom:link href='"https://copyleftculture.com/feed.xml"' rel='"self"' type='"application/rss+xml"' />
+ <ttl>60</ttl>
+#!
+now=`date -R`
+#!
+ <lastBuildDate>${now}</lastBuildDate>
+#!
+for f in `ls -t blog/*.html`
+do
+if [ $(basename "${f}") != "index.html" ]; then
+ title=`sed -n 's/.*<h1>\(.*\)<\/h1>.*/\1/ip;T;q' ${f}`
+ title=${title% |*}
+ desc=`sed -n 's/.*<h2>\(.*\)<\/h2>.*/\1/ip;T;q' ${f}`
+ linque=$1/blog/$(basename "${f}")
+ pubDate=${f#blog/}
+ pubDate=${pubDate%%-*}
+ pubDate=`date -R -d ${pubDate}`
+ content=`sed -n '/<main>/,/<\/main>/{//!p;}' ${f}`
+#!
+ <item>
+ <title>${title}</title>
+ <link>${linque}</link>
+ <guid>${linque}</guid>
+ <description>${desc}</description>
+ <pubDate>${pubDate}</pubDate>
+ <content:encoded><![CDATA[${content}]]></content:encoded>
+ </item>
+#!
+fi
+done
+#!
+ </channel>
+</rss>
+
+
diff --git a/share/l.upphtml b/share/l.upphtml
new file mode 100644
index 0000000..85c8d0d
--- /dev/null
+++ b/share/l.upphtml
@@ -0,0 +1,30 @@
+<!doctype html>
+<html lang=${LANG%%_*}>
+
+<title>Copyleft Culture</title>
+
+<meta charset=${LANG##*.}>
+<meta name=viewport content='width=device-width, initial-scale=1'>
+
+<style>
+#!
+pp "${SHARE:?no theme directory set}"/s.uppcss
+#!
+</style>
+
+<nav>
+ <div class="topnav">
+ <a href="/">home</a>
+ <a href="/blog">blog</a>
+ <a href="/newsletter.html">newsletter</a>
+ <a href="/pricing.html">pricing</a>
+ <a href="/contact.html">contact</a>
+ <a href="/about.html">site</a>
+</div>
+</nav>
+
+#!
+pp "$1"
+#!
+
+
diff --git a/share/man/man1/lmt.1 b/share/man/man1/lmt.1
new file mode 100644
index 0000000..755d69b
--- /dev/null
+++ b/share/man/man1/lmt.1
@@ -0,0 +1,55 @@
+.Dd Sep 4, 2020
+.Dt lmt
+.Os
+.Sh NAME
+.Nm lmt
+.Nd last modification time
+.Sh SYNOPSIS
+.Nm lmt
+.Op Fl f Ar format
+.Ar file ...
+.Sh DESCRIPTION
+The
+.Nm
+utility prints the last modification time for the given
+.Ar file
+to standard output.
+The information displayed is obtained by calling
+.Xr lstat 2
+with the given
+argument and evaluating the returned structure.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl f Ar format
+The format in which to display the time.
+The format string may contain any of the conversion specifications
+described in the
+.Xr strftime 3
+manual page, as well as any arbitrary text.
+A newline
+.Pq Ql \en
+character is always output after the characters specified by
+the format string.
+The format string for the default display is:
+.Bd -literal -offset indent
+%a %b %e %H:%M:%S %Z %Y
+.Ed
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh EXAMPLES
+Print last modification time for
+.Pa file1
+to standard output:
+.Pp
+.Dl $ lmt file1
+.Pp
+Print last modification time for
+.Pa file1
+to standard output in ISO 8601 format:
+.Pp
+.Dl $ lmt -f "%Y-%m-%dT%H:%M:%S%z" file1
+.Sh SEE ALSO
+.Xr stat 1
+.Xr strftime 3
diff --git a/share/man/man1/mkws.1 b/share/man/man1/mkws.1
new file mode 100644
index 0000000..5ab337d
--- /dev/null
+++ b/share/man/man1/mkws.1
@@ -0,0 +1,91 @@
+.Dd Dec 13, 2019
+.Dt mkws 1
+.Os
+.Sh NAME
+.Nm mkws
+.Nd make web site
+.Sh SYNOPSIS
+.Nm
+.Ar url
+.Op path
+.Sh DESCRIPTION
+The
+.Nm
+utility uses
+.Xr pp 1
+and the theme files in the
+.Ev MKWSTHEMEPATH
+directory
+to preprocess all files in
+.Op path
+in order to produce a static web site in the current directory. If no
+.Op path
+is specified, the current directory is used instead.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Ar url
+The url of the web site. It is used for generating
+.Pa sitemap.xml
+.
+.It Op path
+The path where the unpreprocessed files are located. If no
+.Op path
+is specified, the current directory is used instead.
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width MKWSTHEMEDIR
+.It Ev MKWSTHEMEDIR
+The directory containing the theme files. See the
+.Em FILES
+section for the minimum required files for a theme. If no
+.Ev MKWSTHEMEDIR
+variable is set
+.Pa [path]/share
+wil be used.
+.It Ev LANG
+The language for the website. It will be parsed to fill in the
+.Em lang
+attribute of the
+.Em html
+element and then
+.Em charset
+.Em meta
+element.
+.El
+.Sh FILES
+.Bl -tag -width "/tmp/vi.recover
+.It Pa $MKWSTHEMEDIR/l.upphtml
+The layout file of the website. It contains the
+.Em DOCTYPE ,
+.Em html ,
+.Em head ,
+.Em title ,
+.Em meta
+,
+.Em link
+,
+.Em body
+elements.
+.It Pa $MKWSTHEMEDIR/sitemap.xml
+The
+.Pa sitemap.txt
+template.
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh EXAMPLES
+Make https://example.com web site using the unpreprocessed files in the
+current directory
+.Pp
+.Dl $ mkws https://example.com
+.Pp
+Make https://example.com web site using the unpreprocessed files in the
+.Ar ~/src/ws
+directory
+.Pp
+.Dl $ mkws https://example.com ~/src/ws
+.Sh SEE ALSO
+.Xr sh 1
+.Xr pp 1
+.Xr locale 1
diff --git a/share/man/man1/pp.1 b/share/man/man1/pp.1
new file mode 100644
index 0000000..a552c97
--- /dev/null
+++ b/share/man/man1/pp.1
@@ -0,0 +1,46 @@
+.Dd Apr 25, 2019
+.Dt pp 1
+.Os
+.Sh NAME
+.Nm pp
+.Nd preprocessor
+.Sh SYNOPSIS
+.Nm pp
+.Op Fl d
+.Ar file
+.Op args ...
+.Sh DESCRIPTION
+The
+.Nm
+utility processes
+.Ar file
+to produce output that is used as input to another
+program.
+.Pp
+It executes code enclosed in
+.Dq #!\en
+delimiters using
+.Xr sh 1 .
+.Op args ...
+are passed to the embbeded script and are available
+via the usual
+.Em $1, $2, ...
+positional parameters.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl d
+.Nm
+will dump the generated
+.Xr sh 1
+code instead of executing it. This is useful for debugging.
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh EXAMPLES
+Preprocess file with arguments:
+.Pp
+.Dl $ pp file.upphtml a b
+.Pp
+.Sh SEE ALSO
+.Xr sh 1
diff --git a/share/s.uppcss b/share/s.uppcss
new file mode 100644
index 0000000..6511972
--- /dev/null
+++ b/share/s.uppcss
@@ -0,0 +1,119 @@
+html, body{
+ font-family: sans-serif;
+ color: #ffbb55;
+ max-width: 750px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 5px;
+ background: #111;
+ }
+
+h1{
+ font-style: italic;
+ font-size: 4em;
+ text-align: center;
+ }
+
+.untertitel {
+ text-align: center;
+}
+
+p{
+ max-width: 600px;
+}
+
+/*hyperlinks*/
+/* unvisited link */
+a:link {
+ color: #ff7700;
+}
+/* visited link */
+a:visited {
+ color: #ff7700;
+}
+/* mouse over link */
+a:hover {
+ color: #111;
+ background: #f93;
+}
+/* selected link */
+a:active {
+ color: #111;
+}
+
+/* collapse section*/
+details {
+ border: 1px solid #041716;
+ border-radius: 2px;
+ padding: 0.5em 0.5em 0;
+}
+
+summary {
+ #font-weight: bold;
+ margin: -0.5em -0.5em 0;
+ padding: 0.5em;
+}
+
+details[open] {
+ padding: 0.5em;
+}
+
+details[open] summary {
+ border-bottom: 1px solid #041716;
+ margin-bottom: 0.5em;
+}
+
+.topnav {
+ overflow: hidden;
+ background-color: #ffbb55;
+ border-radius: 0.25em;
+}
+
+.topnav a {
+ float: left;
+ color: #111;
+ text-align: center;
+ padding: 14px 16px;
+ text-decoration: none;
+ font-size: 17px;
+}
+
+.topnav a:hover {
+ background-color: #f93;
+ color: #111;
+}
+
+#.topnav a.active {
+# background-color: white;
+# color: navy;
+#}
+
+/* frame around text */
+.main {
+ border: 6px double;
+ padding: 1em;
+}
+
+hr {
+ border-color: #ffbb55;
+}
+
+/* tables */
+
+table {
+ padding: 10px;
+}
+
+table.center {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+th {
+ padding-bottom: 20px;
+ padding-right: 20px;
+ padding-left: 20px;
+ border-bottom: 1px solid;
+}
+
+
diff --git a/share/sitemap.uppxml b/share/sitemap.uppxml
new file mode 100644
index 0000000..478d6b4
--- /dev/null
+++ b/share/sitemap.uppxml
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>
+#!
+for f in *.html
+do
+#!
+<url>
+#!
+loc=$1/$(basename "${f}")
+#!
+<loc>${loc}</loc>
+#!
+lastmod=$(lmt -f '%Y-%m-%dT%H:%M:%SZ' "${f}" | cut -d' ' -f1)
+#!
+<lastmod>${lastmod}</lastmod>
+<priority>1.0</priority>
+</url>
+#!
+done
+#!
+</urlset>