File tree Expand file tree Collapse file tree 4 files changed +401
-361
lines changed
Expand file tree Collapse file tree 4 files changed +401
-361
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,19 @@ const qRepo = ref('supabase-module')
66<template >
77 <div >
88 <GithubReadme v-slot =" { readme, refresh }" :query =" { owner: qOwner, repo: qRepo }" >
9- Fetch readme from query:
9+ Fetch README from query:
1010 <input v-model =" qOwner" style =" margin-left : 1rem ;" type =" text" > /
1111 <input v-model =" qRepo" type =" text" >
1212 <button style =" margin-left : 1rem ;" @click =" refresh" >
1313 Search
1414 </button >
15- <ContentRenderer :value =" readme" />
15+ <ContentRenderer :value =" readme" >
16+ <template #empty >
17+ <div style =" margin : 1rem 0 " >
18+ README not found
19+ </div >
20+ </template >
21+ </ContentRenderer >
1622 </GithubReadme >
1723 </div >
1824</template >
Original file line number Diff line number Diff line change @@ -83,8 +83,11 @@ export default defineNuxtModule<ModuleOptions>({
8383 if ( options . remarkPlugin ) {
8484 // @ts -ignore
8585 nuxt . hook ( 'content:context' , ( context ) => {
86- context . markdown . remarkPlugins = context . markdown . remarkPlugins || { }
87- context . markdown . remarkPlugins [ 'remark-github' ] = { repository : `${ options . owner } /${ options . repo } ` }
86+ context . markdown . remarkPlugins ??= { }
87+
88+ if ( ! Array . isArray ( context . markdown . remarkPlugins ) ) {
89+ context . markdown . remarkPlugins [ 'remark-github' ] = { repository : `${ options . owner } /${ options . repo } ` }
90+ }
8891 } )
8992 }
9093
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default handler(
3333 const readme = await fetchReadme ( githubConfig ) as GithubRepositoryReadme
3434
3535 // Readme readable content
36- const content = Buffer . from ( readme . content , 'base64' ) . toString ( )
36+ const content = Buffer . from ( readme . content ?? '' , 'base64' ) . toString ( )
3737
3838 // Parse contents with @nuxt /content if enabled
3939 if ( moduleConfig . parseContents ) {
You can’t perform that action at this time.
0 commit comments