fixed styling for search bar, fixed positioning for widescreens(needs testing), restricted pagefind indexing, made titles top weight, added root module description

This commit is contained in:
Xanazf 2024-10-11 16:05:44 +03:00
parent ab44ad8128
commit b65b93b5eb
Signed by: Xanazf
GPG key ID: 4E4A5AD1FB748427
11 changed files with 67 additions and 28 deletions

View file

@ -138,12 +138,12 @@ import { getQMLTypeLinkObject, getQMLTypeLink, getIconForLink } from '@src/confi
showSubResults: true, showSubResults: true,
processResult: (result: { url: string; excerpt:string; sub_results: Array<{ url: string, excerpt:string }> }) => { processResult: (result: { url: string; excerpt:string; sub_results: Array<{ url: string, excerpt:string }> }) => {
result.url = formatURL(result.url); result.url = formatURL(result.url);
result.excerpt = processExcerpt(result.excerpt)
result.sub_results = result.sub_results.map((sub_result) => { result.sub_results = result.sub_results.map((sub_result) => {
sub_result.url = formatURL(sub_result.url); sub_result.url = formatURL(sub_result.url);
sub_result.excerpt = processExcerpt(sub_result.excerpt) sub_result.excerpt = processExcerpt(sub_result.excerpt)
return sub_result; return sub_result;
}); });
result.excerpt = processExcerpt(result.excerpt)
}, },
}); });
}); });

View file

@ -33,7 +33,7 @@ const { headings, frontmatter } = Astro.props;
<slot /> <slot />
</div> </div>
</div> </div>
<TOC mobile={false} headings={headings}/> <TOC mobile={false} headings={headings} data-pagefind-ignore/>
</DocsLayout> </DocsLayout>
<TOCIntersectionObserver/> <TOCIntersectionObserver/>

View file

@ -67,8 +67,8 @@ if (url[2]) {
<Header headings={headings}/> <Header headings={headings}/>
<div class="docslayout-root"> <div class="docslayout-root">
<Nav mobile={false}/> <Nav mobile={false}/>
<div class="docslayout-inner"> <div class="docslayout-inner" data-pagefind-body>
<Breadcrumbs crumbs={customBreadcrumbs} linkTextFormat="sentence" truncated={true}> <Breadcrumbs crumbs={customBreadcrumbs} linkTextFormat="sentence" truncated={true} data-pagefind-ignore>
<svg <svg
slot="index" slot="index"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View file

@ -49,23 +49,26 @@ const sidebarData = {
const superLink = data.super ? getQMLTypeLink(data.super) : null; const superLink = data.super ? getQMLTypeLink(data.super) : null;
const details = data.details ? await processQsMarkdown(data.details) : null; const details = data.details
? await processQsMarkdown(data.details)
: null;
--- ---
<DocsLayout title={`${route.name} - ${route.type}`} description={data?.description ?? ""}> <DocsLayout title={`${route.name} - ${route.type}`} description={data?.description ?? ""}>
<div class="docs"> <div class="docs">
<div class="typedocs-content"> <div class="typedocs-content">
<hr /> <hr />
<h2 class="typedocs-title"> <h2 class="typedocs-title" data-pagefind-weight="10">
{route.name}: {route.name}:
{data.super ? ( {data.super ? (
<a <a
target="_blank" target="_blank"
href={superLink!} href={superLink!}
data-pagefind-ignore
> >
{data.super.name} {data.super.name}
</a> </a>
):( ):(
<span class="type-datatype">{data.type}</span> <span class="type-datatype" data-pagefind-ignore>{data.type}</span>
) )
} }
</h2> </h2>
@ -73,17 +76,16 @@ const details = data.details ? await processQsMarkdown(data.details) : null;
route && data ? ( route && data ? (
<section class="typedocs-data typedata"> <section class="typedocs-data typedata">
<subheading class="typedocs-subheading"> <subheading class="typedocs-subheading">
<code class="type-module">import {data.module}</code> <code class="type-module" data-pagefind-ignore>import {data.module}</code>
{data.flags ? ( {data.flags ? (
<div class="type-flags">{data.flags.map(flag => ( <div class="type-flags" data-pagefind-ignore>{data.flags.map(flag => (
<span class="type-flag"> <span class="type-flag">
<Flag client:idle/> <Flag client:idle/>
{flag} {flag}
</span> </span>
))}</div> ))}</div>
):null} ):null}
{details ? <span set:html={details}/> : null} {details ? <span class="parsedMD" set:html={details}/> : (<span class="toparse">{data.description}</span>)}
{!details ? (<span class="toparse">{data.description}</span>):null}
</subheading> </subheading>
{ data.properties && propsKeys ? ( { data.properties && propsKeys ? (
<Properties <Properties
@ -112,7 +114,7 @@ const details = data.details ? await processQsMarkdown(data.details) : null;
) : null ) : null
} }
</div> </div>
<TOC mobile={false} types={sidebarData}/> <TOC mobile={false} types={sidebarData} data-pagefind-ignore/>
</div> </div>
</DocsLayout> </DocsLayout>

View file

@ -1,6 +1,7 @@
--- ---
import DocsLayout from "@layouts/DocsLayout.astro"; import DocsLayout from "@layouts/DocsLayout.astro";
import { generateTypeData } from "@config/io/generateTypeData"; import { generateTypeData } from "@config/io/generateTypeData";
import { processQsMarkdown } from "@src/config/io/helpers";
export async function getStaticPaths() { export async function getStaticPaths() {
const routes = await generateTypeData(); const routes = await generateTypeData();
@ -24,6 +25,9 @@ export async function getStaticPaths() {
}); });
} }
const { route, children } = Astro.props; const { route, children } = Astro.props;
const details = route.data.details
? await processQsMarkdown(route.data.details)
: null;
--- ---
<DocsLayout <DocsLayout
@ -32,7 +36,7 @@ const { route, children } = Astro.props;
> >
<hr /> <hr />
<h2 class="typedocs-title">{route.type[0].toUpperCase() + route.type.slice(1)} Definitions</h2> <h2 class="typedocs-title">{route.type[0].toUpperCase() + route.type.slice(1)} Definitions</h2>
<div class="root-nav"> <div class="root-nav" data-pagefind-ignore>
{route.data.contains!.map((childName:string) => {route.data.contains!.map((childName:string) =>
( (
<div class="root-nav-entry"> <div class="root-nav-entry">
@ -46,4 +50,5 @@ const { route, children } = Astro.props;
) )
)} )}
</div> </div>
{details ? <span class="parsedMD" set:html={details}/> : (<span class="toparse">{route.data.description}</span>)}
</DocsLayout> </DocsLayout>

View file

@ -2,7 +2,7 @@
import BaseLayout from "@layouts/BaseLayout.astro"; import BaseLayout from "@layouts/BaseLayout.astro";
--- ---
<BaseLayout title="Quickshell" description="A fully user customizable desktop shell" image="/quickshell.png"> <BaseLayout title="Quickshell" description="A fully user customizable desktop shell" image="/quickshell.png">
<div class="main-page_hero"> <div class="main-page_hero" data-pagefind-ignore>
<section class="main-page_hero-text"> <section class="main-page_hero-text">
<h2>A fully <em>user-customizable</em> desktop <em>shell</em></h2> <h2>A fully <em>user-customizable</em> desktop <em>shell</em></h2>
<h3>Based on QtQuick</h3> <h3>Based on QtQuick</h3>

View file

@ -81,6 +81,7 @@ ul {
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.docs, .docs,
.docslayout-root { .docslayout-root {
gap: 0.648rem; gap: 0.648rem;
@ -88,7 +89,8 @@ ul {
.docslayout-root { .docslayout-root {
margin-left: calc(1.618rem + 260px); margin-left: calc(1.618rem + 260px);
padding-bottom: 3rem; display: flex;
flex-direction: row;
} }
.docs-content { .docs-content {
@ -109,6 +111,11 @@ ul {
} }
@media (min-width: 1280px) { @media (min-width: 1280px) {
.docs {
display: flex;
flex-direction: row;
}
.docs-content { .docs-content {
& section { & section {
max-width: 45svw; max-width: 45svw;
@ -116,7 +123,7 @@ ul {
} }
.docslayout-root { .docslayout-root {
margin-inline: calc(10svw + 260px); margin-inline: 15svw;
} }
.docslayout-inner { .docslayout-inner {

View file

@ -103,13 +103,12 @@
.nav-wrapper { .nav-wrapper {
display: block; display: block;
width: 250px; width: 250px;
position: fixed; position: sticky;
top: 5rem; top: 4rem;
bottom: 3rem;
left: 1.618rem; left: 1.618rem;
flex-shrink: 0; flex-shrink: 0;
overflow: scroll; overflow: scroll;
max-height: 90svh; max-height: calc(100svh - 8rem);
scrollbar-width: none; scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
z-index: 10; z-index: 10;

View file

@ -19,6 +19,12 @@
#qs_search .pagefind-ui__form::before { #qs_search .pagefind-ui__form::before {
--pagefind-ui-text: hsl(0 0 65); --pagefind-ui-text: hsl(0 0 65);
opacity: 1; opacity: 1;
outline: unset;
}
#qs_search .pagefind-ui--reset *:where( :not(html, iframe, canvas, img, svg, video):not(svg *,
symbol *)) {
outline: unset;
} }
#qs_search .pagefind-ui__search-input { #qs_search .pagefind-ui__search-input {
@ -47,7 +53,7 @@
content: ""; content: "";
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E") center / 50% no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E") center / 50% no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E") center / 50% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E") center / 50% no-repeat;
background-color: hsl(var(--accent-600)); background-color: hsl(0 25 45);
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -140,7 +146,7 @@
inset-block: 0; inset-block: 0;
inset-inline-start: var(--search-tree-diagram-inline-start); inset-inline-start: var(--search-tree-diagram-inline-start);
width: var(--search-tree-diagram-size); width: var(--search-tree-diagram-size);
background: hsl(var(--blue) 5 25); background: hsl(var(--blue) 10 30);
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat;
} }
@ -161,6 +167,26 @@
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
#qs_search .pagefind-ui__result-inner>.pagefind-ui__result-excerpt {
display: inline-block;
position: relative;
background: hsl(0 0 10);
padding: var(--search-result-nested-pad-block) var(--search-result-pad-inline-end);
padding-inline-start: var(--search-result-pad-inline-start);
margin-top: unset;
&::before {
content: "";
position: absolute;
inset-block: 0;
inset-inline-start: var(--search-tree-diagram-inline-start);
width: var(--search-tree-diagram-size);
background: hsl(var(--blue) 10 30);
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m'/%3E%3C/svg%3E") 0% 0% / 100% no-repeat;
}
}
#qs_search mark { #qs_search mark {
color: hsl(var(--blue) 15 60); color: hsl(var(--blue) 15 60);
background-color: transparent; background-color: transparent;

View file

@ -100,7 +100,7 @@
.toc-wrapper { .toc-wrapper {
background-color: transparent; background-color: transparent;
display: block; display: block;
position: fixed; position: sticky;
top: 5rem; top: 5rem;
right: 8svw; right: 8svw;
width: 18rem; width: 18rem;

View file

@ -113,8 +113,8 @@ html.dark {
} }
footer { footer {
position: absolute; position: sticky;
bottom: 0; bottom: -3.5rem;
z-index: 10; z-index: 10;
width: 100%; width: 100%;
height: 3.5rem; height: 3.5rem;