Skip to content

Commit c59e98d

Browse files
committed
feat: add prev/nextPageText in themeConfig
1 parent 8108766 commit c59e98d

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

src/shared/types/default-theme.ts

+6-20
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ export namespace DefaultTheme {
7272
* your translated sites outside of the project.
7373
*/
7474
localeLinks?: LocaleLinks;
75-
7675
/**
77-
* The algolia options. Leave it undefined to disable the search feature.
76+
* The prev page text.
7877
*/
79-
algolia?: AlgoliaSearchOptions;
78+
prevPageText?: string;
79+
/**
80+
* The next page text.
81+
*/
82+
nextPageText?: string;
8083
/**
8184
* Locale config
8285
*/
@@ -254,21 +257,4 @@ export namespace DefaultTheme {
254257
text: string;
255258
link: string;
256259
}
257-
258-
// algolia ------------------------------------------------------------------
259-
260-
/**
261-
* The Algolia search options. Partially copied from
262-
* `@docsearch/react/dist/esm/DocSearch.d.ts`
263-
*/
264-
export interface AlgoliaSearchOptions {
265-
appId: string;
266-
apiKey: string;
267-
indexName: string;
268-
placeholder?: string;
269-
searchParameters?: unknown;
270-
disableUserPersonalization?: boolean;
271-
initialQuery?: string;
272-
buttonText?: string;
273-
}
274260
}

src/theme-default/components/Nav/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export function Nav() {
153153
localeData.title ?? siteData.themeConfig.siteTitle ?? siteData.title;
154154

155155
return (
156-
<header relative="" z="2" fixed="md:~" className="top-0 left-0" w="100%">
156+
<header relative="" z="4" fixed="md:~" className="top-0 left-0" w="100%">
157157
<div
158158
relative=""
159159
p="l-8 sm:x-8"

src/theme-default/logic/useLocaleSiteData.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export function useLocaleSiteData(): DefaultTheme.LocaleConfig {
1212
if (!locales || Object.keys(locales).length === 0) {
1313
return {
1414
nav: themeConfig.nav,
15-
sidebar: themeConfig.sidebar
15+
sidebar: themeConfig.sidebar,
16+
prevPageText: themeConfig.prevPageText,
17+
nextPageText: themeConfig.nextPageText
1618
} as DefaultTheme.LocaleConfig;
1719
}
1820
const localeKeys = Object.keys(locales);

0 commit comments

Comments
 (0)