Discourse는 .tar.gz 아카이브 또는 비공개 저장소를 포함한 원격 git 저장소에서 소스를 가져올 수 있는 네이티브 테마를 지원합니다.
테마 예제는 다음에서 확인할 수 있습니다: GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme · GitHub
git 저장소는 하루에 한 번 업데이트를 확인하거나, 업데이트 확인 버튼을 사용하여 업데이트를 확인할 수 있습니다. 변경 사항이 감지되면 업데이트 확인 버튼이 최신 버전으로 업데이트로 변경됩니다.
![]()
테마를 생성하려면 특정 파일 구조를 따라야 합니다. 포함할 수 있는 파일은 다음과 같습니다:
about.json (필수)
common/common.scss
common/header.html
common/after_header.html
common/footer.html
common/head_tag.html
common/body_tag.html
common/embedded.scss
desktop/desktop.scss
desktop/header.html
desktop/after_header.html
desktop/footer.html
desktop/head_tag.html
desktop/body_tag.html
mobile/mobile.scss
mobile/header.html
mobile/after_header.html
mobile/footer.html
mobile/head_tag.html
mobile/body_tag.html
locales/en.yml
locales/{locale}.yml
stylesheets/{anything}/{anything}/{anything}.scss
javascripts/{anything}.js
javascripts/{anything}.gjs
javascripts/{anything}.hbs
assets/{asset_filename}
settings.yml
이러한 파일 중
어떤 것이든 선택 사항이므로, 필요한 파일만 생성하면 됩니다.
테마 SCSS를 여러 파일로 분리하려는 분들을 위해, 이제 이것이 가능합니다.
테마를 여러 JS 파일로 분리하려는 경우, 원하는 JS 파일을 javascripts 디렉토리에 추가하기만 하면 됩니다.
about.json 파일의 구조는 아래와 같으며, Adding metadata and screenshots to a Theme 에서 더 많은 정보를 확인할 수 있습니다:
{
"name": "My Theme",
"component": false,
"license_url": null,
"about_url": null,
"authors": null,
"theme_version": null,
"minimum_discourse_version": null,
"maximum_discourse_version": null,
"assets": {
"variable-name": "assets/my-asset.jpg"
},
"color_schemes": {
"My Color Scheme": {
"primary": "222222"
}
},
"screenshots": ["screenshots/light.jpeg", "screenshots/dark.jpeg"]
}
테마에 설정을 추가하는 방법에 대한 설명은 여기서 확인하세요: Add settings to your Discourse theme.
테마 컴포넌트를 추가하는 것이지 전체 테마를 추가하는 것이 아님을 Discourse에 알리려면 about.json 파일에 "component": true 라인을 추가하세요.
파일 구조는 테마 커스텀 CSS / HTML과 일치합니다.
추가 읽을거리
#themes::tag 태그가 있는 다른 글들을 확인해 보세요.
관련 항목:
- Developing Discourse Themes & Theme Components
- Install the Discourse Theme CLI console app to help you build themes
- Include assets (e.g. images, fonts) in themes and components
[date=2022-08-15 time=14:00 timezone=“America/Los_Angeles”]에 @SaraDev가 최종 검토함
이 문서는 버전 관리됩니다 - 변경 사항을 github에서 제안하세요.

