---
/**
* The footer. Carries the feed links, because a feed nobody can find is a feed
* nobody subscribes to.
*/
import { IDENTITY, SITES, NAV_ORDER, type SiteKey } from '../config.js';
interface Props {
current: SiteKey;
}
const { current } = Astro.props;
const def = SITES[current];
// Other sections worth linking to. Empty while fav and io are unlisted, in
// which case the whole line is dropped rather than left dangling.
const elsewhere = NAV_ORDER.filter((key) => key !== current);
const year = new Date().getFullYear();
const span = year > IDENTITY.since ? `${IDENTITY.since}–${year}` : `${IDENTITY.since}`;
---
<footer class="site-footer canvas">
<div class="site-footer__inner">
<div class="site-footer__group">
{
def.feeds && (
<p class="meta">
Subscribe: <a href="/rss.xml">RSS</a> · <a href="/feed.json">JSON</a>
</p>
)
}
{
elsewhere.length > 0 && (
<p class="meta">
Elsewhere:{' '}
{elsewhere.map((key, index) => (
<>
{index > 0 && ' · '}
<a href={SITES[key].url}>{SITES[key].label}</a>
</>
))}
</p>
)
}
</div>
<p class="meta site-footer__colophon">
{span} {IDENTITY.name}
{IDENTITY.email && (
<>
{' · '}
<a href={`mailto:${IDENTITY.email}`}>{IDENTITY.email}</a>
</>
)}
<br />
<span class="site-footer__note">No analytics, no cookies, no third-party requests.</span>
</p>
</div>
</footer>
<style>
.site-footer {
margin-block-start: var(--space-3xl);
padding-block: var(--space-l) var(--space-xl);
border-block-start: 1px solid var(--rule);
}
.site-footer__inner {
grid-column: wide;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: var(--space-m);
}
.site-footer__group {
display: flex;
flex-direction: column;
gap: var(--space-3xs);
}
.site-footer__colophon {
text-align: end;
}
.site-footer__note {
color: var(--ink-faint);
}
@media (width < 34rem) {
.site-footer__colophon {
text-align: start;
}
}
</style>