{{post.title}}
{{post.excerpt}}
Read more### Publii Installation and Usage Guide
Source: https://getpublii.com/dev/visual-overrides
This section outlines the initial steps to get started with Publii. It covers downloading the application and the basic workflow for creating and publishing a website.
```markdown
## Start building your site today.
1. 1 Download Publii
2. 2 Write your content
3. 3 Publish your site
Create website
```
--------------------------------
### Getting Started with Publii Themes
Source: https://getpublii.com/dev/visual-overrides
This section covers the initial steps for theme development in Publii, including installation, understanding theme structure, rendering, and configuration files.
```markdown
* Getting Started
* Handlebars - intro
* Installing a new theme
* Theme structure
* Rendering theme
* Theme config.json file
* Theme supported features
* Tutorials
```
--------------------------------
### Publii Theme Settings: Image Upload Example
Source: https://getpublii.com/dev/checkif-helper
Shows the setup for an image upload field within Publii's theme settings. This enables users to upload custom images, such as logos or background images, for their site.
```json
{
"label": "Site Logo",
"name": "site_logo",
"type": "image"
}
```
--------------------------------
### Publii Theme Settings API - Switcher Example
Source: https://getpublii.com/dev/tag-tags
Shows the setup for a switcher (toggle) in the Publii Theme Settings API, used for enabling or disabling features.
```json
{
"label": "Enable Feature",
"name": "enableFeature",
"type": "switcher"
}
```
--------------------------------
### Publii responsiveSizes Helper Example
Source: https://getpublii.com/dev/responsivesizes-helper
An example demonstrating the usage of the responsiveSizes helper in Publii, specifying 'featuredImage' as the type and 'header' as the group. This helps in rendering responsive images correctly within the theme.
```Handlebars
{{responsiveSizes 'featuredImage' 'header'}}
```
--------------------------------
### Publii Theme Settings API - Separator Example
Source: https://getpublii.com/dev/tag-tags
Shows the setup for a separator in the Publii Theme Settings API, used to visually divide sections of settings.
```json
{
"type": "separator"
}
```
--------------------------------
### Handlebars Page Rendering Examples
Source: https://getpublii.com/dev/theme-structure
Demonstrates Handlebars syntax for rendering specific page types like the homepage, post page, tag page, and author page.
```handlebars
{{!-- Homepage --}}
{{!-- Post Page --}}
{{!-- Tag Page --}}
{{!-- Author Page --}}
```
--------------------------------
### Publii Developer Guides
Source: https://getpublii.com/dev/visual-overrides
Information on accessing developer guides for Publii, intended for users who wish to extend or customize Publii's functionality beyond the standard theme development.
```markdown
* Guides
* Custom Helpers
```
--------------------------------
### Publii Resources and Community
Source: https://getpublii.com/dev/visual-overrides
A guide to the resources available for Publii users and developers, including user documentation, developer guides, community forums, and premium support options.
```markdown
* Resources
* User Docs
Learn how Publii works, from installation to creation.
* Developer Docs
Documentation, guides, and tutorials for developers.
* Community Forum
Explore and interact with others and learn new things.
* Premium Support
Dedicated customer support for paid products.
* Blog
Read up on the latest news about Publii and its products.
```
--------------------------------
### responsiveImageAttributes Helper Syntax Example
Source: https://getpublii.com/dev/responsiveimageattributes-helper
Demonstrates the basic syntax for the `responsiveImageAttributes` helper, showing how to target an image defined in the theme's configuration and optionally specify its type and group.
```handlebars
{{responsiveImageAttributes @config.custom.imageOptionName [type] [group]}}
```
--------------------------------
### Handlebars - Basic Pagination Example
Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant
Shows a basic implementation of pagination using Handlebars helpers. This is crucial for navigating through multiple pages of content on a site.
```html
```
--------------------------------
### Publii Theme Settings API: Text Input Example
Source: https://getpublii.com/dev/post-editor-api
Shows a basic example of defining a 'text' input type in the `config.json` file for theme settings, allowing users to input simple text values.
```JSON
{
"settings": [
{
"id": "custom_text_field",
"label": "Custom Text",
"type": "text",
"default": "Hello World"
}
]
}
```
--------------------------------
### Publii Theme Settings: WYSIWYG Editor Example
Source: https://getpublii.com/dev/checkif-helper
Defines a WYSIWYG (What You See Is What You Get) editor field in Publii theme settings, enabling rich text formatting for content inputs. This is useful for customizable sections like footers or sidebars.
```json
{
"label": "Custom Footer HTML",
"name": "footer_html",
"type": "wysiwyg"
}
```
--------------------------------
### responsiveImageAttributes Helper with Featured Image Example
Source: https://getpublii.com/dev/responsiveimageattributes-helper
Provides an example of using the `responsiveImageAttributes` helper with a specific image type ('featuredImage') and a custom group name ('hero') for featured images.
```handlebars
{{responsiveImageAttributes @config.custom.heroImage 'featuredImage' 'hero'}}
```
--------------------------------
### Handlebars {{reverse}} Helper Example
Source: https://getpublii.com/dev/reverse-helper
Demonstrates the usage of the {{reverse}} Handlebars helper to reverse the order of items in a collection. It shows how to apply it to tag posts and restore the original order.
```Handlebars
{{#each @website.contentStructure.tags}}
{{#checkIf this.name '==' 'test'}}
{{#if this.postsNumber}}
{{reverse this.posts}}
{{#each this.posts}} {{! this output is reversed }}
{{title}}
{{/each}}
{{reverse this.posts}}
{{else}}
There are no posts connected with tag name "test"
{{/if}}
{{/checkIf}}
{{/each}}
```
--------------------------------
### Publii Theme Settings API: Repeater Example
Source: https://getpublii.com/dev/post-editor-api
Provides an example of a 'repeater' input type in `config.json`, enabling users to add multiple instances of a set of fields, often used for menus or feature lists.
```JSON
{
"settings": [
{
"id": "social_links",
"label": "Social Media Links",
"type": "repeater",
"fields": [
{
"id": "platform",
"label": "Platform",
"type": "text"
},
{
"id": "url",
"label": "URL",
"type": "text"
}
]
}
]
}
```
--------------------------------
### Handlebars - Homepage Rendering Example
Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant
Illustrates how to render the homepage in Handlebars, typically involving iterating through posts to display summaries or links. Assumes a structure where posts are accessible.
```html
{{#getPosts}}
{{post.excerpt}}{{post.title}}
Published on: {{date post.published 'MMMM Do, YYYY'}}
``` -------------------------------- ### Publii Theme Settings API - Dropdown Example Source: https://getpublii.com/dev/tag-tags Demonstrates a dropdown selection configuration within the Publii Theme Settings API. This allows users to choose from a predefined list of options. ```json { "label": "Choose an Option", "name": "dropdownOption", "type": "dropdown", "options": [ {"value": "option1", "label": "Option 1"}, {"value": "option2", "label": "Option 2"} ] } ``` -------------------------------- ### {{orderby}} Helper Syntax and Example Source: https://getpublii.com/dev/orderby-helper Demonstrates the syntax for the {{orderby}} helper, which sorts collections by a specified field and direction, with an option for locale-sensitive sorting. The example shows how to sort posts by ID in descending and ascending order using Polish locale, emphasizing the need to restore the original order. ```handlebars {{orderby collection field direction [langForLocaleCompare]}} ``` ```handlebars {{#each @website.contentStructure.tags}} {{#checkIf this.name '===' 'test'}} {{orderby this.posts 'id' 'DESC' 'pl'}} {{#each this.posts}} {{title}} {{/each}} {{orderby this.posts 'id' 'ASC' 'pl'}} {{/checkIf}} {{/each}} ``` -------------------------------- ### Publii Theme Settings API - Posts Dropdown Example Source: https://getpublii.com/dev/tag-tags Demonstrates a dropdown populated with available posts in the Publii Theme Settings API, allowing users to select a specific post. ```json { "label": "Select a Post", "name": "selectedPost", "type": "posts" } ``` -------------------------------- ### Handlebars Partials - Introduction and Usage Source: https://getpublii.com/dev/dynamic-assets Covers the concept of Handlebars partials, which are reusable template components. Examples include `footer.hbs`, `head.hbs`, and `menu.hbs` for modular theme development. ```Handlebars // Example of including a partial named 'header' // {{> header }} ``` -------------------------------- ### Theme Settings API - Dropdown Example Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant Sets up a dropdown (select) input for theme settings, allowing users to choose from a predefined list of options. ```json { "type": "dropdown", "label": "Color Scheme", "key": "color_scheme", "options": [ {"value": "light", "label": "Light"}, {"value": "dark", "label": "Dark"} ] } ``` -------------------------------- ### Handlebars Post Tag Example Source: https://getpublii.com/dev/checkif-helper Demonstrates how to use Handlebars tags to display post information, including titles and links. This is fundamental for rendering post listings and individual post pages. ```html{{postExcerpt}}