Publishing settings: public pages, pager style and caches
Describes Publishing 0.19.0.
The Publishing settings page holds what applies to every group at once: what the public pages render, how slugs and pagers look, and the listing and render caches. A group’s own display settings are on its group page instead.
Where to find it
In the admin sidebar, open Settings, then Publishing (/admin/settings/publishing). You need the Change the module’s settings sub-permission of Publishing; without it the page sends you back to the admin with “You don’t have permission to change the Publishing settings”. Admin and Owner have it.
The page has three tabs: General, Listing Cache and Render Cache. Every switch and menu saves as soon as you change it and confirms with a message.
Settings → Publishing.
General
Under Public URL Language:
-
Default Language Without Prefix: shows whether the default language’s public URLs drop their language part (
/blog/postinstead of/en/blog/post). It is changed on the Languages page; Manage goes there. -
In-Page Language Switcher: shows a language switcher on listing and post pages. Turn it off when the site’s own layout already has one.
-
In-Page OpenGraph Tags: adds OpenGraph and Twitter Card tags to listing and post pages, so shared links get a preview. Turn it off once the site’s layout renders these tags in its
<head>(see For developers). -
RSS Feeds: serves an RSS feed for every group at
/<group>/feed.xml, with the newest 50 published posts per language. Off, the feed addresses return 404. -
Sitemap refresh: regenerates the sitemap about 30 seconds after a post goes live, leaves, or changes its address. It needs the Sitemap module with automatic regeneration on; while that is off, nothing is regenerated.
-
JSON-LD Structured Data: adds a schema.org Article script to post pages for search results. Its author is the post’s
authorcustom field, else the site. -
Unique Views: on, a visitor counts once per post per day; off, every page open counts.
-
Slug Style: how titles in other scripts, such as Cyrillic, become URL slugs: Transliterate — privet, Unicode — привет or ASCII only — strip.
-
Pagination Style: the pager under a listing with more posts than one page holds:
- Page numbers — « 1 … 6 7 8 … 62 »: the first and last page, the pages near the current one, and previous and next.
- Compact — Page 7 of 62, with a page box: previous and next around “Page 7 of 62”, and a Go to page box with Go.
- Previous and next only.
The step buttons are labelled Previous page and Next page; in a group with date-based URLs Newer posts and Older posts. No style makes a phone screen scroll sideways.
Three numbers, saved a moment after you stop typing:
- Posts per page: how many posts a listing page shows (1 to 200, default 20).
- Reading speed (words per minute): used for the “min read” estimate (50 to 1000, default 200).
- Editing lock timeout (minutes): how long an idle editor keeps a post before someone else can take it (1 to 480, default 30). A warning appears five minutes before.
A number outside its range is saved as the nearest allowed value.
Listing Cache
The listing cache, per group.
The listing cache keeps each group’s list of posts ready, so listing pages load quickly. It updates itself when posts change.
- Memory Cache: keeps the cache in memory. Off, the page warns that listing pages “will query the database on every request”.
- The table lists each Group with its number of Posts and, under Memory, a tick when its cache is loaded.
- Clear cache (shown when the group’s cache is loaded) drops it; it is rebuilt on the next visit. Regenerate cache rebuilds it now. Regenerate All rebuilds every group’s cache.
With no groups yet, the tab says “Create a publishing group to manage its cache.”
Render Cache
The render cache keeps the finished page of each published post for 24 hours. Its keys include the post’s content, so an edit is shown at once without clearing anything.
- Render Cache: switches it on or off for the whole site. Off, the page warns that “Posts will be rendered on every request.”
- Cache Hits, Cache Misses, Entries Cached and Hit Rate: how well the cache is working.
- The table has one row per Group: the switch turns the cache on or off for that group, and Clear cache for this group empties it.
- Clear All asks “Clear all cached rendered posts? They will be re-rendered on next view.” and empties the whole cache.
What it doesn’t do
- Settings for one group, such as what its listing and post pages show, are not here: see the guide on the group’s public pages.
- The address the public pages live under is not set on this page; see For developers.
- Clearing a cache doesn’t change any post; it only makes the pages render again.
For developers
- To render the OpenGraph tags in your own layout, read the
:ogassign the public pages forward, then turn In-Page OpenGraph Tags off. The README shows the markup. - With PhoenixKit mounted under a prefix such as
/phoenix_kit, the public pages follow it. To serve them at the site root while the admin stays under the prefix, setconfig :phoenix_kit_publishing, public_url_prefix: "/". The old addresses under the kit prefix redirect (301) to the new ones. - Each setting is also a key in PhoenixKit’s settings, for example
publishing_pagination_style(numbered,compactorsimple) andpublishing_sitemap_refresh.