mirror of
https://github.com/sern-handler/website
synced 2026-06-06 01:16:47 +00:00
feat: move nav links (Plugins/Sponsors/Blog) to SiteTitle for Mobile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,7 +5,6 @@ dist/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
sern-handler
|
||||
|
||||
# logs
|
||||
npm-debug.log*
|
||||
|
||||
@@ -2,7 +2,6 @@ import { defineConfig } from 'astro/config';
|
||||
import starlight from '@astrojs/starlight';
|
||||
import starlightBlog from 'starlight-blog';
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
import starlightDocSearch from '@astrojs/starlight-docsearch';
|
||||
import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc';
|
||||
|
||||
export default defineConfig({
|
||||
@@ -13,8 +12,9 @@ export default defineConfig({
|
||||
discord: 'https://discord.gg/DwbF5H5JgQ',
|
||||
},
|
||||
components: {
|
||||
ThemeSelect: './src/components/ThemeSelect.astro',
|
||||
Head: './src/components/Head.astro',
|
||||
Head: './src/overrides/Head.astro',
|
||||
SiteTitle: './src/overrides/SiteTitle.astro',
|
||||
ThemeSelect: './src/overrides/ThemeSelect.astro',
|
||||
},
|
||||
logo: {
|
||||
src: './src/assets/logo/navbar-icon.png',
|
||||
@@ -44,11 +44,6 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
starlightDocSearch({
|
||||
appId: 'AA9S5J9NYT',
|
||||
apiKey: 'ccfe6abc4d12ac6f882565a9d0caafb1',
|
||||
indexName: 'sern',
|
||||
}),
|
||||
starlightBlog({
|
||||
authors: {
|
||||
jacoobes: {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.5.10",
|
||||
"@astrojs/starlight": "^0.22.1",
|
||||
"@astrojs/starlight-docsearch": "^0.1.0",
|
||||
"@astrojs/starlight-tailwind": "^2.0.2",
|
||||
"@astropub/md": "^0.4.0",
|
||||
"@expressive-code/plugin-line-numbers": "^0.35.3",
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
// Reference: https://github.com/HiDeoo/starlight-blog/blob/924b20ce0dd5f71eb2416fefed8a5134586893d8/packages/starlight-blog/overrides/ThemeSelect.astro#L10
|
||||
// Have to override Starlight ThemeSelect component to add custom links in the header.
|
||||
import type { Props } from "@astrojs/starlight/props";
|
||||
import StarlightThemeSelect from "starlight-blog/overrides/ThemeSelect.astro";
|
||||
---
|
||||
|
||||
<div>
|
||||
<a href="/guide/walkthrough/new-project">Docs</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/plugins">Plugins</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/sponsors">Sponsors</a>
|
||||
</div>
|
||||
<StarlightThemeSelect {...Astro.props}>
|
||||
<slot />
|
||||
</StarlightThemeSelect>
|
||||
|
||||
<style>
|
||||
div {
|
||||
border-inline-end: 1px solid var(--sl-color-gray-5);
|
||||
display: none;
|
||||
padding-inline-end: 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 50rem) {
|
||||
div {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--sl-color-text-accent);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
@@ -41,13 +41,13 @@ title: "SernAutocompleteData"
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4493
|
||||
node\_modules/discord.js/typings/index.d.ts:4711
|
||||
|
||||
***
|
||||
|
||||
### descriptionLocalizations?
|
||||
|
||||
> `optional` **descriptionLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **descriptionLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -55,7 +55,7 @@ node\_modules/discord.js/typings/index.d.ts:4493
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4494
|
||||
node\_modules/discord.js/typings/index.d.ts:4712
|
||||
|
||||
***
|
||||
|
||||
@@ -69,13 +69,13 @@ node\_modules/discord.js/typings/index.d.ts:4494
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4491
|
||||
node\_modules/discord.js/typings/index.d.ts:4709
|
||||
|
||||
***
|
||||
|
||||
### nameLocalizations?
|
||||
|
||||
> `optional` **nameLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **nameLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -83,7 +83,7 @@ node\_modules/discord.js/typings/index.d.ts:4491
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4492
|
||||
node\_modules/discord.js/typings/index.d.ts:4710
|
||||
|
||||
***
|
||||
|
||||
@@ -97,7 +97,7 @@ node\_modules/discord.js/typings/index.d.ts:4492
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4495
|
||||
node\_modules/discord.js/typings/index.d.ts:4713
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ node\_modules/discord-api-types/payloads/v10/\_interactions/\_applicationCommand
|
||||
|
||||
### description\_localizations?
|
||||
|
||||
> `optional` **description\_localizations**: `null` \| `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **description\_localizations**: `null` \| `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -55,7 +55,7 @@ node\_modules/discord-api-types/payloads/v10/\_interactions/\_applicationCommand
|
||||
|
||||
### name\_localizations?
|
||||
|
||||
> `optional` **name\_localizations**: `null` \| `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **name\_localizations**: `null` \| `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ title: "SernSubCommandGroupData"
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4496
|
||||
node\_modules/discord.js/typings/index.d.ts:4714
|
||||
|
||||
***
|
||||
|
||||
@@ -35,13 +35,13 @@ node\_modules/discord.js/typings/index.d.ts:4496
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4493
|
||||
node\_modules/discord.js/typings/index.d.ts:4711
|
||||
|
||||
***
|
||||
|
||||
### descriptionLocalizations?
|
||||
|
||||
> `optional` **descriptionLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **descriptionLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -49,7 +49,7 @@ node\_modules/discord.js/typings/index.d.ts:4493
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4494
|
||||
node\_modules/discord.js/typings/index.d.ts:4712
|
||||
|
||||
***
|
||||
|
||||
@@ -63,13 +63,13 @@ node\_modules/discord.js/typings/index.d.ts:4494
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4491
|
||||
node\_modules/discord.js/typings/index.d.ts:4709
|
||||
|
||||
***
|
||||
|
||||
### nameLocalizations?
|
||||
|
||||
> `optional` **nameLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
> `optional` **nameLocalizations**: `Partial`\<`Record`\<`"id"` \| `"en-US"` \| `"en-GB"` \| `"bg"` \| `"zh-CN"` \| `"zh-TW"` \| `"hr"` \| `"cs"` \| `"da"` \| `"nl"` \| `"fi"` \| `"fr"` \| `"de"` \| `"el"` \| `"hi"` \| `"hu"` \| `"it"` \| `"ja"` \| `"ko"` \| `"lt"` \| `"no"` \| `"pl"` \| `"pt-BR"` \| `"ro"` \| `"ru"` \| `"es-ES"` \| `"es-419"` \| `"sv-SE"` \| `"th"` \| `"tr"` \| `"uk"` \| `"vi"`, `null` \| `string`\>\>
|
||||
|
||||
#### Inherited from
|
||||
|
||||
@@ -77,7 +77,7 @@ node\_modules/discord.js/typings/index.d.ts:4491
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4492
|
||||
node\_modules/discord.js/typings/index.d.ts:4710
|
||||
|
||||
***
|
||||
|
||||
@@ -101,7 +101,7 @@ node\_modules/discord.js/typings/index.d.ts:4492
|
||||
|
||||
#### Source
|
||||
|
||||
node\_modules/discord.js/typings/index.d.ts:4495
|
||||
node\_modules/discord.js/typings/index.d.ts:4713
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Release 1.2.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
date: 2022-09-28
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
## Class-based modules
|
||||
|
||||
@@ -4,6 +4,7 @@ title: How to get started with sern!
|
||||
authors: [ethan]
|
||||
tags: [guides]
|
||||
date: 2022-09-30
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
## Hello everyone!
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Release 2.0.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
date: 2022-12-13
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
## 2.0 Release
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Release 2.5.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
date: 2023-01-12
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
## 2.5 Release
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Release 3.0.0
|
||||
authors: [jacoobes]
|
||||
tags: [release]
|
||||
date: 2023-06-18
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
## 3.0 Release
|
||||
|
||||
@@ -4,6 +4,7 @@ title: New logo!
|
||||
authors: [sern]
|
||||
tags: [branding]
|
||||
date: 2023-07-04
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
Hey everyone! Today we have very special news for you all: We're changing our logo!
|
||||
|
||||
@@ -4,6 +4,7 @@ title: Deploying sern with Railway
|
||||
authors: [duro]
|
||||
tags: [guides]
|
||||
date: 2024-02-23
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
In this guide, I'll be showing you how to deploy your sern bot with [Railway](https://railway.app/).
|
||||
|
||||
70
src/overrides/SiteTitle.astro
Normal file
70
src/overrides/SiteTitle.astro
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
// Heavily inspired from https://github.com/tauri-apps/tauri-docs/blob/v2/src/components/overrides/SiteTitle.astro
|
||||
import StarlightSiteTitle from "@astrojs/starlight/components/SiteTitle.astro";
|
||||
import type { Props } from "@astrojs/starlight/props";
|
||||
|
||||
interface Link {
|
||||
name: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const links: Link[] = [
|
||||
{
|
||||
name: "Docs",
|
||||
href: "/guide/walkthrough/new-project",
|
||||
},
|
||||
{
|
||||
name: "Plugins",
|
||||
href: "/plugins",
|
||||
},
|
||||
{
|
||||
name: "Sponsors",
|
||||
href: "/sponsors",
|
||||
},
|
||||
{
|
||||
name: "Blog",
|
||||
href: "/blog",
|
||||
},
|
||||
];
|
||||
---
|
||||
|
||||
<>
|
||||
<StarlightSiteTitle {...Astro.props}><slot /></StarlightSiteTitle>
|
||||
<starlight-select class="md:hidden flex items-center align-center gap-4 ml-4">
|
||||
<label class="flex items-center align-center">
|
||||
<select class="py-2 cursor-pointer bg-transparent font-semibold">
|
||||
<option value="" disabled selected>Menu</option>
|
||||
{links.map((link) => <option value={link.href} set:html={link.name} />)}
|
||||
</select>
|
||||
</label>
|
||||
</starlight-select>
|
||||
<nav class="hidden md:flex items-center gap-4 ps-4">
|
||||
{
|
||||
links.map((link) => (
|
||||
<a
|
||||
class="text-[var(--sl-color-text-accent)] font-semibold no-underline"
|
||||
href={link.href}
|
||||
>
|
||||
{link.name}
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</nav>
|
||||
</>
|
||||
|
||||
<script>
|
||||
class StarlightLanguageSelect extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
const select = this.querySelector("select");
|
||||
if (select) {
|
||||
select.addEventListener("change", (e) => {
|
||||
if (e.currentTarget instanceof HTMLSelectElement) {
|
||||
window.location.pathname = e.currentTarget.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
customElements.define("starlight-select", StarlightLanguageSelect);
|
||||
</script>
|
||||
6
src/overrides/ThemeSelect.astro
Normal file
6
src/overrides/ThemeSelect.astro
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
import type { Props } from "@astrojs/starlight/props";
|
||||
import StarlightThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro";
|
||||
---
|
||||
|
||||
<StarlightThemeSelect {...Astro.props}><slot /></StarlightThemeSelect>
|
||||
Reference in New Issue
Block a user