diff --git a/src/App.vue b/src/App.vue index 29f3a14..28f3a45 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,12 +13,10 @@ import DisplayHeader from '@/components/landing/DisplayHeader/DisplayHeader.vue' const route = useRoute(); +const isCategoryPage = computed(() => /^\/[^/]+\/[^/]+$/.test(route.path)); + const activeItem = computed(() => { if (route.path === '/') return 'home'; return null; }); - -const isCategoryPage = computed(() => { - return /^\/[^/]+\/[^/]+$/.test(route.path); -}); diff --git a/src/components/code/CodeExample.vue b/src/components/code/CodeExample.vue index cc41b9f..d805c26 100644 --- a/src/components/code/CodeExample.vue +++ b/src/components/code/CodeExample.vue @@ -28,10 +28,9 @@ -
+
Nothing here yet! - - +
@@ -47,7 +46,6 @@ const props = defineProps<{ }>(); const skipKeys = ['cli']; - const expandedSections = ref>(new Set()); const codeEntries = computed(() => { @@ -72,102 +70,29 @@ const toggleExpanded = (name: string) => { }; const getDisplayName = (name: string) => { - if (name === 'code') return 'Code'; - if (name === 'cli') return 'CLI Command'; - if (name === 'utility') return 'Utility'; - if (name === 'usage') return 'Usage'; - if (name === 'installation') return 'Installation'; - return name.charAt(0).toUpperCase() + name.slice(1); + const displayNames: Record = { + code: 'Code', + cli: 'CLI Command', + utility: 'Utility', + usage: 'Usage', + installation: 'Installation' + }; + return displayNames[name] || name.charAt(0).toUpperCase() + name.slice(1); }; const getLanguage = (name: string) => { - if (name === 'cli') return 'bash'; - if (name === 'code') return 'html'; - if (name === 'usage') return 'html'; - if (name === 'installation') return 'bash'; - return 'javascript'; + const languageMap: Record = { + cli: 'bash', + code: 'html', + utility: 'typescript', + usage: 'html', + installation: 'bash' + }; + return languageMap[name] || 'typescript'; };