Page Publishing

Page Publishing

Page Publishing allows Staff/Admin users the ability to convert a topic into a static standalone page with support for custom styling. This is similar to the pattern in use for Terms of Service or the Privacy Policy pages. Note that published pages will respect the visibility rules of the associated topic.

Enable Page Publishing

Activate enable page publishing under Admin > Settings

Enable page publishing when login is required

Activating show_published_pages_login_required under Admin > Settings will allow published pages to be visible even when not logged in.

Publish a Topic

On the first post of a public topic, hitting the ... menu (1) will reveal the wrench (2), which in turn will reveal the post administration menu (3), with a new option:

  1. Go to post #1 and select the ellipsis icon…
    image

  2. Select the wrench icon
    image

  3. Select “Page Publishing”
    image

This reveals a modal dialog proposing to publish the topic as a page, where you can choose the (pre-filled) slug, just as you would do for a category’s slug – it’s automatically generated from the post title. You will also get a preview of what your published page’s URL will look like.

Published Topic

A published topic shows a notice under the title that allows access to its publishing settings:

Unpublish a Topic

Selecting Publishing Settings will bring up options that allow you to unpublish the topic

Publishing Public Pages

In your admin settings, there is a show published pages login required setting that you can override to allow your pages to be displayed to everyone even when login_required is enabled on your account.

Public Page Indicators

When Publishing

There is a “public” checkbox on the Page Publishing modal dialog window to indicate that topic restrictions have been overriden:

On Topics

There will be a “Public” tag under your original topic’s name to indicate that the page is public.

Styling of a Published Page

The structure of a published page makes it easy to customize its CSS style:

Beginning of the HTML document of a published page
<body class="published-page">
    <div class="published-page-header">
        <div class="published-page-header-wrapper">
            <a>
                <img class="published-page-logo"/>
            </a>
            <h1 class="published-page-title">Guide for ActivityPub users</h1>
        </div>
    </div>
    <div class="published-page-content-wrapper">
        <div class="published-page-content-header">
            <div class="published-page-author">
                <img  class="avatar" src="/letter_avatar_proxy/v4/letter/n/da6949/90.png">
                <div class="published-page-author-details">
                    <div class="username">nedjo</div>
                    <div class="topic-created-at">February 8</div>
                </div>
            </div>
        </div>

        <div class="published-page-body">
The relevant CSS selectors
CSS Selector Affects
body.published-page the whole page (or simply: .published-page) Note that slug, category and tags will also be appended as css classes
.published-page-header a div containing the page header (similar styling to discourse d-header)
.published-page-header-wrapper a div around the site logo and page title
.published-page-logo The site logo (uses the small version)
.published-page-title The page title
.published-page-content-wrapper a div around the content
.published-page-content-header the title and authorship information
.published-page-title the topic title (h1 tag)
.published-page-author the avatar, name of the author, and topic creation date
.published-page-author .avatar the avatar
.published-page-author-details the username and topic creation date
.published-page-author-details .username the author’s username
.published-page-author-details .topic-created-at the topic’s creation date
.published-page-body the page contents

You can go to Admin > Customize > Themes > CSS and play with it.

Additional Notes:

Big special thanks to @hellekin for starting the documentation and providing us with valuable feedback.

Wiki Page

It’s possible to “publish” a wiki page, which means every member, not only Staff, can update it.

Theme Component

Users can look at creating a theme component to supplement the published pages.

113 Likes