From 514d31a46d1ce868507f6e7f140f64c1f13186ae Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 12 Apr 2020 21:19:22 -0400 Subject: [PATCH] feat: hide sidebar option --- client/components/admin/admin-rendering.vue | 8 +++++++- client/themes/default/components/nav-sidebar.vue | 4 ++++ client/themes/default/components/page.vue | 9 +++++++-- server/modules/rendering/markdown-core/definition.yml | 5 +++++ server/views/page.pug | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/client/components/admin/admin-rendering.vue b/client/components/admin/admin-rendering.vue index 131577df..6c2235c7 100644 --- a/client/components/admin/admin-rendering.vue +++ b/client/components/admin/admin-rendering.vue @@ -199,7 +199,13 @@ export default { query: renderersQuery, fetchPolicy: 'network-only', update: (data) => { - let renderers = _.cloneDeep(data.rendering.renderers).map(str => ({...str, config: str.config.map(cfg => ({...cfg, value: JSON.parse(cfg.value)}))})) + let renderers = _.cloneDeep(data.rendering.renderers).map(str => ({ + ...str, + config: _.sortBy(str.config.map(cfg => ({ + ...cfg, + value: JSON.parse(cfg.value) + })), [t => t.value.order]) + })) // Build tree const graph = new DepGraph({ circular: true }) const rawCores = _.filter(renderers, ['dependsOn', null]).map(core => { diff --git a/client/themes/default/components/nav-sidebar.vue b/client/themes/default/components/nav-sidebar.vue index 181120d2..35feb3cd 100644 --- a/client/themes/default/components/nav-sidebar.vue +++ b/client/themes/default/components/nav-sidebar.vue @@ -64,6 +64,10 @@ export default { mode: { type: String, default: 'browse' + }, + navMode: { + type: String, + default: 'MIXED' } }, data() { diff --git a/client/themes/default/components/page.vue b/client/themes/default/components/page.vue index ac824838..610f19d6 100644 --- a/client/themes/default/components/page.vue +++ b/client/themes/default/components/page.vue @@ -2,6 +2,7 @@ v-app(v-scroll='upBtnScroll', :dark='darkMode', :class='$vuetify.rtl ? `is-rtl` : `is-ltr`') nav-header v-navigation-drawer( + v-if='navMode !== `NONE`' :class='darkMode ? `grey darken-4-d4` : `primary`' dark app @@ -12,9 +13,9 @@ :right='$vuetify.rtl' ) vue-scroll(:ops='scrollStyle') - nav-sidebar(:color='darkMode ? `grey darken-4-d4` : `primary`', :items='sidebar') + nav-sidebar(:color='darkMode ? `grey darken-4-d4` : `primary`', :items='sidebar', :nav-mode='navMode') - v-fab-transition + v-fab-transition(v-if='navMode !== `NONE`') v-btn( fab color='primary' @@ -345,6 +346,10 @@ export default { sidebar: { type: Array, default: () => [] + }, + navMode: { + type: String, + default: 'MIXED' } }, data() { diff --git a/server/modules/rendering/markdown-core/definition.yml b/server/modules/rendering/markdown-core/definition.yml index 92a4ca15..dc58622b 100644 --- a/server/modules/rendering/markdown-core/definition.yml +++ b/server/modules/rendering/markdown-core/definition.yml @@ -11,26 +11,31 @@ props: default: true title: Allow HTML hint: Enable HTML tags in content + order: 1 linkify: type: Boolean default: true title: Automatically convert links hint: Links will automatically be converted to clickable links. + order: 2 linebreaks: type: Boolean default: true title: Automatically convert line breaks hint: Add linebreaks within paragraphs. + order: 3 typographer: type: Boolean default: false title: Typographer hint: Enable some language-neutral replacement + quotes beautification + order: 4 quotes: type: String default: English title: Quotes style hint: When typographer is enabled. Double + single quotes replacement pairs. e.g. «»„“ for Russian, „“‚‘ for German, etc. + order: 5 enum: - Chinese - English diff --git a/server/views/page.pug b/server/views/page.pug index 83ca6328..693c2abe 100644 --- a/server/views/page.pug +++ b/server/views/page.pug @@ -22,6 +22,7 @@ block body :toc=page.toc :page-id=page.id :sidebar=sidebar + nav-mode=config.nav.mode ) template(slot='contents') div(v-pre)!= page.render