Comments (8)
This is indeed something to consider, I thought we had categoriesPosition
.
I think the easiest way would be to have a sidebar
option in settings.json
, what do you think @benjamincanac ?
from docus.
I would also like to know your ideas regarding naming convention for ordering. It has advantage that visually ordering is visible in file-explorer and it should be also easy to implement:
- Always sort by file name
- Remove
\d+\.
prefix for generating title and url
Benefit of sidebar
options we have full control over menu rendering and can also hide some pages that only internally need reference
from docus.
I like the idea of naming convention but I also believe that using prefix with 1.my-file.md
will lead to same issues:
- Adding a file in-between will lead to renaming a bunch of files
- We need to support inside content a way to rename the slug to remove the prefix, might be possible with a hook
Regarding hiding some pages, I worked on a draft
option directly that works well, we could also support it with filename too: 02.not-done.draft.md
for example.
I would vote for convention over configuration for sure, only thing to know is how hard would it be to implement 😀
from docus.
Adding a file in-between will lead to renaming a bunch of files
Well this is also implied by having position
prop since adding a new file requires updating all positions for disired orderer
We need to support inside content a way to rename the slug to remove the prefix, might be possible with a hook
Yeah either a hook or even rumtime method (like normalizeSlug
) might do the trick to reemove prefix. Only need a way to ensure content are sorted since i think content module currently does not do this
Regarding hiding some pages, I worked on a draft option directly that works well, we could also support it with filename too: 02.not-done.draft.md for example.
Nice idea for draft flags! Reminder maybe we should consider _*
ignore pattern?
from docus.
I thought about the _* pattern but then it may be more confusing with the prefix
from docus.
This could be nice to explore in order to remove the position
attribute for pages, do you mind taking a look at how it is achievable @farnabaz ?
from docus.
I looked at Docus and Content module, the implementation of both draft
and order convention seems straightforward.
Documents can modify using content:file:beforeInsert
hook. Thedraft
and position
can extract from file name and slug should update.
For now Docus use document path for fetch them on _.vue
.
// https://github.com/nuxtlabs/docus/blob/main/theme/pages/_.vue#L44-L45
const path = `/${app.i18n.locale}/${params.pathMatch || 'index'}`
const [document] = await $content({ deep: true }).where({ path }).fetch()
With this changes fetching document with path will be hard work and dir
+ slug
should be used.
const dir = `/${app.i18n.locale}`
const slug = params.pathMatch || 'index'
const [document] = await $content({ deep: true }).where({ dir, slug }).fetch()
from docus.
Using dir
+ slug
looks good to me :)
from docus.
Related Issues (20)
- menu not closed after route changed on mobile HOT 1
- State of Docus and how can we help? HOT 3
- Load plugin failed: pinceau/volar Error [ERR_REQUIRE_ESM]: require() of ES Module when deploying via Vercel? HOT 2
- Customizing Theme Issues HOT 1
- pinceau-transforms numerous warnings during 'generate' command - (pinceau-transforms plugin) Sourcemap is likely to be incorrect HOT 1
- Error on search on new project HOT 3
- Nested folders doesn't expand. HOT 1
- ERROR INIT A DOCUS/NUXT APP DUE TO rollup rollup.win32-x64-msvc.node module HOT 1
- SEARCH IS DONT WORKING AND WHERE IS THEME CHANGER
- Search not work. HOT 3
- 500 - Internal Server Error HOT 2
- Question HOT 1
- Is this project abandoned ? HOT 3
- shiki highlighter not working for non-default languages causes 404 HOT 3
- Fresh project error: pinceau/volar Error [ERR_REQUIRE_ESM] HOT 14
- mixing content/pages prefetch and useRoute error HOT 4
- Wondering why @nuxt/ui doesn't work with docus theme HOT 2
- German umlauts not working in DocsAsideTree HOT 1
- Getting Started error SyntaxError..UseFuseOptions..AppSearch HOT 3
- Search doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docus.