跳转到主要内容
本章内容102
-
01
Discourse Developer Docs
[!TIP]
If you just want to browse the existing docs, head over to https://meta.discourse.org/c/documentatio...
1 天前
-
02
index
Documentation about extending Discourse with plugins, themes, and theme components, working with the core c...
1 天前
-
03
Introduction to Discourse Development
Discourse is a modern and highly-customizable platform for building communities. This documentation is inte...
1 天前
-
04
Developing Discourse using a Dev Container
Dev Containers is an open standard for configuring a development environment inside a container. This almos...
1 天前
-
05
Developing Discourse on GitHub Codespaces
GitHub Codespaces is a very fast way to get started with Discourse development. Their free tier is good for...
1 天前
-
06
Install Discourse for development using Docker
Developing using Docker
Since Discourse runs in Docker, you should be able to run Discourse directly from y...
1 天前
-
07
Install Discourse on macOS for development
:warning: This guide covers installation instructions for a macOS development environment, for production g...
1 天前
-
08
Install Discourse on Ubuntu or Debian for Development
:warning: This guide covers installation instructions in a development environment. For a production guide ...
1 天前
-
09
Install Discourse on Windows for development
:information_source: This tutorial has been tested on Windows 10 and 11.
To set up a development environmen...
1 天前
-
10
Install plugins in your non-Docker development environment
(This guide only covers non-docker dev install. For Docker dev :whale: see https://meta.discourse.org/t/beg...
1 天前
-
11
Set up a local Discourse Development Environment?
So you want to set up Discourse locally to hack on and develop with?
This root guide links all the #dev-ins...
1 天前
-
12
Set up a multisite development environment
It's possible to run discourse in multisite mode in development. A multisite server uses a different DB and...
1 天前
-
13
Set up Discourse for development on Fedora Linux
This guide has been tested against a fresh install of Fedora 31 and 33, but may work on older versions that...
1 天前
-
14
Add Ember Components to Discourse
In the previous tutorial I showed how to configure both the server and the client side parts of Discourse t...
1 天前
-
15
The UI kit of shared Discourse components, helpers, and modifiers
ui-kit is the layer of reusable, domain-free building blocks that core, plugins, and themes compose their i...
1 天前
-
16
Automatically lint and format code before commits
Discourse uses lefthook for git hooks, and
bin/lint as the main CLI entry point for running the same check...
1 天前
-
17
Write acceptance tests and component tests for Ember code in Discourse
Automated tests are a great way to protect your code against future regressions. Many people are familiar w...
1 天前
-
18
How to run Discourse core, plugin and theme QUnit test suites
Discourse has extensive frontend tests for core, plugins and themes. Once you have a functioning local deve...
1 天前
-
19
Pinning plugin and theme versions for older Discourse installs (d-compat branches)
📖 Background
Theme and plugin developers generally want to target the
latest release of Discourse, without...
1 天前
-
20
Ember object ownership (getOwner, service injections, etc.)
:warning: Importing getOwner from
discourse-common/lib/get-owner is deprecated.
To access e.g. services th...
1 天前
-
21
Using Google's 'tachometer' to measure JS performance changes in Discourse
When working on client-side work in Discourse core/plugins/themes, it's important to consider the performan...
1 天前
-
22
Setup Continuous Integration using GitHub Actions
To build a robust extension for Discourse, it can be wise to include Continuous Integration (CI) into your ...
1 天前
-
23
Developer's guide to Markdown extensions
Discourse uses a Markdown engine called Markdown-it.
Here are some dev notes that will help you either fix ...
1 天前
-
24
Converting modals from legacy controllers to new DModal component API
:information_source: If you're implementing a new Modal, check out the main docs here. This topic describes...
1 天前
-
25
Using the DModal API to render Modal windows (aka popups/dialogs) in Discourse
Discourse 3.1.0.beta6 ships with a brand new
<DModal> component-based API.
DModal is part of the UI kit a...
1 天前
-
26
Using the JS API
Discourse's JavaScript API allows themes and plugins to make extensive customizations to the user experienc...
1 天前
-
27
Using Plugin Outlet Connectors from a Theme or Plugin
Discourse includes hundreds of Plugin Outlets which can be used to inject new content or replace existing c...
1 天前
-
28
Using modifyClass to change core behavior
For advanced themes and plugins, Discourse offers the
modifyClass system. This allows you to extend and ov...
1 天前
-
29
Creating Routes in Discourse and Showing Data
Over time Discourse has grown in complexity and it can be daunting for beginners to understand how data get...
1 天前
-
30
Adding a new 'managed' authentication method to Discourse
Continuing from https://meta.discourse.org/t/future-social-authentication-improvements/94691...
We are now ...
1 天前
-
31
Preventing accidental serialization of ActiveRecord models
We've introduced a patch to prevent the accidental serialization of ActiveRecord models without specifying ...
1 天前
-
32
(not recommended) Overriding Discourse templates from a Theme or Plugin
Ideally, when customizing Discourse via themes/plugins, you should use CSS, the JavaScript Plugin API, or p...
1 天前
-
33
Overview
A service is a small object that encompasses business logic for a given action.
From outside, it should be ...
1 天前
-
34
Write end-to-end system specs for the Discourse user interface
Rails system specs are used to simulate the actions of a real user using the app in a browser. We use the
...
1 天前
-
35
Discourse toolkit to render forms.
Basic Usage
FormKit exposes a single component as its public API:
<Form />. All other elements are yielded...
1 天前
-
36
AppEvents Triggers Reference
AppEvents
The AppEvent system in Discourse provides a pub/sub mechanism for handling UI updates and compone...
1 天前
-
37
Using Transformers to customize client-side values and behavior
Discourse core includes a number of "transformer" hooks which can be used to customize client behavior. The...
1 天前
-
38
Customizing the topic list
The topic-list is one of the most-used and most-customized user-interfaces in Discourse. There are many dif...
1 天前
-
39
Guidelines for CSS classes using BEM
When writing CSS classes for Discourse components, themes, or plugins, we follow a modified variant of Bloc...
1 天前
-
40
JavaScript type hinting & validation (typescript)
Discourse ships type information for its JavaScript code. This can provide inline documentation, autocomple...
1 天前
-
41
Designing for Different Devices (Touch & Hover)
This document outlines the APIs used to adapt Discourse's user interface for different devices.
Touch & Hov...
1 天前
-
42
Designing for Responsive Widths (Breakpoints, Viewport & Containers)
This document outlines the APIs used to adapt Discourse's user interface to different widths — both the bro...
1 天前
-
43
Drag, resize, and gesture primitives
ui-kit ships the input-driven gesture primitives: dragging a payload onto a
target, resizing a region, and ...
1 天前
-
44
Bundle splitting for plugins
By default, every javascript module in a plugin is loaded when Discourse boots. This guide describes the
s...
1 天前
-
45
Private modules and the `-internals` convention
What
-internals means
A folder named
-internals holds code that is not public API. It may be renamed, res...
1 天前
-
46
Developing Discourse Plugins - Part 1 - Create a basic plugin
Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this po...
1 天前
-
47
Developing Discourse Plugins - Part 2 - Connect to a plugin outlet
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/3...
1 天前
-
48
Developing Discourse Plugins - Part 3 - Add custom site settings
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-2-connect-to-a-plugin-out...
1 天前
-
49
Developing Discourse Plugins - Part 4 - Setup git
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-3-add-custom-site-setting...
1 天前
-
50
Developing Discourse Plugins - Part 5 - Add an admin interface
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-4-setup-git/31272
Sometim...
1 天前
-
51
Developing Discourse Plugins - Part 6 - Add acceptance tests
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-5-add-an-admin-interface/...
1 天前
-
52
Developing Discourse Plugins - Part 7 - Publish your plugin
Previous tutorial: https://meta.discourse.org/t/developing-discourse-plugins-part-6-add-acceptance-tests/32...
1 天前
-
53
Add a new locale from plugin
Usually the best way to add a new language to Discourse is by creating a pull request as described in "http...
1 天前
-
54
Add a new provider to discourse-chat-integration
discourse-chat-integration abstracts away the boilerplate for integrating Discourse with external chatroom ...
1 天前
-
55
Repackaging a markdown-it extension as a Discourse plugin
markdown.it the CommonMark engine used by Discourse has a wide array of plugins
Header anchors, definition ...
1 天前
-
56
Structuring a plugin for Rails autoloading
Many plugins include lots of class definitions inside
plugin.rb, or use
require_relative to load ruby fil...
1 天前
-
57
Developing Discourse Themes & Theme Components
Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discours...
1 天前
-
58
Theme Developer Quick Reference Guide
As themes grow more powerful, there's more to remember about how they work. We have loads of detailed docum...
1 天前
-
59
Designer's Guide to getting started with themes in Discourse
So you're interested in in designing your own theme for Discourse? You've arrived at the right topic :smile...
1 天前
-
60
Get started with Theme Creator and the Theme CLI
This topic will walk you through how to use the Theme CLI with our Theme Creator site to develop a theme an...
1 天前
-
61
Install the Discourse Theme CLI console app to help you build themes
The
Discourse Theme CLI is a ruby gem that allows you to use your editor of choice when developing Discou...
1 天前
-
62
Structure of themes and theme components
Discourse supports native themes that can be sourced from a
.tar.gz archive or from a remote git repositor...
1 天前
-
63
Split up theme Javascript into multiple files
Complex theme javascript can be split into multiple files, to keep things nicely organised.
To use this fun...
1 天前
-
64
Split up theme SCSS into multiple files
Themes and theme components are becoming steadily more powerful, and developers are getting more and more a...
1 天前
-
65
Add settings to your Discourse theme
Discourse has the ability for themes to have "settings" that can be added by theme developers to allow site...
1 天前
-
66
Objects type for theme setting
We are introducing a new
type: objects to the supported types for theme settings which can be used to repl...
1 天前
-
67
Migrate Discourse theme settings
Introduction
As of Discourse version 3.2.0.beta3, Discourse themes/components can leverage a migrations fea...
1 天前
-
68
Adding metadata and screenshots to a Theme
You can add various pieces of metadata to a theme. Some are stored in the
about.json file, and some are st...
1 天前
-
69
Use Discourse Core Variables in your Theme
Discourse is incredibly customizable!
The goal of this topic is to show you how make use of all the amazing...
1 天前
-
70
Add localizable strings to themes and theme components
For those looking to add custom languages and translations to a Discourse theme or theme component, they ca...
1 天前
-
71
End-to-end system testing for themes and theme components
Writing automated tests for themes is an important part of the theme development process which can help ens...
1 天前
-
72
Minimizing Maintenance on Theme Customizations
Discourse is highly customizable, enabling you to modify almost any aspect of its appearance through themes...
1 天前
-
73
Change font sizes in your themes
The simplest way to change the font size of your entire community would be to override the default value on...
1 天前
-
74
Include assets (e.g. images, fonts) in themes and components
Themes and theme components allow you to handle uploaded assets such as images and fonts. You can control w...
1 天前
-
75
Replace Discourse's default SVG icons with custom icons in a theme
You can replace a Discourse's default SVG icons individually or as a whole with your own custom SVG and ove...
1 天前
-
76
Update themes and plugins to support automatic dark mode
Previously, all colors in Discourse were stored as SCSS variables. To support automatic dark mode color sch...
1 天前
-
77
Theme modifiers: A brief introduction
As themes become more ambitious, we've been looking for ways to allow them to manipulate core server-side b...
1 天前
-
78
Insert text or images anywhere on your site using CSS pseudo-elements
So, you want to insert some text or image in your Discourse site.
Regarding the text in most cases it is su...
1 天前
-
79
Create and share a font theme component
Discourse supports importing themes containing assets from a remote repository.
This allows theme authors t...
1 天前
-
80
Install a new language for Highlight.JS via a theme component
I've just added a hook to our HighlightJS code so now you can use the plugin API to add a custom language f...
1 天前
-
81
Add custom content that only appears on your homepage
A very common situation you'll find yourself in as a theme developer is the need to create content that onl...
1 天前
-
82
Message Format support for localization
In Discourse all Message Format strings have a key that ends with "_MF". The Crowdin Editor has a preview t...
1 天前
-
83
Change icons globally
This is an easy way to change a Discourse icon globally.
Right click on the icon you want to change and sel...
1 天前
-
84
Alternative icons
By default, Discourse bundles icons from the excellent FontAwesome library. But there are a lot of free-to-...
1 天前
-
85
Change the style of a wiki post
A quick guide to change the style of your wiki posts:
Change the background color:
In your
/admin/customiz...
1 天前
-
86
Create and share a color scheme
Discourse now supports importing color schemes from remote repository. Here I will demonstrate how you woul...
1 天前
-
87
Use the `navigation_menu` query parameter to preview the sidebar or other options
If you are working on a theme for an existing site and want to preview how it will look with the sidebar or...
1 天前
-
88
Customize posts' contents with your own styles
Requirements
:information_source: To be able to use these tips and tricks, you need to be an administrator ...
1 天前
-
89
Adding preview screenshots to Discourse themes
:bookmark: This guide explains how to add preview screenshots to your Discourse theme to showcase how it lo...
1 天前
-
90
Controlling site settings with themes
Themeable site settings allow a theme (not components) to override a small subset of core site settings, wh...
1 天前
-
91
Things to consider before deciding to white-label the Discourse Mobile apps
Since we released the iOS and Android apps a number of people have asked expressed interest in white labeli...
1 天前
-
92
Create custom Automations
:information_source: This is a draft, and may need some extra work.
Vocabulary
trigger: represents the name...
1 天前
-
93
Discourse Public Data Dump
Given the advent of AI and the need for large datasets on local development machines, we have pulled togeth...
1 天前
-
94
Overview
The Discourse AI plugin ships a Ruby CLI under
plugins/discourse-ai/evals that exercises AI features again...
1 天前
-
95
Using the AI bot via the Discourse API
Overview
Discourse AI exposes an admin/API endpoint for streaming an AI Agent reply over a raw chunked HTTP...
1 天前
-
96
Theme Developer Tutorial: 1. Introduction
This tutorial will teach you how to create a Discourse Theme or Theme Component from the ground up. While t...
1 天前
-
97
Theme Developer Tutorial: 2. Creating a remote theme
In the last chapter, we created a basic theme via the Discourse admin interface. This works well enough for...
1 天前
-
98
Theme Developer Tutorial: 3. CSS in Themes
Technically, Discourse uses SCSS to author its stylesheets. However, we're increasingly moving towards nati...
1 天前
-
99
Theme Developer Tutorial: 4. Using Outlets to insert and replace content
Discourse uses the Ember JS Framework for its user interface. On top of Ember, Discourse provides a number ...
1 天前
-
100
Theme Developer Tutorial: 5. Building and using components
In the last chapter, we explored how you can render Glimmer Components into plugin outlets, and moved our
...
1 天前
-
101
Theme Developer Tutorial: 6. Using the JS API
In the last couple of chapters, we've explored how to use the JavaScript API to render content into outlets...
1 天前
-
102
Theme Developer Tutorial: 7. Wrapping up
This tutorial has been a whistle-stop tour through the process of creating a Discourse theme and experiment...
1 天前