Browse Source

added open ring to articles

master
Adam Veldhousen 5 months ago
parent
commit
e9e7ae17f0
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 6DB29003C6DD1E4B
4 changed files with 85 additions and 11 deletions
  1. +2
    -0
      .gitignore
  2. +49
    -0
      assets/openring.in.html
  3. +4
    -0
      layouts/_default/single.html
  4. +30
    -11
      makefile

+ 2
- 0
.gitignore View File

@@ -1,2 +1,4 @@
resources
public
assets/css/syntax.css
layouts/partials/openring.out.html

+ 49
- 0
assets/openring.in.html View File

@@ -0,0 +1,49 @@
<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: #002a35;
min-width: 10rem;
}
.webring .summary {
font-size: 0.8rem;
flex: 1 1 0;
}
.webring .attribution {
text-align: right;
font-size: 0.8rem;
color: #eee;
}
</style>

+ 4
- 0
layouts/_default/single.html View File

@@ -9,4 +9,8 @@
<div class="post-content">{{ .Content | safeHTML }}</div>

</article>

<div id="openring">
{{ partial "openring.out.html" . }}
</div>
{{ end }}

+ 30
- 11
makefile View File

@@ -1,7 +1,13 @@
VERSION := $(shell git rev-parse --abbrev-ref HEAD)
.PHONY: clean docker-build-dev serve write
GOBIN = $(GOPATH)/bin
HUGO_BIN = $(GOBIN)/hugo
OPENRING_BIN = $(GOBIN)/openring

write: serve
serve: assets
./hugo server -D --log -w --bind 0.0.0.0

new-post:
@./hugo new posts/$${TITLE:new_post}.md

build: public
docker build -t vdhsn/blog:${VERSION} -f Dockerfile .
@@ -12,20 +18,33 @@ publish: build
test-publish: build
docker run -it -p 8080:80 vdhsn/blog:${VERSION}

new-post:
@./hugo new posts/$${TITLE:new_post}.md

docker-build-dev:
@docker build --build-arg='VERSION=0.59.1' -t hugo -f Dockerfile.dev .
@docker build --build-arg='VERSION=0.62.0' -t hugo -f Dockerfile.dev .

serve:
./hugo server -D --log -w --bind 0.0.0.0
assets: ./assets/css/syntax.css ./layouts/partials/openring.out.html

clean:
@rm -rf ./public ./resources
@rm -rf ./public ./resources ./assets/css/syntax.css ./layouts/partials/openring.out.html

.PHONY: serve new-post build publish test-publish docker-build-dev assets clean

hugo:
$(HUGO_BIN):
@go get -u --tags extended -v github.com/gohugoio/hugo

public:
$(OPENRING_BIN):
@go get -u git.sr.ht/~sircmpwn/openring

./assets/css/syntax.css:
./hugo gen chromastyles --style=solarized-dark256 > assets/css/syntax.css

./layouts/partials/openring.out.html: $(OPENRING_BIN)
openring \
-s https://drewdevault.com/feed.xml \
-s https://dave.cheney.net/feed/atom \
-s https://blog.benjojo.co.uk/rss.xml \
< ./assets//openring.in.html \
> ./layouts/partials/openring.out.html

public: ./assets/css/syntax.css ./layouts/partials/openring.out.html
./hugo --minify --gc


Loading…
Cancel
Save