File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 66
77 const copy = async (text : string ): Promise <string | null > => {
88 if (browser ) {
9- return await navigator .clipboard
9+ const clipboardResult = await navigator .clipboard
1010 ?.writeText (text )
1111 .then (() => {
1212 return " Copied text" ;
1313 })
1414 .catch (() => {
1515 return null ;
16- });
16+ }) as string ;
17+ return clipboardResult ;
1718 }
1819 return null ;
1920 };
Original file line number Diff line number Diff line change 1+ export interface DirectoryData {
2+ title : string ;
3+ }
14export interface NavItems {
25 [ path : string ] : {
36 title : string ;
Original file line number Diff line number Diff line change 11import type { MarkdocModule } from "markdoc-svelte" ;
22
3- import type { NavItems } from "$lib/types" ;
3+ import type { DirectoryData , NavItems } from "$lib/types" ;
44
55export const getNavigationItems = async ( ) : Promise < NavItems > => {
66 const allPages = import . meta. glob ( "/src/content/docs/**/*.mdoc" ) ;
@@ -57,12 +57,12 @@ export const getNavigationItems = async (): Promise<NavItems> => {
5757 dirPath . match ( dirName ) ,
5858 ) ;
5959
60- const [ _ , dirData ] = matchingDir ;
60+ const [ _ , getDirData ] = matchingDir ;
6161
6262 return {
6363 ...existingNavItems ,
6464 [ dirName ] : {
65- title : ( await dirData ( ) ) . title ,
65+ title : ( ( await getDirData ( ) ) as DirectoryData ) . title ,
6666 children : {
6767 [ slug ] : {
6868 title : pageTitle ,
You can’t perform that action at this time.
0 commit comments