-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nextra]: refactor
loaders.ts
, provide type for PageOpts
in loader (
#579) * chore(nextra/blog/docs): provide types for PageOpts in loader * yet more readable * move `shallow cloned` console messages outside of loader
- Loading branch information
Dimitri POSTOLOV
authored
Jul 30, 2022
1 parent
bf74201
commit 0f4795f
Showing
17 changed files
with
170 additions
and
191 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
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 |
---|---|---|
@@ -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
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
Oops, something went wrong.