Preview
Previewing a Theme
Previewing a theme is important for both the theme developer and for Pagedip users who are previewing the theme.
To preview a published theme, you can go to https://pagedip.com/theme/OWNER/HANDLE
to view the theme rendered with your preview content.
Each theme should have preview content located in the preview/
directory.
preview/
main.md
page.json
Preview Content
Preview content is used to render previews of your theme in action. You can set content for all pd-editable
content fields in the theme's templates.
Preview content is written with Markdown. For an overview of Markdown syntax, check out this Markdown cheat sheet. Markdown also allows for HTML if you need to create more complex elements.
The naming convention for the preview files is to match the filename to the template's pd-editable
content field with which you want to populate the file's content. For example, an element within a template <div pd-editable="sidebar"></div>
will be filled with content from a file named sidebar.md
.
Preview with Theme Options
You can setup preview theme options in a page.json
file located in the preview/
directory. To do so, within the page.json
file add an object with key options
, containing objects representing option groups, which contain individual option key/value pairs.
{
"options": {
"options_group_name": {
"option_name": value
}
}
}