slidev-addon-quantide-layout-xhs
v0.2.7
Published
Quantide portrait layout addon for Slidev
Maintainers
Readme
slidev-addon-quantide-layout-xhs
A Slidev addon for Xiaohongshu-style layouts with Pixabay image integration.
Install
Add the following frontmatter to your slides.md:
---
addons:
- slidev-addon-quantide-layout-xhs
---If you want to use !!! tip, !!! note, !!! warning and other admonition syntax, add slidev-addon-quantide-admonition explicitly:
---
addons:
- slidev-addon-quantide-layout-xhs
- slidev-addon-quantide-admonition
---Layouts
This addon provides the following layouts:
cover-photo-down- Cover with photo at bottom halfcover-photo-up- Cover with photo at top halfimage-down- Content with image at bottomimage-top- Content with image at topgrid- Grid layout for cardsblank- Blank layoutdefault- Default layout
Configuration
Pixabay API Key Setup
To use the cover-photo-* layouts with keyword-based image search, you need to configure a Pixabay API Key:
Get your free API key from Pixabay
Add to your
.envfile (in project root):VITE_PIXABAY=your_pixabay_api_key_hereRestart your Slidev dev server
Usage Example
---
layout: cover-photo-down
title: "My Article Title"
installment: "Series Name"
excerpt: "A brief description of the article"
img: "nature landscape" # Can be a keyword or full URL
---Frontmatter Options
| Property | Type | Description |
| ------------- | ------ | ------------------------------ |
| title | string | Article title |
| installment | string | Series name (use "NA" to hide) |
| excerpt | string | Article excerpt/description |
| img | string | Image URL or search keyword |
| photo | string | Custom photo credit text |
Image Source Priority
- If
imgis a full URL (starts with http), it will be used directly - If
imgis a keyword andVITE_PIXABAYis configured in.env, it will search Pixabay - If no API key is configured, the layout will show a placeholder
Troubleshooting
Images not loading
- Check browser console for error messages
- Verify
VITE_PIXABAYis set in.env(project root directory) - Ensure you've restarted the dev server after adding the API key
- Check that your Pixabay API key is valid and has not exceeded rate limits
CORS issues
If you encounter CORS errors when loading images, try:
- Using a different image source
- Configuring a proxy in your Vite config
