Compare commits
No commits in common. "435cfff1c16c66c0326c10c9a3554381b973263b" and "4cab7bb6eda337757f5f846d4c5e3b1e4fbc0490" have entirely different histories.
435cfff1c1
...
4cab7bb6ed
@ -1,4 +1,3 @@
|
|||||||
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";
|
||||||
@ -22,14 +21,13 @@ type PageLinkProps = Omit<JSX.IntrinsicElements["div"], "dir" | "title"> & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function PageLink(props: PageLinkProps) {
|
function PageLink(props: PageLinkProps) {
|
||||||
const getPageCategory = () =>
|
const pageCategory = navigation.find((section) => {
|
||||||
navigation.find((section) => {
|
return section.links.some(
|
||||||
return section.links.some(
|
(link) =>
|
||||||
(link) =>
|
link.href === props.href ||
|
||||||
link.href === props.href ||
|
link.subitems.some((subitem) => subitem.href === props.href),
|
||||||
link.subitems.some((subitem) => subitem.href === props.href),
|
);
|
||||||
);
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div {...cleanProps(props, "dir", "title", "href", "subitems")}>
|
<div {...cleanProps(props, "dir", "title", "href", "subitems")}>
|
||||||
@ -45,9 +43,9 @@ function PageLink(props: PageLinkProps) {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<p class="flex flex-col gap-0">
|
<p class="flex flex-col gap-0">
|
||||||
{getPageCategory() && (
|
{pageCategory && (
|
||||||
<span class="text-violet-600 text-sm mb-1 leading-3">
|
<span class="text-violet-600 text-sm mb-1 leading-3">
|
||||||
{getPageCategory()?.title}
|
{pageCategory.title}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span class="leading-4">{props.title}</span>
|
<span class="leading-4">{props.title}</span>
|
||||||
@ -89,23 +87,13 @@ export function PrevNextLinks() {
|
|||||||
return [previousPage, nextPage];
|
return [previousPage, nextPage];
|
||||||
};
|
};
|
||||||
|
|
||||||
if (getNeighboringLinks().length === 0) return null;
|
const [previousPage, nextPage] = getNeighboringLinks();
|
||||||
|
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">
|
||||||
{getNeighboringLinks()[0] && (
|
{previousPage && <PageLink dir="previous" {...previousPage} />}
|
||||||
<PageLink
|
{nextPage && <PageLink class="ml-auto text-right" {...nextPage} />}
|
||||||
dir="previous"
|
|
||||||
{...(getNeighboringLinks()[0] as NavigationSubItem)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{getNeighboringLinks()[1] && (
|
|
||||||
<PageLink
|
|
||||||
class="ml-auto text-right"
|
|
||||||
{...(getNeighboringLinks()[1] as NavigationSubItem)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</dl>
|
</dl>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
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";
|
||||||
@ -13,10 +12,6 @@ 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,3 +1,4 @@
|
|||||||
|
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";
|
||||||
@ -8,7 +9,6 @@ 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,13 +28,6 @@ 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,12 +12,14 @@ 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.QuickLink
|
<QuickLinks>
|
||||||
title="DWWM"
|
<QuickLinks.QuickLink
|
||||||
description="Titre professionnel Développeur Web et Web Mobile"
|
title="DWWM"
|
||||||
href="certifications/dwwm"
|
description="Titre professionnel Développeur Web et Web Mobile"
|
||||||
icon="presets"
|
href="./dwwm"
|
||||||
/>
|
icon="presets"
|
||||||
|
/>
|
||||||
|
</QuickLinks>
|
||||||
|
|
||||||
## Certifications en cours de rédaction
|
## Certifications en cours de rédaction
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user