Skip to content

Commit

Permalink
Add logo link to archivesspace.org in header
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzelip committed Nov 25, 2024
1 parent 1c7f54d commit b397512
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
3 changes: 2 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default defineConfig({
tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4 },
components: {
Footer: './src/components/overrides/Footer.astro',
Sidebar: './src/components/overrides/Sidebar.astro'
Sidebar: './src/components/overrides/Sidebar.astro',
SocialIcons: './src/components/overrides/SocialIcons.astro'
}
})
]
Expand Down
8 changes: 8 additions & 0 deletions cypress/e2e/header.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe('Header', () => {
it('links to ArchivesSpace.org alongside the Starlight SocialIcons', () => {
cy.visit('/')
cy.get(
'.page > header:first-child .social-icons > a[href="https://archivesspace.org"]'
)
})
})
38 changes: 38 additions & 0 deletions src/components/A.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
const { width } = Astro.props
// Below copied from src/images/A_logo.svg
---

<svg width={width} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 89.32 82.36">
<style>
.light {
fill: #50c0e8;
}
.medium {
fill: #00a1e1;
}
.dark {
fill: #026cb6;
}
</style>
<path
d="M26.37 82.36c4.25-5.42 10.87-8.91 18.29-8.91s14.04 3.49 18.29 8.91h26.37C83.26 63.47 65.56 49.8 44.66 49.8 23.76 49.8 6.05 63.47 0 82.36Z"
class="light"
id="path1"
transform="translate(0 -.034)"></path>
<path
d="M25.38 82.36 57.34 0H31.97L0 82.36Z"
class="medium"
id="path2"
transform="translate(0 -.034)"></path>
<path
d="M89.32 82.36 57.35 0H31.97l31.97 82.36z"
class="dark"
id="path3"
transform="translate(0 -.034)"></path>
<path
d="M87.3 77.126c-6.49-14.16-19.84-24.52-35.8-26.86l12.44 32.06h25.38z"
class="medium"
id="path4"></path>
</svg>
14 changes: 14 additions & 0 deletions src/components/HeaderA.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import A from './A.astro'
const url = 'https://archivesspace.org'
const label = 'ArchivesSpace'
// Below markup adapted from
// https://github.com/withastro/starlight/blob/main/packages/starlight/components/SocialIcons.astro
---

<a href={url} rel="me" class="sl-flex" title={label}>
<span class="sr-only">{label}</span>
<A width="1rem" />
</a>
8 changes: 8 additions & 0 deletions src/components/overrides/SocialIcons.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import type { Props } from '@astrojs/starlight/props'
import Default from '@astrojs/starlight/components/SocialIcons.astro'
import HeaderA from '../HeaderA.astro'
---

<HeaderA />
<Default {...Astro.props}><slot /></Default>

0 comments on commit b397512

Please sign in to comment.