Discourse 主题使用入门指南

这是一门关于 Discourse 主题基础知识的速成课程。目标受众是所有不熟悉 Discourse 主题的用户。如果您已经使用过 Discourse 主题或主题组件,本指南可能不是您必读的内容。

什么是主题和主题组件?

主题或主题组件是一组打包在一起的文件,旨在从视觉上修改 Discourse 或添加新功能。

让我们从主题开始。

主题

一般来说,主题之间并不应该相互兼容,因为它们本质上是不同的独立设计。可以将主题比作皮肤,或者 Android 上的启动器。您可以安装多个启动器,但无法同时使用两个。默认的 Discourse 安装自带两个主题:FoundationHorizon

Foundation 呈现的是简洁经典的 Discourse 外观,而 Horizon 则提供更具现代感的设计,并拥有多种配色方案可供选择(例如 Horizon、Royal、Clover、Lily、Violet 和 Marigold——每种都有浅色和深色变体)。

默认

以及深色

如果您觉得这还不够,想要更多选择,那么您可以相当轻松地安装额外的主题。以下是 Meta 上提供的几个免费主题示例。

Material Design 主题

Sam 的个人“极简”话题列表设计

Vincent

如您所见,根据您的主题选择,您的网站外观可能会有显著差异;但这还不是全部。除了主题之外,Discourse 还支持主题组件。

主题组件

我们使用“主题组件”一词来描述那些更侧重于自定义 Discourse 某一特定方面的软件包。由于它们的焦点更集中,主题组件几乎总是相互兼容的。这意味着您可以在任何主题下同时运行多个主题组件。您可以将主题组件比作手机上的应用程序。


正如往常一样,举例是描述事物的最佳方式,以下是 Meta 上可用的几个主题组件示例:

Discourse 分类横幅

该主题组件利用您现有的分类详细信息(包括名称、描述和颜色),在相关分类页面的顶部生成横幅。

品牌页眉主题组件

该主题组件为品牌添加了一个额外的顶部页眉,包含您的标志、导航链接以及社交图标,同时支持移动设备和桌面视图。品牌标志可以是图片或文本。

如您所见,主题组件的焦点要狭窄得多。因此,在大多数情况下,它们彼此兼容。现在您对 Discourse 主题和主题组件有了大致的了解。让我们再深入探讨一下。

Discourse 主题界面

让我们看看主题界面。访问 your.site.com/admin/customize/themes,您应该会看到类似以下内容:

这是 Discourse 的默认主题界面。您可以在这里执行多项操作:

  • 设置默认活动主题
  • 选择向用户开放哪些主题
  • 创建新主题和主题组件
  • 导入新主题和主题组件
  • 向主题添加主题组件
  • 修改配色方案
  • 更改主题设置
  • 预览主题

让我们逐一介绍这些功能。

设置默认活动主题

默认主题名称旁边的小勾号表示这是您网站上的活动主题。

现在,让我们将活动主题更改为 Dark。点击 Dark 主题,您应该会看到以下内容:

您网站上的活动主题将设置为 Dark。这意味着所有访问您网站的人都会看到以下内容:

此时,勾号会移动到 Dark 主题名称旁边,表示它是活动主题。

选择向用户开放哪些主题

能够为您网站设置主题固然很好,但更棒的是什么呢?让用户自己决定。Discourse 允许您向用户提供不同的主题,使他们能够根据自己的偏好设置主题。他们的选择仅限于自己的账户,不会影响您的活动主题选择或其他用户的选择。

例如,您可以将活动主题设置为默认主题(浅色),但将深色主题作为选项提供。让我们现在尝试这样做。在主题界面中:

您拥有的所有活动主题,无论是您网站设置的默认主题还是您标记为用户可选择的主题,都会显示在这里:

但只有默认主题会有绿色勾号。

现在,让我们尝试将 Red 主题设为用户可选择。

您只需要点击它,然后勾选“用户可选择主题”复选框即可。

就这样!您会注意到它会自动从不活动主题列表移动到活动主题列表。

您的用户将能够通过访问以下地址选择他们喜欢的任何主题:

your.site.com/my/preferences/interface

创建新主题和主题组件

要创建新主题或主题组件,点击任意一个“安装”按钮。

随后会出现一个对话框。在左侧菜单中选择“新建”选项。您需要为要创建的内容提供名称,并决定它是主题还是主题组件。

我们已经大致介绍了主题和主题组件的基础知识。如果您还记得,主题组件通常专注于修改 Discourse 的某个特定区域,而主题通常涵盖多个方面。您还应注意,一个主题下可以包含任意数量的主题组件,但主题组件下不能包含其他组件。目前不必为此担心,稍后会有更详细的解释。

现在,假设您已经确定了名称并决定将其创建为主题。一旦点击“创建”按钮,主题就会被创建,之后您将能够:

  1. 更改主题/主题组件的名称
  2. 为主题设置或更改配色方案
  3. 向主题/主题组件添加 HTML/CSS/JS
  4. 向主题添加文件或上传内容
  5. 向主题添加子组件

具体的自定义操作超出了本指南的范围,因此我就此打住。

添加 HTML/CSS/JS 的界面如下所示(点击上面的 #3 后):

导入新主题和主题组件

我们已经有关于如何导入主题的指南,但既然本指南旨在涵盖所有基础知识,我还是将导入方法包含在内。

要导入主题或主题组件,点击任意一个“安装”按钮。

“热门”部分允许您从我们最受欢迎的主题和组件列表中预览或安装。

您还可以从设备导入主题文件,或通过主题仓库链接导入。每个主题的仓库链接由作者在主题帖子中提供。一旦导入主题,前面讨论过的所有内容都适用于它。您可以将其设为默认主题、设为用户可选择主题等。

如果您导入的是主题组件,还可以将其添加到任何主题中。这在下一节中有详细说明。

向主题添加主题组件

假设您喜欢 Discourse 分类横幅主题组件并希望使用它。您可以按以下步骤操作:

  1. 如上所述从仓库导入主题组件
  2. 将其作为主题组件添加到您的活动主题或用户可选择主题中

您可以这样做:

导入组件后,前往您想要添加它的主题,找到“包含的组件”部分。

该列表将显示所有已安装的主题组件。从那里,您可以将主题组件添加到主题中。添加 Versatile Banner 主题组件的效果如下:

在单个组件的页面上也存在类似的“在这些主题中包含组件”选项。这允许您一次性将组件添加到多个主题中。

基本上就是这样。Discourse 分类横幅现在是默认主题的一个活动组件。如果您也想将其添加到 Dark 主题中,只需为 Dark 主题重复添加主题组件的过程即可。

如果您已将 Dark 主题设为用户可选择,并同样向其中添加了 Discourse 分类横幅主题组件,那么选择 Dark 主题作为活动主题的用户也将获得 Discourse 分类横幅主题组件,因为它是 Dark 主题的“子主题”。

一个主题下可以拥有无限数量的主题组件,正如我们之前讨论的,它们通常彼此兼容。因此,您可以像这样操作:

所有这些组件将同时作为默认主题的活动组件运行。

修改配色方案

配色方案是您选择的一组颜色,用于生成主题中元素的颜色。这里我不会深入细节,但会向您展示如何使用配色方案。

导航至 your.site.com/admin/customize/colors,您将看到:

从这里,您可以编辑配色方案或创建新的配色方案。要编辑配色方案,点击它并按您的喜好更改颜色。

要创建新的配色方案,请点击此处。

更改颜色完成后,现在需要将配色方案设置为活动状态,应用于您的活动主题或用户可选择主题。为此,请前往主题页面并查看此处:

主题设置

Discourse 主题可以包含设置。这些设置旨在为您提供一种简便的方式来配置主题或主题组件以满足您的需求。例如,Discourse 按钮样式主题包含一些设置,允许您通过简单地更改几个值来轻松自定义按钮的外观。

并非所有主题/主题组件都有设置,但对于那些有的,它们总是会显示在这里。设置通常包括作者提供的说明,帮助您确定需要进行哪些更改。

预览主题

有时,在应用主题之前,您需要查看它在您网站上的效果。Discourse 提供了一种简便的方法来预览主题,而无需将其设为活动主题。

在主题页面上,点击此处:

新标签页将打开,显示该主题在您网站上的实时预览效果。您可以导航到不同的页面,查看各项内容的显示效果。

预览主题最棒的一点是,您可以实时测试更改,而无需担心万一出现问题会对您的网站造成任何影响。

附加信息

安全模式

Discourse 内置了一种绕过当前活动主题的方法,以防出现问题。例如,组件代码中的 JavaScript 错误可能导致您的网站无法正常工作。要绕过当前活动主题,只需访问:

your.site.com/safe-mode

您将看到:

从这里,您可以禁用当前活动主题,导航到主题页面,然后修复问题或永久禁用该主题。

获取新主题

查找新主题和主题组件最直接的方法是查看 Meta 上的 #theme 分类。

进一步阅读

Designer's Guide to getting started with themes in Discourse
Developing Discourse Themes & Theme Components
Using Safe Mode to troubleshoot issues with themes and plugins
Structure of themes and theme components
Create and share a font theme component
Create and share a color scheme
Use Discourse Core Variables in your Theme
Add settings to your Discourse theme
Theme Creator, create and show themes without installing Discourse!

如果您有任何问题,请随时提问。

90 个赞
DiscoTOC - automatic table of contents
Header Submenus
Force Mobile Homepage
Easy Responsive Footer
Changes on the handlebar templates not reflecting on the browser
Add custom content that only appears on your homepage
What is the purpose of the "Convert" button with themes?
How can i set topic image' width
Compact Navigation
Scrollable Post Content
Hide Users Column
Where can i get discourse themes?
Discourse-webpack: A boilerplate for developing JS-heavy Discourse components
Where to place ad script?
How to make your side have a side-bar and external links
Hide full name if not logged in
Add Likes Column
Override icon / color
Restrict uploads
Kiosk, a self-service theme
Application Files after Digital Ocean Setup
Adding Custom Background CSS
Changing layout with themes
Image not filling header container
Configure tag color
Custom Header Links
Is anyone working on a Discourse Wiki?
Trust-Level Avatar Flair
How to add whatsapp in the share button list next to facebook
Floating "New topic" button
Floating "New topic" button
Different landing page for desktop vs mobile theme?
Filter topic with specific tag inside single category
:cn: DiscoTOC 自动内容表格
How to change Discourse splash animation?
Any options for over-riding the username restrictions?
Theme Creator Web Dev Help
Status Page (Atlassian)
Whitelist, allowed iframe
Is it possible to create child themes?
Youtube embed size, revisited
How to change paragraph font size?
Compliant Google Login Button
Add Category Column
Auto-Hide Post Editor Preview
Discourse Coloured Text
Alternative Voting Category Style
Discourse Cookie Consent Banner
Raw Post Button
Discourse-affiliate-linker
User card redesign field parity
Advice for starting with Discourse development
Local image ad banners?
Omit Emoji component
Progress Bar
Como faço para entender esse fórum? (How do I understand this forum?)
Full name @mentions
Best Workflow for Maintaining Themes?
How to create a theme (if I am a pure end user)
Filtered Topic Lists
Discourse Popular Tag Sidebar
Auto-Linkify Words
Place for total coding beginners to learn how to customise?
Can I install an external application from github running on discourse
Topic List Sidebars
Newbie help accessing code
Per-category Terms of Service
Fetch third party data for topic list
Private Message Can't Be Reached with private messaging disabled
Share theme (component) translations
Categories Layout Override
Return to start of topic
Discourse Sidebar Menu Reorder
Group specific tool bar
Theme Stelpolva: A discourse rounded theme based on Default Theme
Custom Hamburger Menu Links
Desktop to Mobile View Banner
Link from inside the topic to itself
Custom user menu tab
Discourse Tag Sidebars
Add To Home Screen (iOS, iPadOS)
Moonclaw Theme port
Created Topic Sort
Discourse Tag Cloud
Featured Flip Cards
Main banner doesn't appear when theme was changed
Codeblock Theme Picker
Hide Auth Method
Theme-Component v Plugin: What's the difference
Can I turn off location?
Extended About Page
Category Hider Theme Component
Category Previews
Wide image extending until search icon?
Expanded Create Topic Component
How to add Google Custom Search Engine to Discourse
Inline PDF Previews
How do I add category banners?
FKB Pro - Social theme
What's the fastest and easiest way to add a persistent javascript file or snippet
Banner opacity and disabling profile pictures / avatars
Discourse Watch Category Button
Group sidebar menu sections - deprecated
Wordpress in header, Discourse in footer ? Both sticky
Topic List Previews (legacy)
Add Text In Header Beside Logo
How to remove borders in tables?
Custom Homepage for Groups
Custom header colour and category icons and login button
Discourse Web Page Watermark
Removing all categories (or just "uncategorized") from hamburger menu
Hide Likes For New Users
How to remove the number of months in the category section
Styling front page category title & nav container background
Category descriptions not showing up on mobile
How customize the appearance of sections like Amazon?
Selectively hiding numbers
(old) method for adding languages to highlight.js on Discourse
Homepage (sub)category display - lots of whitespace
About the Theme category
About the Theme component category
How to update Theme Components when running on Ubuntu
Javascript code snippet injection for cookie tracking
🎀 Neomorphism, a modern theme for Discourse
Dracula a Dark Theme for Discourse
How can I add a menu item
Adding statcounter code
Grogu, a theme inspired by "The Mandalorian"
Versatile Banner
Left side hamburger menu on mobile
MD Composer extras
How to add a simple Banner
Custom Top Navigation Links
Personal Message Bubbles
Custom Header Links (icons)
Discourse for self hosting
Inline Tooltips
Topic Voting Auto Self-Vote
Full Row Bulk Select
Make "New Topic" button more prominent
Marquee / news ticker
How can I add a analytics script into the header of my community?
Display replies and likes count in mobile view
Help needed with theming and logo
Compose Center
Wikified Posts Component
Discourse Coloring Tag
Welcome Link Banner
CSS username colors only working for admin/moderators?
MD Topic List component
MD Topic List Mobile component
Review with reason
HTML tags showing in banner and don't know where to change it
New PM Dropdown Button
:classical_building: Rome, a theme inspired by ancient roman manuscripts
How to add a script at the beginning of page header?
Recommendations on layouts? A way to preview changes?
Is it possible to change Topic Title prompt for a category?
Need a plugin coded to allow certain css codings in forum
Poll Defaults
Timeline bookmark button
Graceful Theme
Material Design Theme
Sublime Theme
Discourse hamburger tags
IFrame Lightboxes
Changing theme color for the forum
Change Excerpt of topic to go to latest post instead of that specific message
Density Toggle Component
How do I test drive UI changes?
How do I test drive UI changes?
Discourse Welcome Modal
Discourse svgbob
Colored Tag Styles
Hibiscus Theme
Fully Theme
Group Categories Page Override
Voice Recorder Component
Discourse Show Fullname in Mentions
Header Locale Selector
Mint Theme
Top Contributors Sidebar
Homepage Feature
Customized Inline Codeblocks
Profile Photowall
User Portfolio
Category Banners
Matomo Analytics
Colorful Categories
Net Promoter, Satisfaction scoring?
What is the name of this theme?
Social Share
Discourse Gifs
Kanban Board
Topic List Excerpts
Unanswered Filter
Discourse Solved Quote Customization
Post Badges
Featured Tiles
Inky Theme
Reply Template
Trendy Login
Topic Author
Placeholder Forms
Remove Dashes from Tag Names
Jitsi Video Conference
Brand Header
Show Original Poster Avatars
Categories Tag Column
Timeline with labelled step by step sections - how is this achieved?
User Card Directory
Tag Icons
Tag Banners
Guest Gate Theme Component
Offline Indicator Theme Component
Showcased Categories
Signup Banner
Submit from Preview (Mobile)
Insert Video
Hamburger Theme Selector
Google Fonts
Hide Muted Categories
Category Groups
Categories Tracking Toggle
Gated Topics in Category
Halloween Decorations :ghost:
User Field Prompt
Whereby Video Meetings
Sticky Avatars for Mobile
Change the Like Icon to :+1:
Right Sidebar Blocks
DarkPixlz's Modern Theme
Sticky New Topic Banner
Clickable Topic
Topic Count in Category Boxes
Group Timezones
Remove Name Suppression on Posts
Warning banner for old Android devices affected by Let's Encrypt changes
CSS Classes for Current User's Groups
Dice Roller
Baidu Search
Avatar Size and Shape
Discourse Icon
Topic Status Filter
GitHub Status Indicators
Topic Footer Buttons
Thin Header
Sam's Simple Theme
Optional Mobile Title Header
Custom Code
Intercom Widget
Discourse Mermaid
Custom Category Boxes
Discourse Classic Theme
Topic List Thumbnails
Unformatted Code Detector
Dark/Light Mode Toggle
Fakebook Theme
Discourse Docs Card Filter
Add a custom header with a dropdown menu
Hide ignored users' topics
Contributing to Discourse
Designer's Guide to getting started with themes in Discourse
Sidebar Theme Toggle
Blackout - A Theme For OLED Displays
Issues adding CSS/JS component: Robustifying links to preserve link functionality
Horizontal loading slider
Composer Footnote Button
Account Deletion Request
Developer Toolbox
Desktop PWA Navigation
Lightweight Topic List Container
Customize the header with links, icons, or menus
Disable Likes
Buttons for Scrolling to the Top/Bottom of Topics
Advanced Search Banner
Floating Navigation Controls and Desktop Navigation Bar for Mobile
Composer tip under specific tag topics
Prevent users from changing their Full Names
Replace Discourse's default SVG icons with custom icons in a theme
Changing views to creating date?
DiscourseConnect Signup Button
Notification Banners
Alternative User PMs Button For Admin
How to use themes?
Discourse Custom Width
Clickable links in website and bio for TL0 newuser
Restrict Category Editing for Topics
Cookie Consent, GDPR, and Discourse
Allow users to block keywords
Customize Your Site Branding
Any existing theme with categories on top as cards?
How do I put gradient on thin icons?
How do I put gradient on thin icons?
Alien Night Theme - A free Dark Theme for Discourse
Arranging Categories in order of number of Topics
How to show user's name next to avatar in the navigation when logged in?
Hide staff from /about page
Breadcrumb Links
Quizmaster
Discourse OneCompiler Code Runner
Integrate Appzi feedback tool to front-end of discourse
Very Modest Theme
Developing Discourse Themes & Theme Components
Header Categories Navbar
Report Content to Group
Open In Script Editor
Hide sidebar from anon users
Sidebar User Field Toggle
Avid Reader Theme
Minimizing Maintenance on Theme Customizations
Air Theme
Minima Theme
Share Link Shortener
Twitter Native Embed
Adjust the post-voting button to the bottom
Pinboard, a simple UI theme
Clean, A clean style discourse theme
Prefilled composer link generator
Hiding GUI elements for new users (less overwhelming)
Topic List Author
App Promoter
Show both OP and last reply on mobile
Image comparison slider
Announcement Bar
Featured Categories Header
I want to learn how to program for Discourse
Featured Topics
Discourse Nav Item Icon / Emoji
A reddit-ish theme for Discourse
Homepage Toggle
Chat Sidebar
Change share icon by OS
Multiple Custom Profile Links
Image Alignment and Grid
Mint Theme
Header Glass
Topic List Item Click Animation
Twemoji Icons
Custom embedded replies
Close Composer On Page Change (mobile)
Chat – whatsapp bubbles
Hide details button style
How can one add a toggle button to the post menu and implement an action for that toggle button in a Discourse plugin?
Targetable Color Schemes
Lock Composer
Air Theme
Author Badge for Topic Posts
Highlighter Composer Button
Navigation (sidebar) menu display control
Rainbow Header Gradient for Discourse
Icons next to categories
How to enable side navigation?
Long picture adaptation
F NAV - Mobile Navigation Tabs
Discourse Full-width component
QR Code Shareables
Discourse Stickers
Enable Dev Tools Button
Loading Slider to Spinner
Composer Highlighted Button
Composer Inserted and Deleted Text Formatting Buttons
Solved Topic Badge
Air Theme
Is there a way to remove the pop-ups when making a new topic?
Smooth Scroll Top on Homepage
Stat Banner
Usercard: show leaderboard rank
Featured Lists
eBay EPN Affiliate Link Generator
Banner Featured Links
How do I go about making a very customized theme?
Moving to a Single Category Style Site Setting
How can forum admins edit the colour of topics that have been read?
Character count when writing description
Need help integrating code wrote on Edittext to the Discourse
Transit - A Public Tranportation theme
Custom Profile Link
Search section like on Reddit?
How to resize 'Modern Category + Group Boxes' thumbnail via CSS
Category List with Banners
Watermark Image
How can I create a Discourse that's just like Stemaway.com?
Minima Adjustments for Topic Cards
How can I remove the milliseconds indicator (mini-profiler) at the top right?
Add groups to the /about page
Horizon Theme
Missing anchor links in certain TOC topics?
Changing the header font for Custom Header Links
How can I change the global font size?
Discourse Age Check
Missing anchor links in certain TOC topics?
Getting ‘undefined method `kilobytes’ for “1024”:String’ when installing theme component
How can I edit My Login Page
Discourse Modal Grip
How do I install a custom theme on my Discourse instance?
Reader Mode
Discourse OrgChart
Follow Category Button
New Topic Header Button
Editor Preview Position
Missing anchor links in certain TOC topics?
Customize new topic button text
Topic Cards
Fakebook Theme
Ghost Theme
Zeronoise Theme
Topic Map Stats Icons
Category Icons
Override Signup CTA requirements
Making custom CSS changes on your site
NateDhaliwal's Theme
Code-block line numbers
Classic About Statistics
Can We Implement the Discourse Central Theme in Our Discourse Hosted Community
AI Bot - New Question Modal
Discourse Persistent banner
Installing a theme or theme component
Custom Logo Link
Creating a banner to display at the top of your site
A TC of fun: Discourse Confetti Clicks
Related category permissions
Discourse Birthdays & Anniversaries Today (Banner)
Unstar all badges
AI Post Analyzer for Chat
Be the first to reply
Indented / Nested Sidebar Categories or Subcategories
Add a Logout Button in Header for Discourse Themes
Profile text is yellow
Tag Style Tool
Insert Model 3D
Quick Profile Links Menu
Normalized Profile Links
:page_facing_up: Copy Post Component
Pull to Refresh for iOS App
Homepage Blocks
Custom Lightbox - modern, swipe gestures, fullscreen mode and more
Custom Components -- add button or text at any plugin outlet
Emoji Fluff
How to add whatsapp in the share button list next to facebook
Quote Callouts
Pyx's Modern Theme
Discourse Graph (Plotly) Embed
Post Notice Visibility Control
Heroes - Fantasy Theme
Custom User Menu
Advanced Header Search
Alternate New Topic Button (per category)
Customizable Print to PDF Button
Custom Topic Sort Order Button
Quick-add Tags To Topic
Discourse-fully light/dark下不同的颜色变量如何设置并生效
Sidebar Color Palette Toggle
Customizable Navbar Component
Filter Favorites
Introducing core themes
Unhide composer fullscreen toggle for tablets
Asking for feedback: Tag Reveal Component in Topic Lists - Expand/Collapse tags in topic lists
Enable Notification Banner
Templating of my "component" broke. How do I fix it?
Verso Theme
Discourse Featured User
Setting up light and dark mode color palettes
Highlight to Search
Default Chat Channel
Shared Draft as default New Topic
Hide Votes Left
Glacier Theme
Discourse Qingwa Timelines - Custom BBCode for Beautiful Timeline Layouts
Whisper Warning
Hidden User Fields
AI summary in topic header
Restricted reactions (like) by group
Wikipedia Lookup
Messages section for sidebar
Editing Theme design
Why am I finding Discourse so difficult to customize?
Air Theme
🌐 www theme
Air Theme
Air Theme
Upcoming Events Extra Buttons and Enhancements
Tiles Image Gallery
Topic List Tooltips
Full Screen Cover Image
Advanced Hero Component
Load More Button
Modern User Card | Fixed Experimental Usercard
Show hidden categories
Topic Hover Cards
Topic List Voting Column
Discourse Lucide Icons
External Links Icon
External Link Shield – Exit Confirmation & Trust Gating
Fingerprint Button
Adding preview screenshots to Discourse themes
Mobile Category List Adjustments
House Ad Templates
Red-light theme
Scroll to Top Component
Is it possible to edit plugin components?
Rotating Composer Placeholder
Embed whole forum
Land on Group Messages Component
Theme Developer Quick Reference Guide
Hide Topic Navigation With Timeline
Require Edit Reason
Video Upload to YouTube and Vimeo using Theme Component
Fixed-Position Topic Edit Button
Made some changes I cannot revert
Discourse Post Image Carousel
Applying a custom header to Discourse site
Blog Post Styling
Which is Better? Discourse or Flarum?
Floating left sidebar

3 posts were split to a new topic: Looking for theme gurus

2 posts were split to a new topic: Need help adding header links and image slideshow to my site

I recently followed this guide (thank you!) and successfully installed several theme components on my site. I later found out that one of them was broken and that there was a #theme:broken-theme category. This would have been good to have in the guide, but I can’t edit it, but I suggest someone add this information above. Thanks!

6 个赞

On many places, it is written, just add this code to CSS.
Then I tried that code/functionality to Admin Settings> Customize> Themes> Edit CSS/HTML. And paste the given code under ‘CSS’ or last pane ‘Embedded CSS’.
But there is no result.

Is there any guide which could tell the basics of how css/html code is pasted and in which area (there are many other panes/tabs also: ; Header ; After Header ; ; Footer )

3 个赞

是否有实际的文档,或者您的所有 API 信息都埋在帖子中?

1 个赞

这有帮助吗?

2 个赞

另请参阅 https://docs.discourse.org/

3 个赞

您好,

我没有看到“管理员设置>自定义>主题>编辑CSS/HTML”选项。我该如何启用此按钮?

1 个赞

您可以使用新的主题组件

3 个赞

也许是个愚蠢的问题……但你能为每个类别设置自己的“主题”吗?

提前感谢

您好 Eric,欢迎!

没有愚蠢的问题!虽然没有内置功能可以实现这一点,但您可以使用特定类别的 CSS主题组件 为每个类别分配独特的样式,例如。

1 个赞