first commit

This commit is contained in:
systers 2020-11-20 23:59:31 +01:00
commit ea34be20d6
4 changed files with 115 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.log
pulish/
./index.html

22
cron.sh Normal file
View File

@ -0,0 +1,22 @@
date >> cron.log
echo "cronjob started!" >> cron.log
echo "" >> cron.log
# This will pump all the pads with a __PUBLISH__ tag into a folder "publish" as meta.json, txt, html and dhtml
.venv/bin/etherpump pull --meta --dhtml --html --text --publish-opt-in --publish __PUBLISH__ --pub publish --css stylesheet.css --fix-names
echo "Making the Etherpump index now ..."
# This will make an index for the dump
.venv/bin/etherpump index input \
/var/www/etherpump/publish/*.meta.json \
--order lastedited \
--reverse \
--templatepath /var/www/etherpump/templates \
--title "Varia ether-notes, magic words and curated listings." \
--output index.html | tee -a etherpump.log
echo "Done!"
# This will save a pad.css file every hour from the pad https://pad.vvvvvvaria.org/pad.css
# cp publish/pad.css /srv/etherpad-lite/src/altetherpad/src/static/skins/no-skin/pad.css

31
stylesheet.css Normal file
View File

@ -0,0 +1,31 @@
html{
border: 10px inset #9600ff;
min-height: calc(100vh - 20px);
}
body{
margin:1em;
// font-family:monospace;
font-size:16px;
line-height: 1.3;
background-color: pink;
}
#welcome{
max-width: 600px;
margin:1em 0;
}
table{
min-width: 800px;
}
th, td{
text-align: left;
padding:0 1em 0 0;
}
hr{
border:0;
border-bottom:1px solid;
margin:2em 0 1em;
}
#footer{
max-width: 600px;
}
.info{font-size: smaller;}

59
templates/index.html Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="{{ language }}">
<head>
<meta charset="utf-8" />
<title>{{ title }}</title>
<link rel="stylesheet" type="text/css" href="{% block css %}stylesheet.css{% endblock %}">
<!--<link rel="alternate" type="application/rss+xml" href="recentchanges.rss">-->
{% block scripts %}
{% endblock scripts %}
</head>
<body>
{% set padoftheday = pads | random %}
<h1>{{ title }}</h1>
<div id="welcome">
Welcome! The pages below have been deliberately published by their authors in order to share their thoughts, research and process in an early form. This page represents one of Varia's low-effort publishing tools. The pages are all produced through Varia's <a href="https://pad.vvvvvvaria.org/">Etherpad instance</a>.
<br>
<br>
Etherpad is used as collaborative writing tool to take notes, create readers, coordinate projects and document gatherings that happen in and around Varia. For example <a href="{{ padoftheday.link }}">{{ padoftheday.padid }}</a>.
<br>
<br>
This index is updated every 60 minutes.
</div>
<table>
<thead>
<tr>
<th>name</th>
<th>versions</th>
<th>last edited</th>
<th>revisions</th>
<th>authors</th>
</tr>
</thead>
<tbody>
{% for pad in pads %}
<tr>
<td class="name">
<a href="{{ pad.link }}">{{ pad.padid }}</a>
</td>
<td class="versions">
{% for v in pad.versions %}<a href="{{ v.url }}">{{ v.type }}</a> {% endfor %}
</td>
<td class="lastedited">{{ pad.lastedited_iso|datetimeformat }}</td>
<td class="revisions">{{ pad.revisions }}</td>
<td class="authors">{{ pad.author_ids|length }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div id="footer">
<hr>
<p>
<small>This page is generated using <a href="https://git.vvvvvvaria.org/varia/etherpump">Etherpump</a>. It is a command-line utility and python library that extends the multi writing and publishing functionalities of the Etherpad.</small>
<br><br>
</p>
{% block info %}<p class="info">Last updated {{ timestamp }}.</p>{% endblock %}
</div>
</body>
</html>