Skip to content

Commit ebe4da7

Browse files
committed
wip
1 parent fd3d392 commit ebe4da7

5 files changed

Lines changed: 30 additions & 18 deletions

File tree

osmium/src/mdx-components.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { clientOnly } from "@solidjs/start";
1313
import { Callout } from "./ui/callout";
1414
import { Tabs, TabList, TabPanel, Tab } from "./ui/tabs";
1515

16-
export { EditPageLink } from "./ui/edit-page-link";
17-
export { PageIssueLink } from "./ui/page-issue-link";
1816
export { Callout } from "./ui/callout";
1917
export { QuickLinks } from "./ui/quick-links";
2018

@@ -102,7 +100,7 @@ export const h1 = (props: ParentProps) => (
102100
export const h2 = (props: ParentProps) => {
103101
return (
104102
<>
105-
<hr class="my-8 border-slate-400 dark:prose-hr:border-slate-800" />
103+
<hr class="dark:prose-hr:border-slate-800 my-8 border-slate-400" />
106104
<h2
107105
{...props}
108106
class="prose-headings:scroll-mt-28 prose-headings:font-normal lg:prose-headings:scroll-mt-34"
@@ -225,7 +223,7 @@ export const pre = (props: ParentProps) => {
225223
export const code = (props: ParentProps) => {
226224
return (
227225
<code
228-
class="not-prose inline-flex rounded-lg bg-blue-200 px-1 py-0.5 font-mono! text-[0.8em] font-semibold leading-snug text-slate-900 dark:bg-slate-600/60 dark:text-white"
226+
class="not-prose inline-flex rounded-lg bg-blue-200 px-1 py-0.5 font-mono! text-[0.8em] leading-snug font-semibold text-slate-900 dark:bg-slate-600/60 dark:text-white"
229227
{...props}
230228
>
231229
{props.children}

osmium/src/ui/docs-layout.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { Show, onMount, JSX } from "solid-js";
2-
import { useLocation } from "@solidjs/router";
1+
import { Show, onMount, JSX, createMemo } from "solid-js";
32
import { Pagination } from "./pagination";
43
import { EditPageLink } from "./edit-page-link";
54
import { PageIssueLink } from "./page-issue-link";
65
import { useOsmiumThemeFrontmatter } from "../frontmatter";
6+
import { useRouteConfig } from "../utils";
7+
import { useCurrentPageData } from "@kobalte/solidbase/client";
78

89
interface DocsLayoutProps {
910
children: JSX.Element;
@@ -12,6 +13,22 @@ interface DocsLayoutProps {
1213
export const DocsLayout = (props: DocsLayoutProps) => {
1314
const frontmatter = useOsmiumThemeFrontmatter();
1415

16+
const pageData = useCurrentPageData();
17+
const config = useRouteConfig();
18+
19+
const formatter = createMemo(
20+
() => new Intl.DateTimeFormat(undefined, config()?.lastUpdated || undefined)
21+
);
22+
23+
const date = createMemo(
24+
() =>
25+
new Date(
26+
Number.isNaN(pageData()?.lastUpdated)
27+
? 0
28+
: (pageData()?.lastUpdated ?? 0)
29+
)
30+
);
31+
1532
return (
1633
<article class="expressive-code-overrides mx-auto w-full max-w-2xl overflow-hidden pb-16">
1734
<Show when={frontmatter()?.category}>
@@ -21,13 +38,21 @@ export const DocsLayout = (props: DocsLayoutProps) => {
2138
</span>
2239
)}
2340
</Show>
24-
<h1 class="text-slate-900 prose-headings:text-[2.8rem] dark:text-white">
41+
<h1 class="prose-headings:text-[2.8rem] text-slate-900 dark:text-white">
2542
{frontmatter()?.title}
2643
</h1>
2744
<span class="-mt-[15px] block text-sm xl:hidden">
2845
<EditPageLink />
2946
</span>
3047
<div class="w-full px-1">{props.children}</div>
48+
<Show when={frontmatter()?.lastUpdated}>
49+
<span class="text-sm">
50+
Last updated:{" "}
51+
<Show when={!Number.isNaN(pageData()?.lastUpdated)} fallback="?">
52+
{formatter().format(date())}
53+
</Show>
54+
</span>
55+
</Show>
3156
<span class="text-sm xl:hidden">
3257
<PageIssueLink />
3358
</span>

osmium/src/ui/layout/main-header.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,10 @@ export function MainHeader(props: MainHeaderProps) {
101101
<ul class="order-2 col-span-2 flex w-full justify-center gap-5 pt-6 lg:col-span-1 lg:w-auto lg:pt-0">
102102
<For each={projects()}>
103103
{(p) => {
104-
const match = useMatch(() =>
105-
locale.applyPathPrefix(`${p.path}/*rest`)
106-
);
107-
108104
return (
109105
<li>
110106
<NavLink
111107
href={locale.applyPathPrefix(p.path)}
112-
data-matched={match() !== undefined ? true : undefined}
113108
onClick={() => setNavOpen(false)}
114109
active={project()?.name === p.name}
115110
>

src/routes/index.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,3 @@ This combination of features makes it a great choice to build responsive and hig
8585
_Find our API documentation under the **Reference** tab_
8686

8787
Join the [Solid community on Discord](https://discord.com/invite/solidjs) to share your projects or get help from our community!
88-
89-
<EditPageLink />
90-
<PageIssueLink />

src/routes/solid-start/index.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,3 @@ Documentation is still in beta so content is still being added to the documentat
6161

6262
If you experience any issues while using SolidStart, please let us know by [opening an issue in the SolidStart Repo](https://github.com/solidjs/solid-start/issues).
6363
Additionally, if you notice any issues or feel that something is missing in the documentation, please let us know in the [Solid Docs Repo](https://github.com/solidjs/solid-docs-next/issues).
64-
65-
<EditPageLink />
66-
<PageIssueLink />

0 commit comments

Comments
 (0)