Skip to content

Commit e4e08dd

Browse files
authored
Merge branch 'main' into accessible-accent
2 parents b80a683 + 5e93353 commit e4e08dd

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

app/components/Readme.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
<!-- simple component only taking slot -->
1+
<script setup lang="ts">
2+
defineProps<{
3+
html: string
4+
}>()
5+
</script>
6+
27
<template>
3-
<article class="readme prose prose-invert max-w-[70ch]">
4-
<slot />
5-
</article>
8+
<article class="readme prose prose-invert max-w-[70ch]" v-html="html" />
69
</template>
710

811
<style scoped>

app/pages/[...package].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ function handleClick(event: MouseEvent) {
954954
</a>
955955
</h2>
956956
<!-- eslint-disable vue/no-v-html -- HTML is sanitized server-side -->
957-
<Readme v-if="readmeData?.html" v-html="readmeData.html" @click="handleClick" />
957+
<Readme v-if="readmeData?.html" :html="readmeData.html" @click="handleClick" />
958958
<p v-else class="text-fg-subtle italic">
959959
{{ $t('package.readme.no_readme') }}
960960
<a v-if="repositoryUrl" :href="repositoryUrl" rel="noopener noreferrer" class="link">{{

app/pages/code/[...path].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ defineOgImageComponent('Default', {
442442
v-show="markdownViewMode === 'preview'"
443443
class="flex justify-center p-4"
444444
>
445-
<Readme v-html="fileContent.markdownHtml.html" />
445+
<Readme :html="fileContent.markdownHtml.html" />
446446
</div>
447447

448448
<CodeViewer

nuxt.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export default defineNuxtConfig({
9393
'/opensearch.xml': { isr: true },
9494
'/**': { isr: 60 },
9595
'/package/**': { isr: 60 },
96+
'/:pkg/.well-known/skills/**': { isr: 3600 },
97+
'/:scope/:pkg/.well-known/skills/**': { isr: 3600 },
9698
// never cache
9799
'/search': { isr: false, cache: false },
98100
'/api/auth/**': { isr: false, cache: false },
@@ -166,11 +168,13 @@ export default defineNuxtConfig({
166168
{
167169
name: 'Geist',
168170
weights: ['400', '500', '600'],
171+
preload: true,
169172
global: true,
170173
},
171174
{
172175
name: 'Geist Mono',
173176
weights: ['400', '500'],
177+
preload: true,
174178
global: true,
175179
},
176180
],
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ import { CACHE_MAX_AGE_ONE_HOUR, CACHE_MAX_AGE_ONE_YEAR } from '#shared/utils/co
66

77
/**
88
* Serves /.well-known/skills endpoints for `npx skills add` CLI.
9-
* Middleware pattern allows non-matching paths to pass through to Nuxt.
109
*/
11-
export default defineEventHandler(event => {
12-
const url = getRequestURL(event)
13-
const match = url.pathname.match(/^\/(.+?)\/\.well-known\/skills\/(.*)$/)
14-
if (!match) return
15-
16-
return cachedHandler(event)
17-
})
18-
19-
const cachedHandler = defineCachedEventHandler(
10+
export default defineCachedEventHandler(
2011
async (event: H3Event) => {
2112
const url = getRequestURL(event)
2213
const match = url.pathname.match(/^\/(.+?)\/\.well-known\/skills\/(.*)$/)!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '../.well-known-skills'

0 commit comments

Comments
 (0)