Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
# same as netlify.toml
hugo-version: '0.148.2'
extended: true
- name: Build
run: hugo --gc --minify --buildFuture
- name: Install xmllint
run: sudo apt-get install -y libxml2-utils
- name: Validate RSS feed
run: xmllint --noout public/index.xml
31 changes: 31 additions & 0 deletions assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,35 @@ div[data-netlify-site-id] {
/* Netlify Collaborate Drawer */
display: none;
pointer-events: none;
}

/* RSS Feed Link */
.rss-feed-link {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 600;
color: $brand_mint;
text-decoration: none;
transition: color 150ms;

&:hover {
color: lighten($brand_mint, 10%);
text-decoration: none;
}

.rss-icon {
display: inline-block;
flex-shrink: 0;
width: 14px;
height: 14px;
background-color: currentColor;
-webkit-mask-image: url('/images/rss-icon.svg');
mask-image: url('/images/rss-icon.svg');
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}
}
18 changes: 18 additions & 0 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title | htmlUnescape }}</title>
<link>{{ .Permalink }}</link>
<description>{{ .Site.Params.description | htmlUnescape }}</description>
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{ end }}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<generator>Hugo v{{ hugo.Version }}</generator>
{{ with .OutputFormats.Get "RSS" }}<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />{{ end }}
{{ $posts := where .Site.RegularPages "Type" "in" (slice "blog") }}{{ range $posts }}<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<description>{{ safeHTML "<![CDATA["}}{{ chomp .Content }}{{ safeHTML "]]>"}}</description>
<guid isPermaLink="true">{{ .Permalink }}</guid>
</item>{{ end }}
</channel>
</rss>
5 changes: 3 additions & 2 deletions layouts/blog/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{{ define "main" }}
<div>
<div class="text-end mb-3">
{{ partial "rss-feed-link.html" . }}
</div>
{{ $posts := where .Site.RegularPages "Type" "in" (slice "blog") }} {{ range $posts }}
<div class="initiative_list_item__blogLanding">
{{ .Date.Format $.Site.Params.time_format_default }}
Expand All @@ -9,8 +12,6 @@ <h2 class="no-autoanchor">{{ .Title }}</h2>
<a href="{{ .Permalink }}">{{ i18n "read_more" }}</a><br />
<br />
</div>
{{ end }} {{ with .Site.Home.OutputFormats.Get "RSS" -}}
<p>{{ i18n "subscribe_rss" . | safeHTML }}</p>
{{ end }}
</div>
{{ end }}
3 changes: 3 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
<link rel="stylesheet" media="screen" href="/createx-theme/css/theme.min.css" />
{{ $style := resources.Get "/sass/main.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}?v={{ now}}" />
{{ with site.Home.OutputFormats.Get "RSS" -}}
<link rel="alternate" type="application/rss+xml" title="{{ site.Title }}" href="{{ .RelPermalink }}">
{{- end }}
</head>
6 changes: 6 additions & 0 deletions layouts/partials/rss-feed-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- with site.Home.OutputFormats.Get "RSS" -}}
<a href="{{ .RelPermalink }}" class="rss-feed-link" title="Subscribe via RSS">
<span class="rss-icon" aria-hidden="true"></span>
RSS Feed
</a>
{{- end -}}

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"/sass/main.min.dbc02a67be4848c5a28788dc616e55ab359fdc5b400346d882ed1193a94dea6e.css","MediaType":"text/css","Data":{"Integrity":"sha256-28AqZ75ISMWih4jcYW5VqzWf3FtAA0bYgu0Rk6lN6m4="}}
{"Target":"/sass/main.min.cd024e9c80ac2ff06994073b8c9aa9cf389ce7af713eca7f49c41aac00015c46.css","MediaType":"text/css","Data":{"Integrity":"sha256-zQJOnICsL/BplAc7jJqpzzic569xPsp/ScQarAABXEY="}}
Loading