~ecs/ecs.d2evs.net

a19efbd70efbed267862a6ad7c021bdc341b862b — Eyal Sawady 5 months ago 86b2216
Add webring
6 files changed, 78 insertions(+), 6 deletions(-)

M .gitignore
M Makefile
M _templates/page.html.w
A _templates/webring-in.html
M nginx.conf
M static/style.css
M .gitignore => .gitignore +1 -0
@@ 1,1 1,2 @@
_site
_templates/webring-out.html

M Makefile => Makefile +19 -4
@@ 1,12 1,27 @@
.POSIX:

upload:
	wersh . _site
blogs=\
	https://xkcd.com/atom.xml \
	https://drewdevault.com/feed.xml \
	https://www.youtube.com/feeds/videos.xml?channel_id=UCqJ-Xo29CKyLTjn6z2XwYAw \
	https://emersion.fr/blog/rss.xml \
	https://danluu.com/atom.xml \
	https://aphyr.com/posts.atom \
	https://sourcehut.org/blog/index.xml \
	https://tonsky.me/blog/atom.xml \

local: gen
	doas cp -r _site/* /var/www/localhost

upload: gen
	rsync -r _site/ ecs@d2evs.net:/var/www/ecs.d2evs.net

local:
gen:
	@printf "openring <_templates/webring-in.html >_templates/webring-out.html\n"
	@openring $$(for blog in $(blogs); do echo "-s $$blog"; done) \
		<_templates/webring-in.html \
		>_templates/webring-out.html
	wersh . _site
	doas cp -r _site/* /var/www/localhost

clean:
	rm -rf _site

M _templates/page.html.w => _templates/page.html.w +2 -1
@@ 1,6 1,6 @@
% render() {
<!doctype html>
<html lang="en">
<html lang="en" charset="utf-8">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1">
% echo "<meta name=\"description\" content=\"$(get_description "$input")\">"


@@ 19,5 19,6 @@
% echo "<h1>${title:-ecs's blog}</h1>"
% cat
	</main>
% cat "$root/_templates/webring-out.html"
</body>
% }

A _templates/webring-in.html => _templates/webring-in.html +54 -0
@@ 0,0 1,54 @@
<section class="webring">
  <h4>Posts from RSS feeds I follow around the net</h4>
  <section class="articles">
    {{range .Articles}}
    <div class="article">
      <h5 class="title">
        <a href="{{.Link}}" target="_blank" rel="noopener">{{.Title}}</a>
      </h5>
      <p class="summary">{{.Summary}}</p>
      <small class="source">
        via <a href="{{.SourceLink}}">{{.SourceTitle}}</a>
      </small>
      <small class="date">{{.Date | date}}</small>
    </div>
    {{end}}
  </section>
  <p class="attribution">
    Generated by
    <a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
  </p>
</section>
<style>
.webring {
  font-size: 80%;
}
.webring .articles {
  display: flex;
}
.webring .title {
  margin: 0;
}
.webring .article {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  margin: 0 0.5rem;
  padding: 0.5rem;
}
.webring .article:first-child {
  margin-left: 0;
}
.webring .article:last-child {
  margin-right: 0;
}
.webring .summary {
  font-size: 0.8rem;
  flex: 1 1 0;
}
.webring .attribution {
  text-align: right;
  font-size: 0.8rem;
  color: #777;
}
</style>

M nginx.conf => nginx.conf +1 -0
@@ 18,6 18,7 @@ server {
	server_name ecs.d2evs.net;
	ssl_certificate /etc/ssl/uacme/d2evs.net/cert.pem;
	ssl_certificate_key /etc/ssl/uacme/private/d2evs.net/key.pem;
	charset utf-8;

	gzip on;


M static/style.css => static/style.css +1 -1
@@ 42,7 42,7 @@ a:hover {
  background-color: #111;
  color: #888;
  text-align: center;
  padding: 5px 8px;
  padding: 5px 9px;
}

.time {