Skip to content

Commit 4fafba9

Browse files
everton-dgndependabot[bot]kodiakhq[bot]KipzonderKop101amirhhashemi
authored
Fix intermittent tab titles on overview pages (#1390)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: KipZonderKop101 <80620930+KipzonderKop101@users.noreply.github.com> Co-authored-by: Amir Hossein Hashemi <87268103+amirhhashemi@users.noreply.github.com>
1 parent cabf1e9 commit 4fafba9

File tree

10 files changed

+19
-21
lines changed

10 files changed

+19
-21
lines changed

scripts/collections/build-file-tree.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export async function buildFileTree(entry = COLLECTIONS_ROOT) {
4444
const file = await fs.readFile(entryPath, "utf-8");
4545
const parentSection = await getDirData(path.resolve(parentSegment));
4646

47-
const { title, mainNavExclude, isDeprecated } = matter(file).data;
47+
const { title, nav_title, mainNavExclude, isDeprecated } =
48+
matter(file).data;
4849

4950
/**
5051
* @todo
@@ -61,7 +62,7 @@ export async function buildFileTree(entry = COLLECTIONS_ROOT) {
6162
.replace(/\.mdx?/, ""),
6263
slug: path.basename(entryPath, path.extname(entryPath)),
6364
parent: parentSection.title,
64-
title,
65+
title: nav_title ?? title,
6566
mainNavExclude,
6667
isDeprecated,
6768
isTranslated: true,

scripts/create-i18n-entries.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ async function buildSectionList(entryList = [], locale, project = "") {
4040
);
4141

4242
if (existsSync(i18nEntryPath + ".mdx")) {
43-
const { title, isDeprecated } = await getFrontMatterData(
43+
const { title, nav_title, isDeprecated } = await getFrontMatterData(
4444
i18nEntryPath + ".mdx"
4545
);
4646

4747
sectionList.push({
4848
...entry,
4949
path: path.join(locale, entry.path),
50-
title,
50+
title: nav_title ?? title,
5151
isDeprecated,
5252
isTranslated: true,
5353
});

src/routes/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: Overview
2+
title: Solid Docs
3+
nav_title: Overview
4+
titleTemplate: ":title"
35
mainNavExclude: true
46
use_cases: >-
57
getting started, learning solid, understanding framework, first project,

src/routes/solid-meta/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: Overview
2+
title: Solid Meta Docs
3+
nav_title: Overview
4+
titleTemplate: ":title"
35
mainNavExclude: true
46
use_cases: >-
57
managing head tags, seo optimization, document metadata, dynamic meta tags,

src/routes/solid-router/concepts/data.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"nesting.mdx",
99
"layouts.mdx",
1010
"alternative-routers.mdx",
11-
"queries.mdx",
1211
"actions.mdx"
1312
]
1413
}

src/routes/solid-router/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: Overview
2+
title: Solid Router Docs
3+
nav_title: Overview
4+
titleTemplate: ":title"
35
use_cases: >-
46
understanding routing, learning basics, overview needed, getting started, spa
57
routing concepts

src/routes/solid-router/reference/primitives/use-match.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ function FileInfo() {
148148

149149
## Related
150150

151-
- [`useParams`](/reference/primitives/use-params)
152-
- [`useLocation`](/reference/primitives/use-location)
151+
- [`useParams`](/solid-router/reference/primitives/use-params)
152+
- [`useLocation`](/solid-router/reference/primitives/use-location)

src/routes/solid-start/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: Overview
2+
title: SolidStart Docs
3+
nav_title: Overview
4+
titleTemplate: ":title"
35
use_cases: >-
46
getting started, new projects, learning solidstart, framework overview,
57
architecture decisions

src/solidbase-theme/Layout.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@ import { NotFound } from "~/ui/not-found";
66
import { I18nProvider } from "~/i18n/i18n-context";
77
import { useThemeListener } from "@kobalte/solidbase/client";
88
import { usePace } from "@kobalte/solidbase/default-theme/pace.js";
9-
import { Title } from "@solidjs/meta";
10-
import { useProjectTitle } from "~/ui/use-project";
119

1210
export default function (props: RouteSectionProps) {
1311
useThemeListener();
1412
usePace();
15-
const projectTitle = useProjectTitle();
1613

1714
return (
1815
<I18nProvider>
19-
<Title>{projectTitle()}</Title>
2016
<ErrorBoundary fallback={() => <NotFound />}>
2117
<Layout>{props.children}</Layout>
2218
</ErrorBoundary>

src/ui/docs-layout.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { Show, onMount, JSX } from "solid-js";
22
import { useLocation } from "@solidjs/router";
3-
import { Title } from "@solidjs/meta";
43
import { coreEntries } from "solid:collection";
54
import { Pagination } from "~/ui/pagination";
65
import { EditPageLink } from "./edit-page-link";
76
import { PageIssueLink } from "./page-issue-link";
8-
import { useProjectTitle } from "./use-project";
97

108
interface DocsLayoutProps {
119
entries: typeof coreEntries;
@@ -14,7 +12,6 @@ interface DocsLayoutProps {
1412

1513
export const DocsLayout = (props: DocsLayoutProps) => {
1614
const location = useLocation();
17-
const projectTitle = useProjectTitle();
1815

1916
const collection = () =>
2017
location.pathname.includes("/reference/")
@@ -41,9 +38,6 @@ export const DocsLayout = (props: DocsLayoutProps) => {
4138
return (
4239
<Show when={props.entries} keyed>
4340
<>
44-
<Show when={titles()?.title} fallback={<Title>SolidDocs</Title>}>
45-
{(title) => <Title>{`${title()} - ${projectTitle()}`}</Title>}
46-
</Show>
4741
<article class="expressive-code-overrides mx-auto w-full max-w-2xl overflow-hidden pb-16">
4842
<Show when={titles()?.parent}>
4943
{(t) => (

0 commit comments

Comments
 (0)