Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sections numberings #1228

Merged
merged 24 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e1f75d4
fix: section numbers being hidden on certain breakpoints.
ItzNotABug Aug 18, 2024
8733dd0
Merge branch 'main' into fix-sections-numberings
ItzNotABug Aug 18, 2024
50a5cb2
update: lockfile
ItzNotABug Aug 18, 2024
b8f1850
Merge branch 'main' into fix-sections-numberings
ItzNotABug Aug 19, 2024
a2c190f
fix: reduce padding only to the quick-start docs.
ItzNotABug Aug 21, 2024
f91e55e
merge: main.
ItzNotABug Aug 21, 2024
e3a6dc7
Merge branch 'main' into fix-sections-numberings
ItzNotABug Aug 21, 2024
fb8758d
Revert pnpm-lock.yaml to its state on the main branch
ItzNotABug Aug 21, 2024
0beed31
update: use `page.route.id`.
ItzNotABug Aug 21, 2024
4b91b38
Merge branch 'main' into fix-sections-numberings
ItzNotABug Aug 22, 2024
724c3a7
update: only resize on content using section + numbers.
ItzNotABug Aug 22, 2024
25d82bf
Merge branch 'main' into fix-sections-numberings
ItzNotABug Aug 23, 2024
5af3322
Merge branch 'main' into fix-sections-numberings
ItzNotABug Nov 25, 2024
f879842
Merge branch 'main' into fix-sections-numberings
ItzNotABug Nov 25, 2024
2fd47e0
Merge branch 'main' into fix-sections-numberings
ItzNotABug Nov 26, 2024
1eb0216
Merge branch 'main' into fix-sections-numberings
ItzNotABug Nov 27, 2024
af7dafc
update: addressed comments.
ItzNotABug Dec 12, 2024
6aecba8
Merge branch 'fix-sections-numberings' of https://github.com/ItzNotAB…
ItzNotABug Dec 12, 2024
0236040
Merge branch 'main' into fix-sections-numberings
ItzNotABug Dec 12, 2024
28764a3
Merge branch 'fix-sections-numberings' of https://github.com/ItzNotAB…
ItzNotABug Dec 12, 2024
6f21b87
ran: formatter.
ItzNotABug Dec 12, 2024
ac66458
address comments.
ItzNotABug Dec 12, 2024
12f1ace
Merge branch 'main' into fix-sections-numberings
ItzNotABug Dec 12, 2024
fa0df07
Merge branch 'main' into fix-sections-numberings
TorstenDittmann Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/lib/layouts/DocsArticle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
</script>

<script lang="ts">
import { scrollToTop } from '$lib/actions/scrollToTop';

import { setContext } from 'svelte';
import { writable } from 'svelte/store';
import { Feedback } from '$lib/components';
import { scrollToTop } from '$lib/actions/scrollToTop';

export let title: string;
export let toc: Array<TocItem>;
export let back: string | undefined = undefined;
export let date: string | undefined = undefined;

const reducedArticleSize = setContext('articleHasNumericBadge', writable(false));
</script>

<main class="contents" id="main">
Expand Down Expand Up @@ -59,8 +62,9 @@
</div>
<div class="web-article-header-end" />
</header>
<div class="web-article-content">
<div class="web-article-content" class:web-reduced-article-size={$reducedArticleSize}>
<slot />

<Feedback {date} />
</div>
<aside class="web-references-menu ps-6">
Expand Down Expand Up @@ -110,3 +114,12 @@
</aside>
</article>
</main>

<style>
@media (min-width: 1280px) and (max-width: 1330px) {
.web-reduced-article-size {
/* original/default is 41.5rem */
max-inline-size: 40.5rem;
}
}
</style>
6 changes: 6 additions & 0 deletions src/markdoc/tags/Section.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<script lang="ts">
import { type Writable } from 'svelte/store';
import Heading from '../nodes/Heading.svelte';
import { getContext, hasContext } from 'svelte';

export let id: string;
export let step: number;
export let title: string;

if (hasContext('articleHasNumericBadge')) {
getContext<Writable<boolean>>('articleHasNumericBadge').set(true);
}
</script>

<section class="web-article-content-section is-with-line">
Expand Down
Loading