Alexandre Nédélec
Alexandre Nédélec
NNuxt
Created by VirtualGhost on 6/3/2024 in #❓・help
How do i make the Nav Avatar bigger
Which component are you using?
7 replies
NNuxt
Created by Alexandre Nédélec on 5/24/2024 in #❓・help
Redirect from netlify not working (404 not found) with Nuxt Content in SSG
However routerules (https://nitro.unjs.io/config#routerules) seems to manage the redirect ok. That's weird....
5 replies
NNuxt
Created by Alexandre Nédélec on 5/24/2024 in #❓・help
Redirect from netlify not working (404 not found) with Nuxt Content in SSG
Using _redirects file does not seem to work either
5 replies
NNuxt
Created by Alexandre Nédélec on 5/24/2024 in #❓・help
Redirect from netlify not working (404 not found) with Nuxt Content in SSG
It's weird because when using netlify dev it works correctly
5 replies
NNuxt
Created by Alexandre Nédélec on 5/24/2024 in #❓・help
Redirect from netlify not working (404 not found) with Nuxt Content in SSG
The error message I have is "404 error " : Page not found: /gitcheatsheet
5 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
By the way, for anyone coming across this question, here is the code I ended up writing:
import {serverQueryContent} from "#content/server";
import {getTagSlug} from "~/utils/tag";

export default defineEventHandler(async (event) => {
const tags = await serverQueryContent(event)
.where({ _type: 'markdown', navigation: { $ne: false } })
.only('tags')
.find()

const tagsBySlug = new Map<string, string>(tags
?.flatMap(t => t.tags ?? [])
.map(tag => [getTagSlug(tag), tag]));

return [ ...tagsBySlug]
})
import {serverQueryContent} from "#content/server";
import {getTagSlug} from "~/utils/tag";

export default defineEventHandler(async (event) => {
const tags = await serverQueryContent(event)
.where({ _type: 'markdown', navigation: { $ne: false } })
.only('tags')
.find()

const tagsBySlug = new Map<string, string>(tags
?.flatMap(t => t.tags ?? [])
.map(tag => [getTagSlug(tag), tag]));

return [ ...tagsBySlug]
})
import kebabCase from "just-kebab-case";

export const getTagSlug = (tag: string) => kebabCase(tag.toLowerCase().replace('/', ''))
import kebabCase from "just-kebab-case";

export const getTagSlug = (tag: string) => kebabCase(tag.toLowerCase().replace('/', ''))
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
I've just discovered it and try it but it does not handle properly spaces.
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
just-kebab-case seems a good option
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
I wonder which library I should use to modify my tags to kebab case and remove things like dot and slash
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
I think I will go the route rule and SSG. Thanks for the help and advice!
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
Maybe people don't usually have this issue when they have no existing URLs they don't want to break, or when they don't care about the format of the URL (space and special caracters being encoded in the url)
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
I'm using this query :
const {data: posts} = await useAsyncData(`tags-${tag}`, () => queryContent<BlogPost>('/posts')
.where({tags: {$contains: tag}, _extension: 'md' })
.sort({ date: -1 })
.find())
const {data: posts} = await useAsyncData(`tags-${tag}`, () => queryContent<BlogPost>('/posts')
.where({tags: {$contains: tag}, _extension: 'md' })
.sort({ date: -1 })
.find())
Tags in my FrontMatter look like that :
badge:
label: Tooling
tags:
- Azure CLI
- Azure
- shell
---
badge:
label: Tooling
tags:
- Azure CLI
- Azure
- shell
---
15 replies
NNuxt
Created by Alexandre Nédélec on 4/22/2024 in #❓・help
Pass extra dynamic data when routing to a page
I could, it's similar to the last option I considered. Retrieve all the tags, modify them and put the original tag and the modified tag in a map. I could do that in an endpoint that I could call from my tag page, I guess with SSG the endpoint would only be called once at build time. That's probably a good option, I just wanted to make sure there was no other easier mechanism (maybe a routing concept I don't know about) to do the same thing.
15 replies
NNuxt
Created by Alexandre Nédélec on 4/7/2024 in #❓・help
Customize links font size in Header component of Nuxt UI Pro
Thanks for your workaround, using the center layout was the trick. I ended up using that
<template #center>
<UHeaderLinks :links="links" :ui="{ base: 'text-xl font-semibold flex items-center gap-1 hidden lg:flex' }"/>
</template>
<template #center>
<UHeaderLinks :links="links" :ui="{ base: 'text-xl font-semibold flex items-center gap-1 hidden lg:flex' }"/>
</template>
9 replies