-
Notifications
You must be signed in to change notification settings - Fork 98
Feat/remove persona filter #876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
348b568
feat: remove persona filter
klocke-io 288bae3
clean up package.json
klocke-io 0f0a74d
chore: reorder dependencies
klocke-io 5846b07
refactor(frontend): replace layout wrapper with slot composition
klocke-io dfea39f
chore: cleanup
klocke-io c82db91
feat: improve sidebar design
klocke-io 7eed5f5
chore: simplify sidebar code
klocke-io adec1fb
fix(vitepress): normalize taxonomy sidebar path joins
klocke-io 48f90ad
chore: clean up package-lock.json
klocke-io File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,15 @@ | ||
| import { generateSidebar } from 'vitepress-sidebar'; | ||
| import { writeJsonDebug } from './utils/debug-json.ts'; | ||
| import { | ||
| removeIndexEntries, | ||
| sortByWeight, | ||
| enhanceDirectoryTitles, | ||
| removeEmptyItems, | ||
| addTrailingSlashToLinks, | ||
| } from './utils/sidebar.ts'; | ||
|
|
||
| const communitySidbarConfig = { | ||
| documentRootPath: '/hugo/content', | ||
| scanStartPath: 'community', | ||
| resolvePath: '/community/', | ||
| collapsed: true, | ||
| useTitleFromFileHeading: true, | ||
| useTitleFromFrontmatter: true, | ||
| useFolderLinkFromIndexFile: true, | ||
| includeFolderLinksInFolder: true, | ||
| excludeFilesByFrontmatterFieldName: 'exclude', | ||
| } | ||
| import { generateWeightSortedSidebar } from './utils/sidebar.ts'; | ||
|
|
||
| export function communitySidebar(): any { | ||
| // Generate the base sidebar | ||
| const sidebar = generateSidebar([communitySidbarConfig]); | ||
|
|
||
| // Recursively enhance directory titles from frontmatter | ||
| const enhancedSidebar = enhanceDirectoryTitles(sidebar, 'community'); | ||
|
|
||
| // Sort entries by weight from frontmatter | ||
| const sortedSidebar = sortByWeight(enhancedSidebar, 'community'); | ||
|
|
||
| // Filter out all _index.md entries (called last) | ||
| const filteredSidebar = removeIndexEntries(sortedSidebar) | ||
|
|
||
| writeJsonDebug( | ||
| 'filteredCommunitySidebar.json', | ||
| filteredSidebar | ||
| ); | ||
|
|
||
| const cleandSidebar = removeEmptyItems(filteredSidebar) | ||
|
|
||
| writeJsonDebug( | ||
| 'cleandCommunitySidebar.json', | ||
| cleandSidebar | ||
| ); | ||
|
|
||
| addTrailingSlashToLinks(cleandSidebar['/community/'].items); | ||
|
|
||
| return cleandSidebar; | ||
| return generateWeightSortedSidebar({ | ||
| documentRootPath: '/hugo/content', | ||
| scanStartPath: 'community', | ||
| resolvePath: '/community/', | ||
| collapsed: true, | ||
| useTitleFromFileHeading: true, | ||
| useTitleFromFrontmatter: true, | ||
| useFolderLinkFromIndexFile: true, | ||
| useFolderTitleFromIndexFile: true, | ||
| excludeFilesByFrontmatterFieldName: 'exclude', | ||
| }); | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <script setup lang="ts"> | ||
| import { useData } from 'vitepress' | ||
| import { computed } from 'vue' | ||
|
|
||
| const { frontmatter, page } = useData() | ||
|
|
||
| const children = computed(() => frontmatter.value.taxonomyChildren as Array<{ text: string; link: string }> | undefined) | ||
|
|
||
| const pageTitle = computed(() => { | ||
| return frontmatter.value.title || page.value.title || '' | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <div v-if="children?.length" class="taxonomy-index"> | ||
| <h1>{{ pageTitle }}</h1> | ||
| <ul class="taxonomy-list"> | ||
| <li v-for="child in children" :key="child.link"> | ||
| <a :href="child.link">{{ child.text }}</a> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .taxonomy-index { | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .taxonomy-index h1 { | ||
| font-size: 2rem; | ||
| font-weight: 600; | ||
| line-height: 1.25; | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .taxonomy-list { | ||
| list-style: disc; | ||
| padding-left: 1.5rem; | ||
| } | ||
|
|
||
| .taxonomy-list li { | ||
| margin: 0.4rem 0; | ||
| } | ||
|
|
||
| .taxonomy-list a { | ||
| color: var(--vp-c-brand-1); | ||
| text-decoration: none; | ||
| font-size: 1rem; | ||
| transition: color 0.2s; | ||
| } | ||
|
|
||
| .taxonomy-list a:hover { | ||
| color: var(--vp-c-brand-2); | ||
| text-decoration: underline; | ||
| } | ||
| </style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.