Skip to content

Commit dfa9bdd

Browse files
committed
Adding some more nice blogs to the roll and fixing styles
1 parent e1a3680 commit dfa9bdd

File tree

5 files changed

+75
-10
lines changed

5 files changed

+75
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for blogroll
22

3+
## 1.0.2 -- 2025-07-03
4+
5+
* Better css styling
6+
37
## 1.0.1 -- 2025-07-02
48

59
* Updated project naming from "feed-reader" to "blogroll" throughout

app/Main.hs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ renderHtml entries =
9494
}
9595
body {
9696
font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
97-
line-height: 1.6;
9897
max-width: 800px;
9998
margin: 0 auto;
100-
padding: 20px;
99+
padding-left: 20px;
100+
padding-right: 20px;
101101
color: #333;
102102
}
103103
h1 {
@@ -110,8 +110,8 @@ ul {
110110
padding: 0;
111111
}
112112
li {
113-
margin: 12px 0;
114-
padding: 8px;
113+
padding-left: 8px;
114+
padding-bottom: 8px;
115115
border-left: 3px solid #3498db;
116116
background: #f8f9fa;
117117
}
@@ -125,11 +125,12 @@ a:hover {
125125
}
126126
.date {
127127
color: #7f8c8d;
128-
font-size: 0.9em;
128+
font-size: 0.6em;
129129
}
130130
.source {
131131
color: #95a5a6;
132132
font-size: 0.8em;
133+
padding-left: 0.5em;
133134
}
134135
</style>
135136
</head><body>
@@ -141,12 +142,16 @@ a:hover {
141142
"""
142143
where
143144
renderEntry entry = T.concat
144-
[ "<li><a href=\"", entryLink entry, "\">"
145-
, entryTitle entry, "</a><br>"
146-
, "<span class=\"date\">", T.pack $ formatTime defaultTimeLocale "%Y-%m-%d" (entryDate entry), "</span> "
147-
, "<span class=\"source\">(", entrySiteUrl entry, ")</span></li>"
145+
[ "<li><div><a href=\"", entryLink entry, "\">"
146+
, entryTitle entry, "</a><span class=\"source\">(", extractDomain (entrySiteUrl entry), ")</span></div>"
147+
, "<div class=\"date\">", T.pack $ formatTime defaultTimeLocale "%Y-%m-%d" (entryDate entry), "</div></li>"
148148
]
149149

150+
extractDomain :: Text -> Text
151+
extractDomain url =
152+
let withoutProtocol = T.drop (T.length "https://") url
153+
in T.takeWhile (/= '/') withoutProtocol
154+
150155
main :: IO ()
151156
main = do
152157
urls <- readBlogroll "blogroll.txt"

blogroll.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name: blogroll
2020
-- PVP summary: +-+------- breaking API changes
2121
-- | | +----- non-breaking API additions
2222
-- | | | +--- code changes with no API change
23-
version: 1.0.1
23+
version: 1.0.2
2424

2525
-- A short (one-line) description of the package.
2626
-- synopsis:

blogroll.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
https://andrewkelley.me/rss.xml
22
https://mitchellh.com/feed.xml
3+
https://jezenthomas.com/feed.xml
34
https://notes.eatonphil.com/rss.xml
45
https://www.jeremykun.com/index.xml
56
https://www.dbreunig.com/feed.xml

index.html

Lines changed: 55 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)