-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(nextra/blog/docs): improve loaders types
- Loading branch information
1 parent
97e6141
commit 153aee6
Showing
11 changed files
with
79 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'nextra': patch | ||
'nextra-theme-blog': patch | ||
'nextra-theme-docs': patch | ||
--- | ||
|
||
chore(nextra/blog/docs): provide types for PageOpts in loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { NextraBlogTheme } from './types' | ||
|
||
export const DEFAULT_CONFIG: NextraBlogTheme = { | ||
readMore: 'Read More →', | ||
footer: <small className="block mt-32">CC BY-NC 4.0 2022 © Shu Ding.</small> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { PageOpt } from 'nextra' | ||
import React from 'react' | ||
import { PageOpts } from 'nextra' | ||
import { createContext, useContext } from 'react' | ||
import { DocsThemeConfig } from './types' | ||
|
||
interface Config extends DocsThemeConfig { | ||
unstable_flexsearch?: PageOpt['unstable_flexsearch'] | ||
unstable_flexsearch?: PageOpts['unstable_flexsearch'] | ||
} | ||
export const ThemeConfigContext = React.createContext<Config>({}) | ||
export const useConfig = () => React.useContext(ThemeConfigContext) | ||
|
||
export const ThemeConfigContext = createContext<Config>({}) | ||
export const useConfig = () => useContext(ThemeConfigContext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.