@frontfactory/vitepress-theme 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,96 @@
1
+ import type { DefaultTheme } from 'vitepress/theme'
2
+
3
+ export interface BannerConfig {
4
+ /** Stable id — changing it brings the banner back for readers who dismissed the previous one. */
5
+ id: string
6
+ /** Text shown in the banner. Inline HTML is allowed. */
7
+ text: string
8
+ /** Optional link the whole banner points to. */
9
+ link?: string
10
+ /** Label of the trailing call to action. Defaults to `Read more`. */
11
+ linkText?: string
12
+ }
13
+
14
+ export interface FooterLink {
15
+ text: string
16
+ link: string
17
+ rel?: string
18
+ target?: string
19
+ }
20
+
21
+ export interface FooterColumn {
22
+ title: string
23
+ items: FooterLink[]
24
+ }
25
+
26
+ export interface MetaConfig {
27
+ /** Estimated reading time. Defaults to `true`. */
28
+ readingTime?: boolean
29
+ /** Words read per minute used by the estimate. Defaults to `200`. */
30
+ wordsPerMinute?: number
31
+ /** Section the page belongs to, taken from the sidebar. Defaults to `true`. */
32
+ section?: boolean
33
+ /** Relative last-updated stamp. Defaults to `true`, and needs `lastUpdated` in the site config. */
34
+ lastUpdated?: boolean
35
+ }
36
+
37
+ /**
38
+ * Every user-facing string this theme adds on top of the default one. They sit in `themeConfig`,
39
+ * so a multi-language site declares them per locale like any other default-theme label.
40
+ *
41
+ * `{0}` in a label is replaced by the value it describes.
42
+ */
43
+ export interface ThemeLabels {
44
+ /** Accessible name of the banner dismiss button. Defaults to `Dismiss announcement`. */
45
+ bannerDismiss?: string
46
+ /** Reading-time estimate; `{0}` is the number of minutes. Defaults to `{0} min read`. */
47
+ readingTime?: string
48
+ /** Last-updated stamp; `{0}` is the relative time. Defaults to `Updated {0}`. */
49
+ lastUpdated?: string
50
+ /** Heading of the hero install panel. Defaults to `Install`. */
51
+ heroInstall?: string
52
+ /** Hero copy button. Defaults to `Copy`. */
53
+ heroCopy?: string
54
+ /** Hero copy button once the command is on the clipboard. Defaults to `Copied`. */
55
+ heroCopied?: string
56
+ /** Accessible name of the hero copy button; `{0}` is the command. Defaults to `Copy {0}`. */
57
+ heroCopyLabel?: string
58
+ /** Visible text of the back-to-top control. Defaults to `Top`. */
59
+ backToTop?: string
60
+ }
61
+
62
+ /** One entry of the colophon strip printed under the hero. */
63
+ export interface HeroMetaItem {
64
+ label: string
65
+ value: string
66
+ }
67
+
68
+ /**
69
+ * The two additions this theme makes to the standard `layout: home` hero frontmatter. Both are
70
+ * optional; everything else on `hero` stays the default theme's.
71
+ */
72
+ export interface HeroExtras {
73
+ /** Install line, printed in a panel beside the headline when the hero carries no image. */
74
+ command?: string
75
+ /** Colophon strip under the hero. */
76
+ meta?: HeroMetaItem[]
77
+ }
78
+
79
+ export interface ThemeOptions {
80
+ /** Dismissible announcement bar above the navigation. */
81
+ banner?: BannerConfig
82
+ /** Kicker line printed above every page title. */
83
+ meta?: MetaConfig | false
84
+ /** Link columns added to the site footer. */
85
+ footerColumns?: FooterColumn[]
86
+ /** Floating back-to-top control. Defaults to `true`. */
87
+ backToTop?: boolean
88
+ /** Overrides for the strings this theme adds. Declare them per locale to translate them. */
89
+ labels?: ThemeLabels
90
+ }
91
+
92
+ export interface ThemeConfig extends DefaultTheme.Config {
93
+ ff?: ThemeOptions
94
+ }
95
+
96
+ export type { DefaultTheme }