eratic / packages / core / src / components / SiteFooter.astro
237 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
/**
 * 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>

static mirror of HEAD · about · clone: git clone https://git.makefuture.ro/eratic.git