From badd07e40c80bcf8252e20b2df87af0f197f3ce1 Mon Sep 17 00:00:00 2001 From: yctct Date: Wed, 22 Apr 2026 16:44:37 +0200 Subject: First commit, add files --- share/feed.uppxml | 42 ++++++++++++++++++ share/l.upphtml | 30 +++++++++++++ share/man/man1/lmt.1 | 55 +++++++++++++++++++++++ share/man/man1/mkws.1 | 91 ++++++++++++++++++++++++++++++++++++++ share/man/man1/pp.1 | 46 +++++++++++++++++++ share/s.uppcss | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ share/sitemap.uppxml | 21 +++++++++ 7 files changed, 404 insertions(+) create mode 100644 share/feed.uppxml create mode 100644 share/l.upphtml create mode 100644 share/man/man1/lmt.1 create mode 100644 share/man/man1/mkws.1 create mode 100644 share/man/man1/pp.1 create mode 100644 share/s.uppcss create mode 100644 share/sitemap.uppxml (limited to 'share') 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 @@ + + + + Become Digitally Sovereign + https://copyleftculture.com + Blog posts on digital sovereignty + en-gb + + 60 +#! +now=`date -R` +#! + ${now} +#! +for f in `ls -t blog/*.html` +do +if [ $(basename "${f}") != "index.html" ]; then + title=`sed -n 's/.*

\(.*\)<\/h1>.*/\1/ip;T;q' ${f}` + title=${title% |*} + desc=`sed -n 's/.*

\(.*\)<\/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>/{//!p;}' ${f}` +#! + + ${title} + ${linque} + ${linque} + ${desc} + ${pubDate} + + +#! +fi +done +#! + + + + 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 @@ + + + +Copyleft Culture + + + + + + + + +#! +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 @@ + + +#! +for f in *.html +do +#! + +#! +loc=$1/$(basename "${f}") +#! +${loc} +#! +lastmod=$(lmt -f '%Y-%m-%dT%H:%M:%SZ' "${f}" | cut -d' ' -f1) +#! +${lastmod} +1.0 + +#! +done +#! + -- cgit v1.2.3