Page Publishing

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.

7 个赞

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?

8 个赞

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

6 个赞

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

2 个赞

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 example.com/pub/. list all the page published.

6 个赞

Are there any plans to allow rendering of these published pages inside the normal Discourse Ember layout? It seems a shame that you can’t just pull them into the layout like the other app sections. I’ve seen a number of others ask this in this thread but nobody seems to have given a direct answer yet.

All of the other static pages plugins that I’ve seen in my research seem to be also rendering their static content in their own Rails layouts, too. Is this a limitation of the Discourse platform, or just that nobody has coded it in yet?

If there is no hard limitation against rendering the published pages inside the normal app layout (with header), where should I start when it comes to getting this feature moving?

Thank you :smiley:

3 个赞

You can alter styling per the original post: Page Publishing

2 个赞

Thank you @hellekin. However, this does not address the main point of my reply. I asked if it’s possible to render the published pages within the normal Ember.js app layout (with the logo, search, hamburger nav, and user nav), not how to customize the separate published pages layout.

I want the static content to render within the normal app layout the same way that a category or topic detail page would load. I would like to use of all the existing plugins and theme components that interface with the main Ember app layout.

3 个赞

I think the purpose of published pages is to remove the Discourse UI.

Although I agree that it would be great to have some features (e.g., from theme components or plugins), I think linking to topics would work better in your case. Maybe you want to explore styling closed topics instead?

2 个赞

Is it possible to have the published page keep the site heading intact or did I miss a trick?

5 个赞

Page publishing is really cool–the topics look great as standalone pages. But I haven’t been able to use it like I had hoped:

  1. I thought one cool use would be to set up page publishing as a landing page for the forum–so before users login they get to see a topic I have published and styled to be the page they see. Is that possible?

  2. The original post here mentions you can style the page. Is there a way to add jquery or javascript to the page? (edit: I see that from the earlier discussion there have been requests for being able to add jquery, javascript to the pages but not yet there, at least as of last year–basically, it looks like people have been hoping that they could have a static page, but render with the same customization possibilities of a normal topic–which is what I would appreciate too.)

3 个赞

Yes, there is, although it is not immediately obvious.

5 个赞

从已发布的页面链接回原始帖子是否有首选方式?

我发现自己经常需要这样做,以鼓励读者回复,同时又能控制只读的已发布页面的样式。我尝试了几种方法,包括在显眼位置链接到主题或仅使用“讨论”链接。

也许可以添加一个始终可见(但仍可通过 CSS 修改)的“讨论”按钮。是否有人已经实现了这样的 CSS 技巧?

5 个赞

2 篇帖子已拆分为新主题:已发布的页面能否与关于/常见问题解答/服务条款/隐私一起显示?

根据页面的性质,我会在合适的地方放置一个链接。有些在顶部,就像这里:

有些在底部,就像这里:

你可以通过为特定标签编写 CSS 来“模拟”一个按钮,就像我为这个类别的标题所做的那样:

https://foro.enunionylibertad.com/c/uni2-cordoba/6

文本:

Ciudadanos con la convicción de que la República Argentina puede, debe, y va a ser un lugar mejor, si trabajamos todos Unidos en pos de la Libertad.
    [**Afiliación**](https://foro.enunionylibertad.com/t/formulario-de-pre-afiliacion/92)

(重要的是 <mark> 标签)

用于上述 <mark> 标签的 CSS:

/* Code to CHANGE "mark" tag render to something that looks like a "menu bar" */
mark {
  display: inline-block;
  background-color: #E1E1E1 !important;
  color: black;
  border-radius: 20px !important;
  padding-top: 5px;
  padding-bottom: 5px;
}
3 个赞

页面发布的一种替代方法是使用 CSS 来删除常规主题帖子中不需要的元素,同时保留所有功能(例如,已安装主题组件中的 Javascript 和 CSS 样式等)。

作曲家中的标签可用于有选择地将格式应用于特定的主题帖子。

例如,在我的网站上,我通过将以下 CSS 粘贴到我的主题 CSS 的通用选项卡中来实现这一点:

/********************** 使用标签从布局中删除内容 **********************/

.tag-no-header {
    .d-header {
        display: none !important;
    }
    #post_1 nav.post-controls .actions button.edit {
    top: 0px !important;
    }
    .topic-body h1 {
        padding-top: 0 !important;
    }
}

.tag-no-sidebars {
    aside.sidebar {
        display: none !important;
    }
}

.tag-no-category {
    .topic-category {
        display: none !important;
    }
}

.tag-no-timeline {
    .topic-navigation {
        display:none !important;
    }
    .container.posts {
        grid-template-columns: 100% !important;
    }
    .topic-body {
    width: 100% !important;
    }
}

.tag-no-post-links {
    .post-links-container {
        display:none !important;
    }
}

.tag-no-box-shadow {
    .topic-body {
        width: 100% !important;
        border-top: none !important;
        box-shadow: none !important;
        background-color: unset !important;
    }
}

.tag-no-topic-meta-data {
    .topic-meta-data {
        display:none !important;
    }
}

.tag-no-side-margins {
    .wrap {
        max-width: unset !important;
        padding: 0 10px !important;
    }
    .content-wrapper {
        display: block !important;
    }
    #main-outlet-wrapper {
        width: 100% !important;
    }
    .topic-body {
        width: 100% !important;
    }
}

.tag-no-footer-buttons {
    #topic-footer-buttons {
        display: none !important;
    }
}

然后我创建标签,我可以有选择地应用于主题帖子,以匹配以上代码中的 CSS 选择器…

no-header
no-sidebars
no-category
no-timeline
no-post-links
no-box-shadow
no-topic-meta-data
no-side-margins
no-footer-buttons


所以这里是同一主题帖子的两个不同版本…

之前(未应用标签):

之后(应用所有标签)- 我也可以将其作为 iframe 嵌入到我网站上的其他帖子中 :nerd_face::

24 个赞

:star_struck:

这真是太酷了,打破常规的思维 :smiley:

4 个赞

非常感谢您,@Richie!!“开箱即用”就是我的整个世界!

2 个赞

您的代码中有一个拼写错误,多了一个分号:

    .topic-body h1 {
        padding-top: 0 !important;
    }

还有,

您是不是忘了上传图片?除非您页面的“之后”版本只是音乐 :smile:


我稍微玩了一下您的代码,简直 :sparkles: 太棒了!:sparkles:

我们可以根据您的需要,为使用此技巧添加一些建议。

  • 您的主题可以被关闭,以防止人们绕过 CSS 规则并回复它们。

  • 您的主题可以被设为不公开,以免在主题列表中增加干扰或出现在搜索结果中。

  • 标签可以放在一个普通用户不可见的标签组中,以减少标签列表中的干扰。

  • 您可以隐藏一些只有普通用户(而不是管理员)才能看到的元素(例如帖子菜单)。

这些是我很快想到的,但我想还有其他事情可以考虑。

4 个赞

感谢 @Canapin :sparkling_heart: 我已修复代码中的拼写错误。

类别和子类别也可以通过使用 category- 在 CSS 中使用

例如…

.category-books .main-content,
.category-my-great-book .main-content {
    width:100% !important;
}

我还在我的网站上广泛使用了这个技巧,用于在编辑器中即时设置内容和嵌入内容的样式…

我的网站有一个部分记录我的开发(主要是为了让我未来的自己能够回忆起并找到我已经完成的工作,这样我就不必继续重复发明轮子了!)但欢迎任何人访问或订阅该类别,如果你愿意…

3 个赞