What's a website without content? In the Posts section of Publii you can create articles that will make up the bulk of the content on your site, using three different Editors which each provide a unique writing experience to help you find the best layout for your content. Depending on the theme selected, the posts you create may be displayed in order on the frontpage, or displayed as individual preview cards. In this section we'll look at how to add, remove or edit your posts.
Unlike a desktop word processor, content that will be displayed on a website must be converted to HTML, which will be readable by browsers that visit the site. In short, it uses HTML tags to frame the content e.g. general content such as this will be surrounded by a Paragraph tag <p>:
<p>This is a normal sentence.</p>
There are hundreds of different tags, but whichever editor you choose to use in Publii will take care of inserting the appropriate tags for you via their various tools. However, there are some basic elements regarding HTML that it's important to be aware so that you can understand how to add titles and subtitles to sections of your content:
- If you want to insert a title for a section of text, instead of using bold text and a larger font size, you can instead use a different HTML tag. The Heading tags change the text to larger, clearer text that can be used as a title, though the specific changes will depend on the theme you are using. Each editor has its own method for inserting headings; details can be found in the each editor's specific page in this guide.
- There are multiple headings available, from Heading 1 to Heading 6. As a general rule, these work like titles and subtitles; each section title should use the Heading 2 tag, whereas smaller subsections within each section should use Heading 3, and sub-subsections should use Heading 4, and so on.
- The Heading 1 tag is usually used exclusively for the post title and is automatically inserted into the content. It is possible to add additional H1 tags, but this can negatively affect your site's SEO.
Choosing an Editor
To begin creating posts, click on the Posts option in the left-sidebar to be taken to the Posts screen. The first time you do this you'll be presented with a choice of three different editors that you can use to create your first post; a Block Editor, a Markdown Editor, and a WYSIWYG Editor.
Each of these editors can create similar posts in terms of style and layout, but they each have unique UIs and functionalities that make them more suitable for different writing styles. For a more complete breakdown of each editor you may check the The Block Editor, The Markdown Editor and The WYSIWYG Editor sections of this guide, available in the table of contents in the left-sidebar of this guide. As a brief introduction to each editor:
- The Block Editor - This editor separates each paragraph, image or other page element into its own block, which can then be individually-styled and moved; great for reordering content on the fly. It also removes a lot of UI clutter, making it easy to focus on your writing.
- The Markdown Editor - Markdown can be thought of as a form of HTML shorthand; it allows you to write content and insert pictures and other media using shortcuts and placeholders rather than needing to worry about opening and closing tags. This makes it very effective for writing content that doesn't need too much in the way of styling, such as with documentation.
- The WYSIWYG Editor - This editor offers the classic word-processor-style writing experience, letting you see how the content will appear on the live site while also offering clear toolbar options. It's not as quick and intuitive as the block editor, but it gets the job done.
Creating Your First Post
Once you've decided which editor to use, click on the Add New Post button under your chosen editor to move to the Edit Post screen. From here, you can take care of all aspects of your post. While each editor will have its own distinct layout they each boast the same basic functionalities, such as inserting images and galleries, changing text styles, and adding links or other text highlights. We advise checking the specific section for your editor in this guide for the full rundown on what you can do, and how to do it. The only important thing to mention here is that your post requires a title and some content, so ensure that you fill out the Post Title bar at the top of the editor before adding your main content to the post.
As well as the specific editor functionalities there are also a set of specific options for posts that are universal for all the editors, accessible via the right-sidebar while editing the post. These options are hidden by default, so to expand the sidebar you'll need to click on the Settings button (represented by a Gear icon). This will expand the sidebar. The following options are available (note that not all options are available for all themes):
- Post author - Select which author should be displayed as the creator of the post.
- Set custom post date - Clicking on this option allows you to modify the displayed publication date and time on the post, instead of using the exact date and time it was created in the Publii app.
- Mark as featured - If enabled, then the post will be highlighted on listing pages such as tag pages, so that more visitors will notice it.
- Hide post - Enabling this option will stop the post from appearing on listing pages, such as author or tag pages.
- Exclude from homepage - When enabled, the post won't appear in any frontpage showcase sections, but will continue to appear in listings and other pages that generate post lists, unlike the standard Hide post option.
- Featured Image - The featured image usually appears at the top of the post and is also used as the post-preview picture. To add a featured image to your post you can either drag and drop an image onto the Featured Image box, or click on the Choose File button to open a file explorer window to select a photo from your computer.
- Alternative Text - This option is only available if you have a featured image set. Here, you can add text that will be displayed if the image cannot load, or read by a screen-reader used by visually-impaired users to describe the photo.
- Caption - Another featured-image-only option, text added here will be added as a caption under the photo.
- Credits - Name or other text added here will appear as a credit, letting people know who took the picture or owns the copyright if it is not your own.
- Tags - This field sets which tags (categories) the post should be attached to, so users will see it when browsing posts by tags.
- Main Tag - when you add multiple tags to a post Main Tag will appear; you can select which tag should appear with the post on the frontpage or other pages (supported by the selected themes only). If no maintag is selected, the first tag in the list will be displayed.
- Post Slug - The post slug is a URL-friendly version of the post title, without spaces or special characters. If left blank Publii will automatically generate this, so it can be ignored if you're not sure what to do!
The post slug is generated automatically only when you first time creating the post. You may have noticed that when you edit the title of the post, the change will have no effect on the post slug. It remains unchanged. The reason is the way Publii handles SEO to prevent loss of search engine rankings and traffic.
- Page Title/Meta Description - These two fields provide the meta-data for the post; this data is used by search engines and may be displayed in search results, but can be ignored if preferred.
- Meta Robots Index - This option decides what permissions search engine 'robots', which log webpage data and generate search results, have. Index will allow the search engines to include your page in search results, while Follow will allow the search engine robots to follow links on the post to provide more nuanced results. If you're not familiar with this setting you can leave it at the default.
- Canonical URL - If your post is duplicate content from another part of your site, you can enter the original post's URL here to prevent the duplicate content impacting your search ranking.
- Post Template - If available, this option will let you choose a post layout; whether additional layouts are available depends on the theme you are using.
- Display X (where X is an element from the post page) - The display options allow you to enable or disable individual post elements, such as share buttons, author bio etc...The global options are defined in the Theme Settings; options here are to override the global settings for a single post. If the theme has no additional elements, then this option will not appear.
- Navigation Color (not available in all themes) - Defines whether navigation buttons to move between posts on the tag are dark or light colored; this should be set depending on the coloring of your hero image e.g. an image with a dark background should use light navigation colors.
Saving your Post
When your post is ready to save you have multiple options available, accessible via the blue button at the top of the right sidebar; by default this will be set to Save and Close. Clicking on the arrow at the right side of the button will let you switch between the following four options:
- Save and Close - Saves and publishes the post, and returns you to the post list screen.
- Save - Saves and publishes the post, but doesn't return you to the listing page, so you can continue to edit the post.
- Save as Draft - Saves the post as a draft, so it will not be visible on the live site even after syncing.
- Save and Publish (only visible on draft posts) - If you have previously saved a post as a draft, this additional option will be available. Using it saves changes to the post, and publishes it so it will be visible on the live site after the next sync.
Adding a Post and Switching Editors
After creating and saving your first post, clicking on the Posts option in the sidebar will take you to the list of posts, rather than displaying the option to select an editor. To add a new post, click on the Add New Post button at the top-right of the window; this will create a new post using the same editor that you selected when creating your first post.
If you want to try out a different editor, then you can do so by clicking the down-arrow on the right-side of the Add New Post button; this will open a drop-down list with the options to use a different editor to create a new post.
Editing a Post
You can make changes to a post at any time, even after publishing. You only need to click on the post you want to edit in the Posts screen and you'll be taken to the Edit Post page, where you can make and save your changes just like when creating a new post.
Note: When a post is opened for editing, Publii will automatically use the specific editor that was used to create the post.
Deleting a Post
Deleting a post is quite a bit easier than writing one! On the Posts screen you'll see a list of your created posts; just add a check to the left of the post you want to delete, and click the red Move To Trash button that appears; this will move the post to the Trash section where it may be deleted permanently later, or restored.
Restoring/Permanently Deleting a Post
When a post is first deleted it is not totally removed from the Publii app; instead, it is moved to separate Trash category from where it may be permanently deleted or restored if you change your mind. To view deleted posts, click on the Trashed filter listed at the top of the Posts screen, under the search bar:
This will display a list of deleted posts. To select a post, click on the checkbox to the left of the name; you will now see two new options at the top of the post list to permanently Delete the post, or Restore it to its original category. Click your chosen button and the post will be moved accordingly. Bear in mind that once a post is deleted from the trash section it will no longer be available or restorable.
Duplicating a Post
If you wish to duplicate a post to reuse its layout, settings etc...then you can easily do so. When on the Posts screen, in the list of posts find the one(s) that you wish to duplicate and click the box to the left of its name to add a checkmark to it; a new set of options will appear at the top of the list, including a Duplicate button; click on this to automatically create a duplicate post named postName Copy.
Editing Post Publication Date
By default Publii will set the publication date and time to the moment the post is saved in the Publii app, rather than when it is synced to your site, which may cause issues if you will not perform a sync for some time. In such cases you can manually modify the publication date and time.
In the right sidebar, click on the Status tab, then click on the date and time under the Published heading; this will open a pop-up box where you can modify the published date and time. Don't forget to save the changes!
Note: If the post's publication date is set to a future time, it will not be automatically published and synced by Publii as it only uploads the static website files; it will simply display the future publication date on the post. Posts may be saved as drafts to prevent them appearing on your live site, and can be published and synced when required.