Skip to content

Commit c18cf9a

Browse files
authored
add RSS to TPEN (#74)
* test feed * f * Update feed.xml * Testing with readers * moving feed link * Adjust post cover banner styles Update .post-cover-image-banner for better responsiveness and consistent appearance: use background-size: contain and center the background; replace fixed height with a responsive height (min(40vw, 350px)); remove margins, border-radius and box-shadow; set display:block. These changes prevent image cropping and standardize the banner layout across viewports.
1 parent 60a508b commit c18cf9a

7 files changed

Lines changed: 58 additions & 17 deletions

File tree

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ show_downloads: false
66
markdown: kramdown
77
highlighter: rouge
88
google_analytics: G-630J3K9FNK
9+
plugins:
10+
- jekyll-feed
911
defaults:
1012
-
1113
scope:

_includes/feed-xslt-inject.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% capture xslt %}<?xml-stylesheet type="text/xsl" href="/assets/rss-feed.xsl"?>
2+
{% endcapture %}
3+
{{ xslt | strip_newlines }}
4+
{{ content }}

_includes/head-custom.html

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->
2-
3-
<!-- Setup Google Analytics -->
4-
<!-- Google tag (gtag.js) -->
5-
{% if site.google_analytics %}
6-
<script>
7-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
8-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
9-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
10-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
11-
ga('create', '{{ site.google_analytics }}', 'auto');
12-
ga('send', 'pageview');
13-
</script>
14-
{% endif %}
15-
<!-- You can set your favicon here -->
2+
<link type="application/atom+xml" rel="alternate" href="{{ site.url }}{{ site.baseurl }}/feed.xml" title="{{ site.title }}" />
163
<link rel="shortcut icon" type="image/x-icon" href="{{ '/assets/icons/favicon.ico' | relative_url }}">
174
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png">
185
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32x32.png">
196
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16x16.png">
207
<link rel="manifest" href="/site.webmanifest">
218
<!-- end custom head snippets -->
9+

_layouts/default.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ <h1 style="margin: 0;"><a href="{{ "/" | absolute_url }}" style="text-decoration
100100
<a href="{{ "/privacy" | absolute_url }}">Read our privacy statement.</a>
101101
&midcir;
102102
<a href="https://github.com/CenterForDigitalHumanities/TPEN3">Read code on GitHub.com.</a>
103+
&midcir;
104+
<a href="{{ "/feed.xml" | absolute_url }}" title="RSS Feed" style="vertical-align: middle;">
105+
<i class="bi bi-rss-fill" style="color: orange; font-size: 1.3em; vertical-align: middle;"></i> RSS
106+
</a>
103107
</footer>
104108
</div>
105109
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>

assets/css/main.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ h3 {
111111
}
112112
.post-cover-image-banner {
113113
background-image: var(--bg-image);
114-
background-size: cover;
115-
background-position: top center;
114+
background-size: contain;
115+
background-position: center center;
116116
background-attachment: fixed;
117-
height: 300px;
118117
width: 100%;
118+
height: min(40vw, 350px);
119+
margin: 0;
120+
border-radius: 0;
121+
box-shadow: none;
122+
display: block;
119123
position: relative;
120124
}
121125

feed.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: null
3+
---
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<rss version="2.0">
6+
<channel>
7+
<title>{{ site.title | xml_escape }}</title>
8+
<link>{{ site.url }}{{ site.baseurl }}</link>
9+
<description>{{ site.description | xml_escape }}</description>
10+
{% for post in site.posts %}
11+
<item>
12+
<title>{{ post.title | xml_escape }}</title>
13+
<link>{{ site.url }}{{ post.url }}</link>
14+
<description>{{ post.excerpt | xml_escape }}</description>
15+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
16+
<guid>{{ site.url }}{{ post.url }}</guid>
17+
</item>
18+
{% endfor %}
19+
</channel>
20+
</rss>

pages/updates.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: default
3+
title: Updates
4+
permalink: /updates/
5+
---
6+
<div class="rss-header" style="display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem;">
7+
<img src="/assets/img/logo.png" alt="TPEN Logo" class="rss-logo" style="height: 60px;"/>
8+
<span class="rss-title" style="font-size: 2rem; color: var(--primary-color);">{{ site.title }} Updates</span>
9+
</div>
10+
<ul class="rss-list" style="list-style: none; padding: 0;">
11+
{% for post in site.posts %}
12+
<li style="margin-bottom: 2rem; border-bottom: 1px solid var(--gray); padding-bottom: 1rem;">
13+
<a href="{{ post.url | relative_url }}" style="font-size:1.2rem; color: var(--link);"><strong>{{ post.title }}</strong></a>
14+
<div class="rss-date" style="color: var(--gray); font-size: 0.9rem;">{{ post.date | date: "%B %d, %Y" }}</div>
15+
<div class="rss-desc" style="margin-top: 0.5rem;">{{ post.excerpt }}</div>
16+
</li>
17+
{% endfor %}
18+
</ul>
19+
<p style="margin-top:2rem;"><a href="/feed.xml"><i class="bi bi-rss-fill" style="color: orange; font-size: 1.3em; vertical-align: middle;"></i> Subscribe via RSS</a></p>

0 commit comments

Comments
 (0)