feat(wip): openring bulid support

This commit is contained in:
Felipe M 2022-01-04 23:06:19 +01:00
parent b8600cf29c
commit 26d42f186c
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
5 changed files with 126 additions and 6 deletions

View File

@ -17,6 +17,12 @@ jobs:
run: |
python -m pip install --upgrade poetry
poetry install
- name: openring
run: |
git clone https://git.sr.ht/~sircmpwn/openring
cd openring
go build
./openring -S ../openring/urls < ../openring/in.html > ../templates/openring.html
- name: Build site
run: make build
- name: Publish to GitHub Pages

54
openring/in.html Normal file
View File

@ -0,0 +1,54 @@
<!-- License-Id: CC0-1.0 -->
<section class="webring">
<h3>Articles from blogs I follow around the net</h3>
<section class="articles">
{{range .Articles}}
<div class="article">
<h4 class="title">
<a href="{{.Link}}" target="_blank" rel="noopener">{{.Title}}</a>
</h4>
<p class="summary">{{.Summary}}</p>
<small class="source">
via <a href="{{.SourceLink}}">{{.SourceTitle}}</a>
</small>
<small class="date">{{.Date | datef "January 2, 2006"}}</small>
</div>
{{end}}
</section>
<p class="attribution">
Generated by
<a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
</p>
</section>
<style>
.webring .articles {
display: flex;
flex-wrap: wrap;
margin: -0.5rem;
}
.webring .title {
margin: 0;
}
.webring .article {
flex: 1 1 0;
display: flex;
flex-direction: column;
margin: 0.5rem;
padding: 0.5rem;
background: #eee;
min-width: 10rem;
}
.webring .summary {
font-size: 0.8rem;
flex: 1 1 0;
}
.webring .attribution {
text-align: right;
font-size: 0.8rem;
color: #555;
}
</style>

1
openring/urls Normal file
View File

@ -0,0 +1 @@
https://drewdevault.com/feed.xml

View File

@ -6,13 +6,14 @@
{% block page_title %}{{ this.title }} | {{ super() }}{% endblock %}
{% block main_content %}
{{ render_blog_post(this) }}
<div class="block-info">
If you want to approach me directly about this post use the most appropriate channel
from <a href="{{ '/about'|url }}">the about page</a>.
</div>
{{ render_blog_post(this) }}
<div class="block-info">
If you want to approach me directly about this post use the most appropriate channel
from <a href="{{ '/about'|url }}">the about page</a>.
</div>
{% include "openring.html" %}
{% endblock %}
{% block endbody %}
{{ super() }}
{{ super() }}
{% endblock %}

58
templates/openring.html Normal file
View File

@ -0,0 +1,58 @@
<section class="webring">
<h3>Articles from blogs I follow around the net</h3>
<section class="articles">
<div class="article">
<h4 class="title">
<a href="https://drewdevault.com/2021/12/30/Language-design-considerations.html" target="_blank"
rel="noopener">Breaking down a small language design proposal</a>
</h4>
<p class="summary">
We are developing a new systems programming language. The name is a secret, so
well call it xxxx instead. In xxxx, we have a general requirement that all variables
must be initialized. This is fine for the simple case, such as “let x: int =
10”. But, it doe…</p>
<small class="source">
via <a href="https://drewdevault.com">Drew DeVault&#39;s blog</a>
</small>
<small class="date">December 30, 2021</small>
</div>
</section>
<p class="attribution">
Generated by
<a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
</p>
</section>
<style>
.webring .articles {
display: flex;
flex-wrap: wrap;
margin: -0.5rem;
}
.webring .title {
margin: 0;
}
.webring .article {
flex: 1 1 0;
display: flex;
flex-direction: column;
margin: 0.5rem;
padding: 0.5rem;
background: #eee;
min-width: 10rem;
}
.webring .summary {
font-size: 0.8rem;
flex: 1 1 0;
}
.webring .attribution {
text-align: right;
font-size: 0.8rem;
color: #555;
}
</style>