feat(docs): add static generation and search indexes
This commit is contained in:
@@ -105,6 +105,19 @@ export function readDocsPreferences(
|
||||
return preferences
|
||||
}
|
||||
|
||||
export function createDefaultDocsPreferences(
|
||||
locale: DocLocale = defaultDocLocale
|
||||
): Preferences {
|
||||
return Object.fromEntries(
|
||||
(
|
||||
Object.keys(docsPreferenceDefinitions) as Array<keyof DocsPreferences>
|
||||
).map((key) => [
|
||||
key,
|
||||
key === "locale" ? locale : docsPreferenceDefinitions[key].defaultValue,
|
||||
])
|
||||
) as DocsPreferences
|
||||
}
|
||||
|
||||
export function persistDocsPreference(update: PreferenceUpdate) {
|
||||
const definition = docsPreferenceDefinitions[update.key]
|
||||
const serializedValue =
|
||||
|
||||
Reference in New Issue
Block a user