Skip to content

Commit ae7d3b6

Browse files
committed
Add CC-BY-SA footer.
1 parent 2b11627 commit ae7d3b6

4 files changed

Lines changed: 105 additions & 14 deletions

File tree

astro.config.mjs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export default defineConfig({
1010
starlight({
1111
plugins: [starlightThemeFlexoki({ accentColor: "blue" })],
1212
title: "M68k Reference",
13+
components: {
14+
// Override the default `Footer` component.
15+
Footer: "./src/components/Footer.astro",
16+
},
1317
editLink: {
1418
baseUrl: "https://github.com/markjamesm/m68k-reference/tree/main",
1519
},
@@ -25,18 +29,18 @@ export default defineConfig({
2529
},
2630
],
2731
sidebar: [
28-
{
32+
{
2933
label: "Start Here",
3034
items: [
3135
// Each item here is one entry in the navigation menu.
32-
{ label: "Getting Started", slug: "getting-started" }
36+
{ label: "Getting Started", slug: "getting-started" },
3337
],
3438
},
35-
{
39+
{
3640
label: "Reference",
3741
items: [
38-
{ label: "Overview", slug: "reference/overview" },
39-
{ label: "Manuals", slug: "reference/manuals" },
42+
{ label: "Overview", slug: "reference/overview" },
43+
{ label: "Manuals", slug: "reference/manuals" },
4044
],
4145
},
4246
{

src/components/Attribution.astro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
3+
---
4+
5+
<p>
6+
This work is licensed under <a
7+
href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a
8+
><img
9+
src="https://mirrors.creativecommons.org/presskit/icons/cc.svg"
10+
alt=""
11+
style="max-width: 1em;max-height:1em;margin-left: .2em;"
12+
/><img
13+
src="https://mirrors.creativecommons.org/presskit/icons/by.svg"
14+
alt=""
15+
style="max-width: 1em;max-height:1em;margin-left: .2em;"
16+
/><img
17+
src="https://mirrors.creativecommons.org/presskit/icons/sa.svg"
18+
alt=""
19+
style="max-width: 1em;max-height:1em;margin-left: .2em;"
20+
/>
21+
</p>

src/components/Footer.astro

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
import EditLink from 'virtual:starlight/components/EditLink';
3+
import LastUpdated from 'virtual:starlight/components/LastUpdated';
4+
import Pagination from 'virtual:starlight/components/Pagination';
5+
import config from 'virtual:starlight/user-config';
6+
import { Icon } from '@astrojs/starlight/components';
7+
import Attribution from './Attribution.astro';
8+
---
9+
10+
<footer class="sl-flex">
11+
<div class="meta sl-flex">
12+
<EditLink />
13+
<LastUpdated />
14+
</div>
15+
<Pagination />
16+
17+
<div class="copyright sl-flex">
18+
<Attribution />
19+
</div>
20+
21+
{
22+
config.credits && (
23+
<a class="kudos sl-flex" href="https://starlight.astro.build">
24+
<Icon name={'starlight'} /> {Astro.locals.t('builtWithStarlight.label')}
25+
</a>
26+
)
27+
}
28+
</footer>
29+
30+
<style>
31+
@layer starlight.core {
32+
footer {
33+
flex-direction: column;
34+
gap: 1.5rem;
35+
}
36+
.meta {
37+
gap: 0.75rem 3rem;
38+
justify-content: space-between;
39+
flex-wrap: wrap;
40+
margin-top: 3rem;
41+
font-size: var(--sl-text-sm);
42+
color: var(--sl-color-gray-3);
43+
}
44+
.meta > :global(p:only-child) {
45+
margin-inline-start: auto;
46+
}
47+
48+
.kudos {
49+
align-items: right;
50+
gap: 0.5em;
51+
margin: 1.5rem auto;
52+
font-size: var(--sl-text-xs);
53+
text-decoration: none;
54+
color: var(--sl-color-gray-3);
55+
}
56+
.kudos:hover {
57+
color: var(--sl-color-white);
58+
}
59+
60+
.copyright {
61+
align-items: right;
62+
gap: 0.5em;
63+
margin: 1.5rem auto;
64+
font-size: var(--sl-text-xs);
65+
font-style: italic;
66+
text-decoration: none;
67+
}
68+
}
69+
70+
@layer starlight.components {
71+
.kudos :global(svg) {
72+
color: var(--sl-color-orange);
73+
}
74+
}
75+
</style>

src/content/docs/index.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,3 @@ import { Aside, LinkCard, CardGrid } from '@astrojs/starlight/components';
3939
description="Consult the list of available reference manuals, in PDF format."
4040
/>
4141
</CardGrid>
42-
43-
*This work is licensed under a
44-
[Creative Commons Attribution-ShareAlike 4.0 International License][cc-by-sa].*
45-
46-
[![CC BY-SA 4.0][cc-by-sa-image]][cc-by-sa]
47-
48-
[cc-by-sa]: http://creativecommons.org/licenses/by-sa/4.0/
49-
[cc-by-sa-image]: https://licensebuttons.net/l/by-sa/4.0/88x31.png
50-
[cc-by-sa-shield]: https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg

0 commit comments

Comments
 (0)