Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve docs #839

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default defineConfig({
components: {
Sidebar: './src/components/Sidebar.astro',
Header: './src/components/Header.astro',
Footer: './src/components/Footer.astro',
Search: './src/components/Search.astro',
Hero: "./src/components/Hero.astro",
Head: './src/components/Head.astro',
Expand Down
8 changes: 8 additions & 0 deletions packages/docs/config/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const head = [
content: '#000'
}
},
{
tag: 'script',
attrs: {
async: true,
defer: true,
src: 'https://buttons.github.io/buttons.js'
}
}
]

export default head
52 changes: 52 additions & 0 deletions packages/docs/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
import type { Props } from '@astrojs/starlight/props';

import EditLink from '@astrojs/starlight/components/EditLink.astro';
import LastUpdated from '@astrojs/starlight/components/LastUpdated.astro';
import Pagination from '@astrojs/starlight/components/Pagination.astro';
---

<footer class="sl-flex">
<div class="meta sl-flex">
<EditLink {...Astro.props} />
<LastUpdated {...Astro.props} />
</div>
<Pagination {...Astro.props} />
<div class="github">
<span>Show your support! Star us on GitHub ⭐️</span>
<a class="github-button" href="https://github.com/oramasearch/orama" data-color-scheme="no-preference: light; light: light; dark: light;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star oramasearch/orama on GitHub">Star</a>
</div>
</footer>

<style>
footer {
flex-direction: column;
gap: 1.5rem;
}
.meta {
gap: 0.75rem 3rem;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 3rem;
font-size: var(--sl-text-sm);
color: var(--sl-color-gray-3);
}
.meta > :global(p:only-child) {
margin-inline-start: auto;
}

.github {
align-items: center;
justify-content: center;
gap: 0.5em;
margin: 2rem auto;
font-size: var(--sl-text-sm);
text-decoration: none;
display: flex;
flex-direction: column;
}
.github span {
font-size: var(--sl-text-sm);
cursor: default;
}
</style>
42 changes: 32 additions & 10 deletions packages/docs/src/components/TableOfContents.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import type { Props } from '@astrojs/starlight/props';
import TableOfContentsList from './TableOfContents/TableOfContentsList.astro';
import { Icon } from '@astrojs/starlight/components';

const { labels, toc } = Astro.props;

Expand All @@ -14,16 +15,37 @@ const showMiniBanner = Astro.props.slug.startsWith("open-source");
<nav aria-labelledby="starlight__on-this-page">
<h2 id="starlight__on-this-page">{labels['tableOfContents.onThisPage']}</h2>
<TableOfContentsList toc={toc.items} />
{showMiniBanner && <a href="/cloud" class="mini-banner hidden xl:flex">
<div class="mini-banner__icon">
<img src="/orama-icon-large.png" alt="Orama Cloud" class="w-3 h-3" />
</div>
<div class="mini-banner__text">
<strong class="text-xs">Looking for Orama Cloud docs?</strong>
<span class="text-xs">Click here</span>
</div>
</a>}
<hr class="divider" />
<a href="https://github.com/oramasearch/orama" target="_blank">
<span class="love">
<Icon name="github" />
Loving Orama? Star us!
</span>
</a>
</nav>
{showMiniBanner && <a href="/cloud" class="mini-banner hidden xl:flex">
<div class="mini-banner__icon">
<img src="/orama-icon-large.png" alt="Orama Cloud" class="w-3 h-3" />
</div>
<div class="mini-banner__text">
<strong class="text-xs">Looking for Orama Cloud docs?</strong>
<span class="text-xs">Click here</span>
</div>
</a>}
</starlight-toc>
)
}
}

<style>
.love {
font-size: var(--sl-text-xs);
display: flex;
justify-content: flex-start;
align-items: center;
gap: 0.5rem;
}
.divider {
margin: 16px 0;
opacity: 0.1;
}
</style>
Loading