Browse Source

Hide discussion and center publication

master
Nuša Pukšič 6 months ago committed by buttercat1791
parent
commit
5a6c2bb171
  1. 15
      src/lib/components/publications/Publication.svelte
  2. 2
      src/lib/stores.ts
  3. 7
      src/routes/publication/[type]/[identifier]/+page.svelte

15
src/lib/components/publications/Publication.svelte

@ -265,9 +265,7 @@ @@ -265,9 +265,7 @@
<!-- Table of contents -->
{#if publicationType !== "blog" && !isLeaf}
<Sidebar
class="z-10 ml-4 bg-transparent sticky top-[162px] h-[calc(100vh-165px)] overflow-y-auto
border border-s-4 rounded border-primary-200 dark:border-primary-800
dark:bg-primary-1000"
class="z-10 ml-4 bg-transparent sticky top-[162px] h-[calc(100vh-165px)] overflow-y-auto"
activeUrl={`#${activeAddress ?? ""}`}
classes={{
div: 'bg-transparent',
@ -276,6 +274,7 @@ @@ -276,6 +274,7 @@
}}
>
<SidebarWrapper>
{#if $publicationColumnVisibility.toc}
<TableOfContents
{rootAddress}
{toc}
@ -287,6 +286,7 @@ @@ -287,6 +286,7 @@
}
}}
/>
{/if}
</SidebarWrapper>
</Sidebar>
{/if}
@ -295,7 +295,7 @@ @@ -295,7 +295,7 @@
<!-- Default publications -->
{#if $publicationColumnVisibility.main}
<!-- Remove overflow-auto so page scroll drives it -->
<div class="flex flex-col p-4 space-y-4 max-w-2xl flex-grow-2">
<div class="flex flex-col p-4 space-y-4 max-w-3xl flex-grow-2 mx-auto">
<div
class="card-leather bg-highlight dark:bg-primary-800 p-4 mb-4 rounded-lg border"
>
@ -371,9 +371,10 @@ @@ -371,9 +371,10 @@
{#if $publicationColumnVisibility.discussion}
<Sidebar
class="z-10 ml-4 bg-transparent sticky top-[162px] h-[calc(100vh-165px)] overflow-y-auto
border border-s-4 rounded border-primary-200 dark:border-primary-800
dark:bg-primary-1000"
class="z-10 ml-4 sticky top-[162px] h-[calc(100vh-165px)] overflow-y-auto"
classes={{
div: 'bg-transparent'
}}
>
<SidebarWrapper>
<SidebarGroup>

2
src/lib/stores.ts

@ -21,7 +21,7 @@ const defaultVisibility: PublicationLayoutVisibility = { @@ -21,7 +21,7 @@ const defaultVisibility: PublicationLayoutVisibility = {
blog: true,
main: true,
inner: false,
discussion: true,
discussion: false,
editing: false,
};

7
src/routes/publication/[type]/[identifier]/+page.svelte

@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
import type { PageProps } from "./$types";
import { onDestroy, onMount, setContext } from "svelte";
import Processor from "asciidoctor";
import ArticleNav from "$components/util/ArticleNav.svelte";
import { SveltePublicationTree } from "$lib/components/publications/svelte_publication_tree.svelte";
import { TableOfContents } from "$lib/components/publications/table_of_contents.svelte";
import { page } from "$app/state";
@ -180,12 +179,6 @@ @@ -180,12 +179,6 @@
{#if indexEvent && publicationTree && toc}
{@const debugInfo = `indexEvent: ${!!indexEvent}, publicationTree: ${!!publicationTree}, toc: ${!!toc}`}
{@const debugElement = console.debug('[Publication] Rendering publication with:', debugInfo)}
<ArticleNav
publicationType={data.publicationType}
rootId={indexEvent.id}
indexEvent={indexEvent}
/>
<Publication
rootAddress={indexEvent.tagAddress()}
publicationType={data.publicationType}

Loading…
Cancel
Save