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.
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/
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:
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
.
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.
lang: en
url: 'some/url'
_<language-code>
in the root directory._config.yml
.
<language-code>
under collections
, set the output to true to enable front matter and assign a permalink url.title
is required. Assign a name
to match it with its translated versions as well.index.html
._config.yml
including the title
and url
.{% include portal-language-switcher.html %}
.lang
and identifier
are required.index.html
._config.yml
including the title
and url
.lang
and identifier
are required. You can include translations
as you want.t
in the _config.yml
.{{ 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.