π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Add new document sizes and add link to the published documents
Smaug6739874659af54ab
diff --git a/frontend/app/composables/constants.ts b/frontend/app/composables/constants.tsindex cef448d7..ae0270ab 100644--- a/frontend/app/composables/constants.ts+++ b/frontend/app/composables/constants.ts@@ -5,12 +5,13 @@ export const DOCUMENT_THEMES = [];export const DOCUMENT_ACCESSIBILITIES: ANode[] = [- { id: 1, label: 'Visible' },+ { id: 1, label: 'Private (default)' },{ id: 2, label: 'Draft' },{ id: 3, label: 'Published' },];export const DOCUMENT_SIZES = [- { label: 'Large', id: 0 },- { label: 'Minimal', id: 1 },+ { label: 'Small', id: 0 },+ { label: 'Medium', id: 1 },+ { label: 'Large', id: 2 },];diff --git a/frontend/app/composables/useSidebarTree.ts b/frontend/app/composables/useSidebarTree.tsindex c58e7695..084956b9 100644--- a/frontend/app/composables/useSidebarTree.ts+++ b/frontend/app/composables/useSidebarTree.ts@@ -35,7 +35,7 @@ export function useSidebarTree() {parent_id: doc.parent_id || doc.category || '',label: doc.name,route: `/dashboard/docs/${doc.id}`,- icon: doc.accessibility == 1 ? 'file' : doc.accessibility == 2 ? 'draft' : 'archive',+ icon: doc.accessibility == 1 ? 'file' : doc.accessibility == 2 ? 'draft' : 'shared_doc',data: doc,show: ref(getCollapseState(doc.id)),}))diff --git a/frontend/app/helpers/icons.ts b/frontend/app/helpers/icons.tsindex 318f8c54..010d49c9 100644--- a/frontend/app/helpers/icons.ts+++ b/frontend/app/helpers/icons.ts@@ -45,6 +45,7 @@ const icons = {search: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>`,security: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m438-338 226-226-57-57-169 169-84-84-57 57 141 141Zm42 258q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>`,settings: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"/></svg>`,+ shared_doc: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M160-120q-33 0-56.5-23.5T80-200v-480h80v480h600v80H160Zm160-160q-33 0-56.5-23.5T240-360v-480h680v480q0 33-23.5 56.5T840-280H320Zm0-80h520v-400H320v400Zm80-120h160v-200H400v200Zm200 0h160v-80H600v80Zm0-120h160v-80H600v80ZM320-360v-400 400Z"/></svg>`,shortcuts: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M260-120q-58 0-99-41t-41-99q0-58 41-99t99-41h60v-160h-60q-58 0-99-41t-41-99q0-58 41-99t99-41q58 0 99 41t41 99v60h160v-60q0-58 41-99t99-41q58 0 99 41t41 99q0 58-41 99t-99 41h-60v160h60q58 0 99 41t41 99q0 58-41 99t-99 41q-58 0-99-41t-41-99v-60H400v60q0 58-41 99t-99 41Zm0-80q25 0 42.5-17.5T320-260v-60h-60q-25 0-42.5 17.5T200-260q0 25 17.5 42.5T260-200Zm440 0q25 0 42.5-17.5T760-260q0-25-17.5-42.5T700-320h-60v60q0 25 17.5 42.5T700-200ZM400-400h160v-160H400v160ZM260-640h60v-60q0-25-17.5-42.5T260-760q-25 0-42.5 17.5T200-700q0 25 17.5 42.5T260-640Zm380 0h60q25 0 42.5-17.5T760-700q0-25-17.5-42.5T700-760q-25 0-42.5 17.5T640-700v60Z"/></svg>`,snippets: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M600-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-72 0-127-45t-69-115H240v-80h164q5-22 13.5-42.5T440-600H160v-80h440q83 0 141.5 58.5T800-480q0 83-58.5 141.5T600-280Z"/></svg>`,table: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200Zm400-240v240h240v-240H520Zm0-80h240v-240H520v240Zm-80 0v-240H200v240h240Zm0 80H200v240h240v-240Z"/></svg>`,diff --git a/frontend/app/pages/(public)/doc/[id].vue b/frontend/app/pages/(public)/doc/[id].vueindex 73f82879..49a12451 100644--- a/frontend/app/pages/(public)/doc/[id].vue+++ b/frontend/app/pages/(public)/doc/[id].vue@@ -12,7 +12,13 @@<div class="doc-container"><DocumentCardHeader :doc="article" :public="true" style="margin: 20px 0" /><!-- eslint-disable-next-line vue/no-v-html -->- <article v-if="article" ref="element" :class="`${article.theme}-theme`" style="max-width: 100%" v-html="article.content_html" />+ <article+ v-if="article"+ ref="element"+ :class="`${article.theme || preferencesStore.get('theme').value}-theme`"+ style="max-width: 100%"+ v-html="article.content_html"+ /><DocumentSkeleton v-else /></div>diff --git a/frontend/app/pages/dashboard/docs/[id].vue b/frontend/app/pages/dashboard/docs/[id].vueindex f56f4cbe..d3d79d54 100644--- a/frontend/app/pages/dashboard/docs/[id].vue+++ b/frontend/app/pages/dashboard/docs/[id].vue@@ -1,7 +1,7 @@<template><div style="width: 100%; padding: 1rem 0"><div v-if="!error" style="display: flex; justify-content: space-between">- <div :style="{ maxWidth: preferencesStore.get('docSize').value == 0 ? '980px' : '810px' }" class="doc-container">+ <div :style="{ maxWidth: width }" class="doc-container"><DocumentCardHeader :doc="article" style="margin-bottom: 20px" /><!-- eslint-disable-next-line vue/no-v-html -->@@ -74,6 +74,11 @@ definePageMeta({const next = computed(() => documentsStore.getNext(article.value));const previous = computed(() => documentsStore.getPrevious(article.value));+const width = computed(() => {+ if (preferencesStore.get('docSize').value == 2) return '980px';+ if (preferencesStore.get('docSize').value == 1) return '800px';+ return '700px';+});onMounted(() => {// Keyboard shortcuts management for navigating between corresponding pagesdiff --git a/frontend/app/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue b/frontend/app/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vueindex bcb00cb5..6c89dfe0 100644--- a/frontend/app/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue+++ b/frontend/app/pages/dashboard/docs/_components/DocumentCardHeaderActionRow.vue@@ -1,5 +1,8 @@<template><span class="header">+ <NuxtLink v-if="doc.accessibility == 3" :to="`/doc/${doc.id}`" :prefetch="false" target="_blank">+ <Icon name="link" :big="true" fill="var(--font-color)" />+ </NuxtLink><NuxtLink :to="`/dashboard/docs/edit/${doc.id}`" :prefetch="false"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path