### 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.title}}

{{post.excerpt}}

Read more
{{/getPosts}} ``` -------------------------------- ### Theme Settings API - Switcher Example Source: https://getpublii.com/dev/dynamic-assets Shows how to implement a switcher (toggle) input using the Theme Settings API. This is ideal for enabling or disabling features with a simple on/off switch. ```JSON { "name": "enableDarkMode", "label": "Enable Dark Mode", "type": "switcher" } ``` -------------------------------- ### Handlebars - {{date}} Helper Example Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant Illustrates formatting dates using the {{date}} helper. This is useful for displaying publication dates or other time-sensitive information. ```html

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

{{postTitle}}

{{postExcerpt}}

``` -------------------------------- ### Publii Theme Settings API - Pages Dropdown Example Source: https://getpublii.com/dev/tag-tags Illustrates a dropdown populated with available pages in the Publii Theme Settings API, enabling users to select a specific page. ```json { "label": "Select a Page", "name": "selectedPage", "type": "pages" } ``` -------------------------------- ### Theme Settings API - Dropdown Example Source: https://getpublii.com/dev/dynamic-assets Illustrates the creation of a dropdown (select) element using the Theme Settings API. This provides a predefined list of options for the user to choose from. ```JSON { "name": "themeColor", "label": "Theme Color", "type": "dropdown", "options": [ {"value": "blue", "label": "Blue"}, {"value": "red", "label": "Red"} ] } ``` -------------------------------- ### Handlebars Partials for Reusable Content Source: https://getpublii.com/dev/responsiveimageattributes-helper Explains the concept of Handlebars partials in Publii for creating reusable template components. Examples include footer, head, menu, and pagination partials. ```handlebars {{> footer.hbs}} {{> my-custom-partial}} ``` -------------------------------- ### Publii Theme Settings API - Image Small Upload Example Source: https://getpublii.com/dev/tag-tags Demonstrates the configuration for a small image upload field in the Publii Theme Settings API, suitable for smaller image assets. ```json { "label": "Upload Small Image", "name": "smallImage", "type": "imageSmall" } ``` -------------------------------- ### Theme Settings API - Color Picker Example Source: https://getpublii.com/dev/author-page-tags Configures a color picker input for theme customization via the Theme Settings API. Enables users to select colors for various theme elements. ```JSON { "settings": [ { "type": "colorpicker", "name": "Primary Color", "key": "primaryColor", "default": "#007bff" } ] } ``` -------------------------------- ### Theme Settings API - WYSIWYG Editor Example Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant Configures a WYSIWYG (What You See Is What You Get) editor for theme settings. This provides a rich text editing experience for users. ```json { "type": "wysiwyg", "label": "About Section Content", "key": "about_content" } ``` -------------------------------- ### Publii Theme Settings: Color Picker Example Source: https://getpublii.com/dev/checkif-helper Illustrates the configuration for a color picker input in Publii theme settings. This allows users to select colors for various theme elements, like backgrounds or text. ```json { "label": "Primary Color", "name": "primary_color", "type": "color" } ``` -------------------------------- ### Publii Theme Settings: Text Input Example Source: https://getpublii.com/dev/checkif-helper Shows the configuration for a simple text input field within the Publii theme settings. This allows users to input custom text values that can be used in the theme. ```json { "label": "Author Name", "name": "author_name", "type": "text" } ``` -------------------------------- ### Handlebars - {{asset}} Helper Example Source: https://getpublii.com/dev/prepare-theme-gdpr-compliant Shows how to use the {{asset}} helper to correctly reference static assets like CSS and JavaScript files, ensuring proper path resolution. ```html