Skip to content

Commit

Permalink
Update custom header implementation (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
huijing authored Oct 9, 2023
1 parent d10d2fc commit 7d230df
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 102 deletions.
9 changes: 3 additions & 6 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

import overrideIntegration from "./src/overrideIntegration.mjs";

// https://astro.build/config
export default defineConfig({
site: "https://paymentpointers.org",
integrations: [
overrideIntegration(),
starlight({
title: "Payment Pointers",
description:
Expand All @@ -16,6 +13,9 @@ export default defineConfig({
"./node_modules/@interledger/docs-design-system/src/styles/green-theme.css",
"./node_modules/@interledger/docs-design-system/src/styles/ilf-docs.css",
],
components: {
Header: "./src/components/Header.astro",
},
social: {
github: "https://github.com/interledger/paymentpointers.org",
},
Expand All @@ -30,9 +30,6 @@ export default defineConfig({
],
}),
],

// Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp
image: { service: { entrypoint: "astro/assets/services/sharp" } },
server: {
port: 1102,
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.10.4",
"@interledger/docs-design-system": "^0.0.13",
"@astrojs/starlight": "^0.11.0",
"@interledger/docs-design-system": "^0.0.14",
"astro": "latest",
"sharp": "^0.32.6"
}
Expand Down
22 changes: 8 additions & 14 deletions src/overrides/Header.astro → src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
import type { Props } from '@astrojs/starlight/props';
import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro";
import Search from "@astrojs/starlight/components/Search.astro";
import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro";
import SiteTitle from '@astrojs/starlight/components/SiteTitle.astro';
import SocialIcons from '@astrojs/starlight/components/SocialIcons.astro';
const { locale } = Astro.props;
import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro";
---
<div class="header sl-flex">
<SiteTitle {locale} />
<SiteTitle {...Astro.props} />
<div class="secondary-wrap">
<Search {locale} />
<div class="sl-hidden selects md:sl-flex">
<SocialIcons />
<ThemeSelect {locale} />
<Search {...Astro.props} />
<SocialIcons {...Astro.props} />
<div class="sl-hidden md:sl-flex">
<ThemeSelect {...Astro.props} />
</div>
</div>
</div>
Expand All @@ -36,11 +35,6 @@ const { locale } = Astro.props;
gap: var(--sl-nav-gap);
}

.selects {
gap: var(--sl-nav-gap);
align-items: center;
}

.site-logo {
display: flex;
align-items: center;
Expand Down
48 changes: 0 additions & 48 deletions src/overrideIntegration.mjs

This file was deleted.

8 changes: 0 additions & 8 deletions src/overrides/Search.astro

This file was deleted.

8 changes: 0 additions & 8 deletions src/overrides/SiteTitle.astro

This file was deleted.

8 changes: 0 additions & 8 deletions src/overrides/SocialIcons.astro

This file was deleted.

8 changes: 0 additions & 8 deletions src/overrides/ThemeSelect.astro

This file was deleted.

0 comments on commit 7d230df

Please sign in to comment.