Page Publishing

I just had a read through this topic again and see the same requests are coming up again and again. People are excited, which is great! I know there’s alot of appetite for feature parity with topics (eg discotoc, oneboxing, dates etc) and also CMS functionality like a navigation. I’ve suggested some of these myself. :wink:

I think for the moment no new features are being added as long as there is not a hosting customer asking for it. But quite a bit can be done with styling and theme components… would be pretty great to see community contributions. @alehandrof if you are not able to do this yourself perhaps you have a budget and can request help in #marketplace.

Alternatively, of course, if you have an immediate need for structuring content with menus etc you might look at setting up a companion site with a CMS like wordpress.


I use the following:

.published-page img { max-width: 100%; }
.published-page-header, .published-page-content-wrapper { padding: 0 1rem; }

Can i display external non-Discourse JSON on this page? Because we can’t use php code here and discourse strip most of html so i do not know how to do it…

1 Like

I have a problem with a published page - the button to copy the content of the code block is not visible on a published page. Screenshot: Screenshot by Lightshot. I move the mouse over the block, but the button doesn’t appear. When logged in - everything works as usual - ok.

Can anybody repeat the problem? Any solution?

1 Like

Theme components, such as the copy-codeblocks functionality, need to explicitly declare that they work on published pages.


If you don’t mind me asking, what is the current status of theme component support in published pages? How does one declare that they work? I might be misunderstanding what you’re saying.


I was going to ask exactly the same question!


How to do it with this plugin?

1 Like

Whoops, I thought this was more formalized than it actually is. Looks like the TOC theme component is only included in published pages because it put its JS code into the HTML header area:

And it doesn’t even process the page!


Thank you @riking !

It indeed seems that “regular” text/javascript is executing on published pages when it’s in the header or footer of a theme component.


Ha! So it seems that there’s a hacky way to make some theme components work with page publishing.

I’m looking into adding some header/footer to the published pages, and theme components seem to be the way to go. But it seems bad to go on and implement something that would potentially break in the near future.

@riking, it looks like the text/javacript type in header or footer working on published pages was unintented. Is it going to be fixed or used to extend published pages?

@syl, author of DiscPage, mentioned the possibility to re-implement the DiscPage plugin using Page Publishing functionality. Do you still have this in mind, @syl? What do you think would be the path of least resistance to integrate both functionality @riking?


Unfortunately, the “Page Publishing” feature doesn’t meet my needs. For me to use it, I would need published pages:

  1. to be displayed within the normal Discourse layout, i.e. with the standard Discourse header (just like the Terms of Service and the Privacy Policy), and
  2. to be rendered like normal (decorated) topics, i.e. supporting bbcode and plugins.

In the meantime I used the default Discourse customization facility:

  1. Identify the added element, e.g., with a published-page-footer-links CSS class.
  2. Customize CSS to hide this element by default and show it only for published pages
  3. Add the element in the Footer space

2. In CSS, add:

/* Only show footer links on published pages */
.published-page-footer-links { display: none; }
.published-page .published-page-footer-links { display: block;}

3. in Footer, add:

<nav class="published-page-footer-links">
Hi there! This is the footer for published pages!

I would like to replace procourse-static-pages with “page publishing”. Is it somehow possible to add the default discourse header to “published page”? I mean, show the logo on the left side, the search, hamburger icon, avatar and the related functionality for theses buttons on the right side. Then it would be a replacement of procourse-static-pages.

Additionally, it would be great to use DiscoTOC for the published page, too.


Thanks a lot for this feature! It allows to build great landing pages apart from the homepage. So it would be nice to have the appropriate metadata that you need for sharing on social media, SEO or Google Discover (the latter apparently became more important than Google search in my country during the last months when it comes to traffic). Are there any plans to provide a meta title / description and the custom meta tags for the big social networks or even make them editable?


Is there any way to remove the ‘pub’ component of the URL?

This was also asked previously, with no reply.


No. You can’t remove the pub without a plugin. And even then, you’d mostly need to replace it with something else.

You could use a permalink to make /arbitrary-url 301 to /pub/whatever, but it’d still have the pub in their browser.

1 Like

Any update on being able to include the Discourse header on published pages?


Will it ever be possible to render LaTeX in a published page? Would be cool to write math articles.

1 Like

May I ask, Is there a url that can list all the published page for Admin ? So Admin can easily see all the page they published.
Something similar to wordpress ?
If not, It would be great if the url list all the page published.