Discourse is the 100% open source discussion platform built for the next decade of the Internet.
This is a community effort to improve Discourse's documentation.
- Users Essential features available to normal users in a community hosted on Discourse.
- Moderators How to use various features for community and forum moderation.
- Administrators How to configuration of various site-wide options for discourse through the admin panel.
- Designers How to customize the look and feel of discourse with themes, HTML, CSS and JavaScript.
- System Administrators How to install, maintain and optimize systems to run Discourse.
- Developers Write plugins, features or fix bugs in Discourse.
This is a work in progress, in the early stages. If you would like to get involved, please join the convesation on meta to see where your efforts are best spent.
The documentation is built using Jekyll and hosted on Github Pages.
Multilingual approach and a little more about structure.
Portal
: Defined by us. The page works like a directory and doesn't include a bunch of texts. e.g. Install, Developers, HomePage
: A jekyll doc type. All portals are just pages. But there are also some pages including texts. e.g. aboutCollection
: A jekyll doc type between page and post. Doc is a collection item and also belongs to one portal.
Collection name is the same as the language code suffix, prefixed with an underscore such as _en
and _zh_CN
. Within each language collection, a subdirectory exists for each portal. A few additional configuration value should also be added into _config.yml
.
collections:
en:
output: true
permalink: /:path/
zh_CN:
output: true
permalink: /zh_CN/:path/
defaults:
-
scope:
path: ""
type: en
values:
layout: page
lang: en
-
scope:
path: ""
type: zh_CN
values:
layout: page
lang: zh_CN
The only required meta attribute is title
and name
.
name
must match across all translations as it is used to match an article to its companions.
For example, here is the metadata for an english article in _en/developers/
---
title: "Install Discourse in the cloud"
name: install-discourse-in-the-cloud
tags:
- install
---
It's Chinese translation has a different title and tag, but a matching name:
---
title: "在云上安装 Discourse"
name: install-discourse-in-the-cloud
tags:
- 安装
---
_config.yml
stores all the translation strings.
t:
en:
language: English
language_title: Language
home:
title: Home
url: '/'
about:
title: About
url: '/about/'
zh_CN:
language: 简体中文
language_title: 语言
home:
title: 主页
url: '/zh_CN/'
about:
title: 关于
url: '/zh_CN/about/'
They can be referenced by {{ site.t[page.lang].xxx_key }}
.
All page including portals should include a title
and url
here.
Required identifier
and lang
. identifier
should match key in the _config.yml
.
---
layout: default
lang: en
identifier: home
---
A set of available languages should be in the heading of a portal by including {% include portal-language-switcher.html %}
Required identifier
and lang
. identifier
should match key in the _config.yml
. Additional translations
is used to add the translated version in the header. It's no need to add something in the body.
---
layout: default
lang: en
identifier: home
translations:
-
lang: en
url: 'some/url'
---
- Create the
_<language-code>
in the root directory. - Declare the meta attributes in the
_config.yml
. - Add a<language-code>
undercollections
, set the output to true to enable front matter and assign a permalink url. - Add scope default variables to collection items.
- Create a markdown file in the collection folder.
- Assign the meta attributes in the file.
title
is required. Assign aname
to match it with its translated versions as well.
- Create a page such as
index.html
. - Add the translation string into
_config.yml
including thetitle
andurl
. - Add the language switcher by adding a line above the body:
{% include portal-language-switcher.html %}
. - Assign the meta attribute in the file.
lang
andidentifier
are required.
- Create a page such as
index.html
. - Add the translation string into
_config.yml
including thetitle
andurl
. - Assign the meta attribute in the file.
lang
andidentifier
are required. You can includetranslations
as you want.
- Add a key under the
t
in the_config.yml
. - Now you can reference it by
{{ site.t[page.lang].xxx_key }}
.
Layouts are divided into several types:
base.html
: A very basic HTML structure.default.html
: Used by every portal pages and main page, including the banner and sidebar.documentation.html
: Used by documentation page, including the breadcrumb.page.html
: Any other pages didn't fit into the other 3 types. For example, 404 page.