返回 slidev
core-headmatter.md
根目录 / skills / slidev / references / core-headmatter.md
1 ---
2 name: headmatter
3 description: Deck-wide configuration options in the first frontmatter block
4 ---
5
6 # Headmatter Configuration
7
8 Deck-wide configuration options in the first frontmatter block.
9
10 ## Theme & Appearance
11
12 ```yaml
13 ---
14 theme: default # Theme package or path
15 colorSchema: auto # 'auto' | 'light' | 'dark'
16 favicon: /favicon.ico # Favicon URL
17 aspectRatio: 16/9 # Slide aspect ratio
18 canvasWidth: 980 # Canvas width in px
19 ---
20 ```
21
22 ## Fonts
23
24 ```yaml
25 ---
26 fonts:
27 sans: Roboto
28 serif: Roboto Slab
29 mono: Fira Code
30 provider: google # 'google' | 'none'
31 ---
32 ```
33
34 ## Code & Highlighting
35
36 ```yaml
37 ---
38 highlighter: shiki # Code highlighter
39 lineNumbers: false # Show line numbers
40 monaco: true # Enable Monaco editor ('true' | 'dev' | 'build')
41 twoslash: true # Enable TwoSlash
42 monacoTypesSource: local # 'local' | 'cdn' | 'none'
43 ---
44 ```
45
46 ## Features
47
48 ```yaml
49 ---
50 drawings:
51 enabled: true # Enable drawing mode
52 persist: false # Save drawings
53 presenterOnly: false # Only presenter can draw
54 syncAll: true # Sync across instances
55 record: dev # Enable recording
56 selectable: true # Text selection
57 contextMenu: true # Right-click menu
58 wakeLock: true # Prevent screen sleep
59 ---
60 ```
61
62 ## Export & Build
63
64 ```yaml
65 ---
66 download: false # PDF download button
67 exportFilename: slides # Export filename
68 export:
69 format: pdf
70 timeout: 30000
71 withClicks: false
72 withToc: false
73 ---
74 ```
75
76 ## Info & SEO
77
78 ```yaml
79 ---
80 title: My Presentation
81 titleTemplate: '%s - Slidev'
82 author: Your Name
83 keywords: slidev, presentation
84 info: |
85 ## About
86 Presentation description
87 ---
88 ```
89
90 ## SEO Meta Tags
91
92 ```yaml
93 ---
94 seoMeta:
95 ogTitle: Presentation Title
96 ogDescription: Description
97 ogImage: https://example.com/og.png
98 ogUrl: https://example.com
99 twitterCard: summary_large_image
100 twitterTitle: Title
101 twitterDescription: Description
102 twitterImage: https://example.com/twitter.png
103 ---
104 ```
105
106 ## Addons & Themes
107
108 ```yaml
109 ---
110 theme: seriph
111 addons:
112 - excalidraw
113 - '@slidev/plugin-notes'
114 ---
115 ```
116
117 ## Theme Configuration
118
119 ```yaml
120 ---
121 themeConfig:
122 primary: '#5d8392'
123 # Theme-specific options
124 ---
125 ```
126
127 ## Defaults
128
129 Set default frontmatter for all slides:
130
131 ```yaml
132 ---
133 defaults:
134 layout: default
135 transition: fade
136 ---
137 ```
138
139 ## HTML Attributes
140
141 ```yaml
142 ---
143 htmlAttrs:
144 dir: ltr
145 lang: en
146 ---
147 ```
148
149 ## Presenter & Browser
150
151 ```yaml
152 ---
153 presenter: true # 'true' | 'dev' | 'build'
154 browserExporter: dev # 'true' | 'dev' | 'build'
155 routerMode: history # 'history' | 'hash'
156 ---
157 ```
158
159 ## Remote Assets
160
161 ```yaml
162 ---
163 remoteAssets: false # Download remote assets locally
164 plantUmlServer: https://www.plantuml.com/plantuml
165 ---
166 ```
167
168 ## Full Template
169
170 ```yaml
171 ---
172 theme: default
173 title: Presentation Title
174 author: Your Name
175 highlighter: shiki
176 lineNumbers: true
177 transition: slide-left
178 aspectRatio: 16/9
179 canvasWidth: 980
180 fonts:
181 sans: Roboto
182 mono: Fira Code
183 drawings:
184 enabled: true
185 persist: true
186 download: true
187 ---
188 ```
189
189 lines MARKDOWN