Compare commits
2 Commits
4cab7bb6ed
...
435cfff1c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 435cfff1c1 | |||
| 4625a92206 |
@ -1,3 +1,4 @@
|
|||||||
|
import type { NavigationSubItem } from "@/libs/navigation";
|
||||||
import type { JSX } from "solid-js";
|
import type { JSX } from "solid-js";
|
||||||
|
|
||||||
import { usePageContext } from "vike-solid/usePageContext";
|
import { usePageContext } from "vike-solid/usePageContext";
|
||||||
@ -21,7 +22,8 @@ type PageLinkProps = Omit<JSX.IntrinsicElements["div"], "dir" | "title"> & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function PageLink(props: PageLinkProps) {
|
function PageLink(props: PageLinkProps) {
|
||||||
const pageCategory = navigation.find((section) => {
|
const getPageCategory = () =>
|
||||||
|
navigation.find((section) => {
|
||||||
return section.links.some(
|
return section.links.some(
|
||||||
(link) =>
|
(link) =>
|
||||||
link.href === props.href ||
|
link.href === props.href ||
|
||||||
@ -43,9 +45,9 @@ function PageLink(props: PageLinkProps) {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<p class="flex flex-col gap-0">
|
<p class="flex flex-col gap-0">
|
||||||
{pageCategory && (
|
{getPageCategory() && (
|
||||||
<span class="text-violet-600 text-sm mb-1 leading-3">
|
<span class="text-violet-600 text-sm mb-1 leading-3">
|
||||||
{pageCategory.title}
|
{getPageCategory()?.title}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span class="leading-4">{props.title}</span>
|
<span class="leading-4">{props.title}</span>
|
||||||
@ -87,13 +89,23 @@ export function PrevNextLinks() {
|
|||||||
return [previousPage, nextPage];
|
return [previousPage, nextPage];
|
||||||
};
|
};
|
||||||
|
|
||||||
const [previousPage, nextPage] = getNeighboringLinks();
|
if (getNeighboringLinks().length === 0) return null;
|
||||||
if (!nextPage && !previousPage) return null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<dl class="mt-12 flex gap-4 border-t border-slate-200 pt-6">
|
<dl class="mt-12 flex gap-4 border-t border-slate-200 pt-6">
|
||||||
{previousPage && <PageLink dir="previous" {...previousPage} />}
|
{getNeighboringLinks()[0] && (
|
||||||
{nextPage && <PageLink class="ml-auto text-right" {...nextPage} />}
|
<PageLink
|
||||||
|
dir="previous"
|
||||||
|
{...(getNeighboringLinks()[0] as NavigationSubItem)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{getNeighboringLinks()[1] && (
|
||||||
|
<PageLink
|
||||||
|
class="ml-auto text-right"
|
||||||
|
{...(getNeighboringLinks()[1] as NavigationSubItem)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import type { JSXElement } from "solid-js";
|
import type { JSXElement } from "solid-js";
|
||||||
|
|
||||||
import { TableOfContents } from "@/partials/TableOfContents";
|
// import { TableOfContents } from "@/partials/TableOfContents";
|
||||||
import { PrevNextLinks } from "@/components/PrevNextLinks";
|
import { PrevNextLinks } from "@/components/PrevNextLinks";
|
||||||
import { usePageContext } from "vike-solid/usePageContext";
|
import { usePageContext } from "vike-solid/usePageContext";
|
||||||
|
import { clientOnly } from "vike-solid/clientOnly";
|
||||||
import { clock } from "solid-heroicons/outline";
|
import { clock } from "solid-heroicons/outline";
|
||||||
import { navigation } from "@/libs/navigation";
|
import { navigation } from "@/libs/navigation";
|
||||||
import { Prose } from "@/components/Prose";
|
import { Prose } from "@/components/Prose";
|
||||||
@ -12,6 +13,10 @@ type DocsLayoutProps = {
|
|||||||
children: JSXElement;
|
children: JSXElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const TableOfContents = clientOnly(
|
||||||
|
async () => (await import("@/partials/TableOfContents")).TableOfContents,
|
||||||
|
);
|
||||||
|
|
||||||
export function DocsLayout(props: DocsLayoutProps) {
|
export function DocsLayout(props: DocsLayoutProps) {
|
||||||
const pageContext = usePageContext();
|
const pageContext = usePageContext();
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import type { SectionCache } from "@/services/DocCache";
|
|
||||||
import type { PageContext } from "vike/types";
|
import type { PageContext } from "vike/types";
|
||||||
|
|
||||||
import { useConfig } from "vike-solid/useConfig";
|
import { useConfig } from "vike-solid/useConfig";
|
||||||
@ -9,6 +8,7 @@ export type Data = Awaited<ReturnType<typeof data>>;
|
|||||||
|
|
||||||
export async function data(pageContext: PageContext) {
|
export async function data(pageContext: PageContext) {
|
||||||
const config = useConfig();
|
const config = useConfig();
|
||||||
|
await docCache.waitingForCache(20000);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
exports: { frontmatter },
|
exports: { frontmatter },
|
||||||
@ -28,6 +28,13 @@ export async function data(pageContext: PageContext) {
|
|||||||
|
|
||||||
const doc = docCache.get(cachePathname);
|
const doc = docCache.get(cachePathname);
|
||||||
|
|
||||||
|
if (!doc) {
|
||||||
|
console.error(
|
||||||
|
`DocCache: No doc found for ${cachePathname}. This is a bug!`,
|
||||||
|
"Please report it to the maintainers.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sections: doc?.sections || [],
|
sections: doc?.sections || [],
|
||||||
frontmatter,
|
frontmatter,
|
||||||
|
|||||||
@ -12,14 +12,12 @@ Découvre donc de bons conseils pour t'aider à te préparer au mieux !
|
|||||||
|
|
||||||
## Certifications couvertes sur le Memento
|
## Certifications couvertes sur le Memento
|
||||||
|
|
||||||
<QuickLinks>
|
<QuickLinks.QuickLink
|
||||||
<QuickLinks.QuickLink
|
|
||||||
title="DWWM"
|
title="DWWM"
|
||||||
description="Titre professionnel Développeur Web et Web Mobile"
|
description="Titre professionnel Développeur Web et Web Mobile"
|
||||||
href="./dwwm"
|
href="certifications/dwwm"
|
||||||
icon="presets"
|
icon="presets"
|
||||||
/>
|
/>
|
||||||
</QuickLinks>
|
|
||||||
|
|
||||||
## Certifications en cours de rédaction
|
## Certifications en cours de rédaction
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user