Add ProseSmall as a private commentary (using %%)
This commit is contained in:
parent
3b919075ef
commit
9c69ff2903
|
|
@ -20,6 +20,7 @@ import ProseImg from '~/components/prose/ProseImg.vue';
|
|||
import ProseUl from '~/components/prose/ProseUl.vue';
|
||||
import ProseOl from '~/components/prose/ProseOl.vue';
|
||||
import ProseLi from '~/components/prose/ProseLi.vue';
|
||||
import ProseSmall from './prose/ProseSmall.vue';
|
||||
import ProseStrong from '~/components/prose/ProseStrong.vue';
|
||||
import ProseTable from '~/components/prose/ProseTable.vue';
|
||||
import ProseTag from '~/components/prose/ProseTag.vue';
|
||||
|
|
@ -49,6 +50,7 @@ const proseList = {
|
|||
"ul": ProseUl,
|
||||
"ol": ProseOl,
|
||||
"li": ProseLi,
|
||||
"small": ProseSmall,
|
||||
"strong": ProseStrong,
|
||||
"table": ProseTable,
|
||||
"tag": ProseTag,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
<template>
|
||||
<p><slot /></p>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.text-comment
|
||||
{
|
||||
@apply text-light-50;
|
||||
@apply dark:text-dark-50;
|
||||
@apply text-sm;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<template>
|
||||
<small class="text-light-60 dark:text-dark-60 text-sm italic">
|
||||
<slot />
|
||||
</small>
|
||||
</template>
|
||||
|
|
@ -160,7 +160,7 @@ export default defineNuxtConfig({
|
|||
defaults: {
|
||||
nuxtLink: {
|
||||
prefetchOn: {
|
||||
interaction: true,
|
||||
interaction: false,
|
||||
visibility: false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,11 +29,18 @@ export default defineEventHandler(async (e) => {
|
|||
setResponseStatus(e, 404);
|
||||
return;
|
||||
}
|
||||
if(session && session.user && content.private && session.user.id !== content.owner)
|
||||
if(session && session.user && session.user.id !== content.owner)
|
||||
{
|
||||
if(content.private)
|
||||
{
|
||||
setResponseStatus(e, 404);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
content.content = content.content.replace(/%%(.+)%%/g, "");
|
||||
}
|
||||
}
|
||||
if(query.type === 'view')
|
||||
{
|
||||
db.update(explorerContentTable).set({ visit: content.visit + 1 }).where(eq(explorerContentTable.path, path)).run();
|
||||
|
|
@ -43,6 +50,11 @@ export default defineEventHandler(async (e) => {
|
|||
content.content = convertFromStorableLinks(content.content);
|
||||
}
|
||||
|
||||
if(session && session.user && session.user.id !== content.owner)
|
||||
{
|
||||
content.content = content.content.replace(/%%(.+)%%/g, "");
|
||||
}
|
||||
|
||||
return { content: content.content };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ export default defineEventHandler(async (e) => {
|
|||
'type': explorerContentTable.type,
|
||||
'navigable': explorerContentTable.navigable,
|
||||
'private': explorerContentTable.private,
|
||||
'order': explorerContentTable.order,
|
||||
'visit': explorerContentTable.visit,
|
||||
}).from(explorerContentTable).where(eq(explorerContentTable.path, sql.placeholder('path'))).prepare().get({ path });
|
||||
|
||||
if(content !== undefined)
|
||||
|
|
@ -39,7 +37,11 @@ export default defineEventHandler(async (e) => {
|
|||
return;
|
||||
}
|
||||
|
||||
return content;
|
||||
return { path: content.path,
|
||||
owner: content.owner,
|
||||
title: content.title,
|
||||
type: content.type,
|
||||
};
|
||||
}
|
||||
|
||||
setResponseStatus(e, 404);
|
||||
|
|
|
|||
Loading…
Reference in New Issue