Skip to content

Commit

Permalink
Breaking fixes to feeds
Browse files Browse the repository at this point in the history
* Add /feeds
* Change feed.xml -> writings.xml
  • Loading branch information
brookback committed Jan 21, 2024
1 parent e93e19b commit 337f7ac
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 73 deletions.
4 changes: 1 addition & 3 deletions src/_includes/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<nav>
<ul>
{% if not home %}<li><a href="/">Home</a></li>{% endif %}
<li><a href="/feed.xml" title="Atom">Post feed</a></li>
<li><a href="/micro.xml" title="Atom">Micro feed</a></li>
<li><a href="/reading.xml" title="Atom">Reading feed</a></li>
<li {% if '/feeds' | isCurrentPage %} aria-current="page"{% endif %}><a href="/feeds">Feeds</a></li>
</ul>
</nav>
</footer>
38 changes: 21 additions & 17 deletions src/_includes/layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ home: true
</section>

<section class="mb4">
<header class="flex items-center justify-between">
<header class="flex items-center justify-between border border-b mb2 pb2">
<h1 class="f2 mb0">On my mind</h1>

<p class="mb0 flex items-center gap f6">
Expand All @@ -22,22 +22,26 @@ home: true
</header>

<ol>
{% for note in search.pages("type=note", "date=desc", 1) %}
<li>
<h2 class="font-sans f5 fw4 mb2">
<a href="{{ note.data.url }}" class="muted">Latest: {{ note.data.date | date("PPP — HH:mm")}}</a>
</h2>
<div class="prose font-mono f6">
{{ note.data.content | excerpt | md | safe }}
</div>

{% if (note.data.content | excerpt | length) < (note.data.content | trim | length) %}
<p class="mt2 font-sans">
<a href="{{ note.data.url }}" class="muted f5">continued ⇢</a>
</p>
{% endif %}
{% for note in search.pages("type=note", "date=desc", 3) %}
<li class="mb2 pb2 relative border border-b h-entry" id="{{ note.data.url | url(true) }}">
<h2 class="font-sans f5 fw4 mb0">
<a href="{{ note.data.url }}" class="muted u-url" title="Permalink"><time class="dt-published" datetime="{{ note.data.date | date('ATOM') }}" pubdate>{{ note.data.date | date("PPP — HH:mm")}}</time></a>
</h2>

<details {% if loop.first %}open{% endif %}>
<summary style="position: absolute; right: 0; top: 0" class="btn f5">View</summary>
<div class="prose font-mono f6 mt2 text-color-contrast e-content">
{{ note.data.content | excerpt | md | safe }}
</div>

{% if (note.data.content | excerpt | length) < (note.data.content | trim | length) %}
<p class="mt2 font-sans">
<a href="{{ note.data.url }}" class="muted f5">continued ⇢</a>
</p>
{% endif %}
</details>
</li>
{% endfor %}
{% endfor %}
</ol>
</section>

Expand All @@ -55,7 +59,7 @@ home: true

<p class="mb0 flex items-center gap f6">
<a href="/writings" title="Read more">View all</a>
<a href="/feed.xml" title="Atom feed">Feed {{ comp.icon({ class: "ml1" }) | safe }}</a>
<a href="/writings.xml" title="Atom feed">Feed {{ comp.icon({ class: "ml1" }) | safe }}</a>
</p>
</header>

Expand Down
6 changes: 2 additions & 4 deletions src/_includes/layouts/main.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<link rel="stylesheet" href="/johan.css">

<!-- RSS -->
<link rel="alternate" type="application/atom+xml" title="Johan Brook: Posts feed" href="/feed.xml">
<link rel="alternate" type="application/atom+xml" title="Johan Brook: Mind feed" href="/mind.xml">
<link rel="alternate" type="application/atom+xml" title="Johan Brook: Posts feed" href="/writings.xml">
<link rel="alternate" type="application/atom+xml" title="Johan Brook: Micro feed" href="/mind.xml">
<link rel="alternate" type="application/atom+xml" title="Johan Brook: Book feed" href="/reading.xml">

<link rel="shortcut icon" href="/favicon.png" type="image/png">
Expand Down Expand Up @@ -62,8 +62,6 @@
<div class="Content{% if wide %} wide{% endif %}">
<div id="main">
{{ content | safe }}

{% include "footer.njk" %}
</div>

{% if not bare %}
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/layouts/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ layout: layouts/main.njk
<header>
<h1 itemprop="name" class="{% if link %}fw6 pt3{% else %}title{% endif %}">{{ title }}</h1>

<p class="mb0 fw5 mt3">
<time datetime="{{ date | date("ATOM") }}" itemprop="datePublished" pubdate>
<p class="mb0 fw5">
<time class="text-color-contrast" datetime="{{ date | date("ATOM") }}" itemprop="datePublished" pubdate>
{{ date | date("HUMAN_DATE") }}
</time>
{% if updated %}
Expand Down
15 changes: 9 additions & 6 deletions src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ main {
}

:focus-visible {
outline: 2px solid black;
outline: 2px solid var(--link-color);
box-shadow: 0 0 0 4px white;
border-radius: .25em;
}
Expand Down Expand Up @@ -157,6 +157,11 @@ a,
color: var(--link-color-hover);
}
}

&:is([aria-current="page"] > *):is(:focus-visible, :hover) {
cursor: default;
text-decoration: none;
}
}

p,
Expand Down Expand Up @@ -313,11 +318,9 @@ blockquote {

hr {
border: 0;
background-color: var(--hr-color);
height: .7rem;
aspect-ratio: 1 / 1;
margin: calc(var(--lineheight) * 2) 0;
border-radius: 100%;
background-color: var(--border-color);
height: 1px;
margin: var(--lineheight) 0;
}

textarea {
Expand Down
2 changes: 0 additions & 2 deletions src/css/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ FOOTER
&[aria-current="page"] {
& a {
color: var(--grey);
cursor: default;
text-decoration: none;
}
}
}
Expand Down
8 changes: 1 addition & 7 deletions src/css/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@
white-space: nowrap;
text-decoration: none;

&:hover {
color: var(--link-color-hover);
text-decoration: underline;
}

&:is(:hover, :focus-visible) {
outline: 0;
&:is(:hover, :focus-visible):not(:is([aria-current="page"] > *)) {
color: var(--link-color-hover);
text-decoration: underline;
}
Expand Down
4 changes: 0 additions & 4 deletions src/css/prose.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ PROSE
padding-left: 1em;
margin-left: 1rem;

li {
margin-bottom: var(--spacing-small);
}

&:where(ul) {
list-style-type: disc;

Expand Down
28 changes: 11 additions & 17 deletions src/css/utils.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
left: var(--inset);
}

.relative {
position: relative;
}

/*
BUTTONS
----------------------------------------------------------------*/

.btn {
appearance: none;
border: 0;
background: none;
font-family: var(--sans);
background-color: var(--btn-bg);
color: var(--btn-color);
text-decoration: none;
color: var(--link-color);
text-align: center;
text-transform: lowercase;
border-radius: 6px;
font-weight: 500;
box-shadow: currentColor 0 0 0 1px;
padding: 0.3em 0.6em;
padding: 0.2em .60em;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
Expand All @@ -30,22 +32,14 @@ BUTTONS
cursor: pointer;
}

&:hover {
text-decoration: none;
}

&:hover {
&:where(:hover, [open] *) {
text-decoration: none;
color: var(--link-color-hover);
}

&:active,
&:active {
color: var(--link-color-active);
background-color: var(--btn-bg-hover);
}

&[disabled] {
color: var(--btn-color-disabled);
color: var(--color-text-detail);
}
}

Expand Down
13 changes: 6 additions & 7 deletions src/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
--grey-lightest: hsl(173 7% 93%);

--color-bg: #fff;
--color-bg-secondary: hsl(112 29.98% 97%);
--color-bg-secondary: hsl(240 59.76% 96.52%);
--color-text: hsl(0 0% 13%);
--color-text-high-contrast: black;
--color-text-detail: var(--grey);
Expand All @@ -19,19 +19,16 @@
--link-underline-color: hsl(201.43 43.1% 56.06% / 0.47);
--border-color: var(--grey-lightest);

--btn-color: hsl(213 100% 50%);
--btn-color-hover: hsl(213 100% 41%);
--btn-color-active: hsl(213 100% 33%);
--btn-color-disabled: var(--grey);
--btn-color: var(--color-text);
--btn-bg: var(--color-bg-secondary);
--btn-bg-hover: hsl(240 59.76% 95.52%);

--focus-color: var(--link-color);

--pre-background: var(--color-bg-secondary);
--code-background: rgb(0 0 0 / 2%);
--code-color: rgb(120 94 0);

--hr-color: var(--color-text);

@supports (color: color(display-p3 1 1 1 / 1)) {
--link-color: color(display-p3 0 0.425 0.73);
--link-color-hover: color(display-p3 0.01 0.295 0.495);
Expand All @@ -54,6 +51,8 @@
--code-color: rgb(236 216 142);
--code-background: rgb(255 255 255 / 2%);

--btn-bg-hover: hsl(240 3.36% 15.51%);

@supports (color: color(display-p3 1 1 1 / 1)) {
--link-color: color(display-p3 0.38 0.742 1);
--link-color-hover: color(display-p3 0.577 0.82 0.995);
Expand Down
19 changes: 19 additions & 0 deletions src/feeds.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Feeds
layout: layouts/main.njk
menu:
visible: true
order: 5
---
<main role="main" class="posts">

<h1 class="f0 mb0">{{ title }}</h1>

<p class="subhead">Bring the feeds, here are the feeds!</p>

<ul class="flex items-center gap">
<li><a class="btn" href="/micro.xml" title="/micro.xml">Micro blog feed</a></li>
<li><a class="btn" href="/writings.xml" title="/writings.xml">Writings feed</a></li>
<li><a class="btn" href="/reading.xml" title="/reading.xml">Reading feed</a></li>
</ul>
</main>
8 changes: 4 additions & 4 deletions src/mind.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ menu:

<ol class="NotesList">
{% for post in search.pages("type=note", "date=desc") %}
<li>
<li class="h-entry" id="{{ post.data.url | url(true) }}">
<article class="Note">
<header class="mb2">
<h1 class="f4 no-rhythm mb0">
<a href="{{ post.data.url }}" title="{{ post.data.date | date('HUMAN_DATETIME') }} (permalink)" class="font-serif no-underline">
<time datetime="{{ post.data.date | date('ATOM') }}" pubdate>{{ post.data.date | date("PPP — HH:mm") }}</time> <span>#</span>
<a href="{{ post.data.url }}" title="{{ post.data.date | date('HUMAN_DATETIME') }} (permalink)" class="font-serif no-underline u-url">
<time class="dt-published" datetime="{{ post.data.date | date('ATOM') }}" pubdate>{{ post.data.date | date("PPP — HH:mm") }}</time> <span>#</span>
</a>
</h1>
{% if post.data.location %}
<p title="Posted from" class="muted font-sans mb0 f5 target">{{ post.data.location }}</p>
{% endif %}
</header>

<div class="prose">
<div class="prose e-content">
{{ post.data.content | md | safe }}
</div>
</article>
Expand Down
File renamed without changes.

0 comments on commit 337f7ac

Please sign in to comment.