Skip to content

Commit

Permalink
feat: add prev/nextPageText in themeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Oct 7, 2022
1 parent 8108766 commit c59e98d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
26 changes: 6 additions & 20 deletions src/shared/types/default-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ export namespace DefaultTheme {
* your translated sites outside of the project.
*/
localeLinks?: LocaleLinks;

/**
* The algolia options. Leave it undefined to disable the search feature.
* The prev page text.
*/
algolia?: AlgoliaSearchOptions;
prevPageText?: string;
/**
* The next page text.
*/
nextPageText?: string;
/**
* Locale config
*/
Expand Down Expand Up @@ -254,21 +257,4 @@ export namespace DefaultTheme {
text: string;
link: string;
}

// algolia ------------------------------------------------------------------

/**
* The Algolia search options. Partially copied from
* `@docsearch/react/dist/esm/DocSearch.d.ts`
*/
export interface AlgoliaSearchOptions {
appId: string;
apiKey: string;
indexName: string;
placeholder?: string;
searchParameters?: unknown;
disableUserPersonalization?: boolean;
initialQuery?: string;
buttonText?: string;
}
}
2 changes: 1 addition & 1 deletion src/theme-default/components/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function Nav() {
localeData.title ?? siteData.themeConfig.siteTitle ?? siteData.title;

return (
<header relative="" z="2" fixed="md:~" className="top-0 left-0" w="100%">
<header relative="" z="4" fixed="md:~" className="top-0 left-0" w="100%">
<div
relative=""
p="l-8 sm:x-8"
Expand Down
4 changes: 3 additions & 1 deletion src/theme-default/logic/useLocaleSiteData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export function useLocaleSiteData(): DefaultTheme.LocaleConfig {
if (!locales || Object.keys(locales).length === 0) {
return {
nav: themeConfig.nav,
sidebar: themeConfig.sidebar
sidebar: themeConfig.sidebar,
prevPageText: themeConfig.prevPageText,
nextPageText: themeConfig.nextPageText
} as DefaultTheme.LocaleConfig;
}
const localeKeys = Object.keys(locales);
Expand Down

0 comments on commit c59e98d

Please sign in to comment.