테마 및 테마 구성 요소의 구조

Discourse는 .tar.gz 아카이브 또는 비공개 저장소를 포함한 원격 git 저장소에서 소스를 가져올 수 있는 네이티브 테마를 지원합니다.

테마 예제는 다음에서 확인할 수 있습니다: GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme · GitHub

git 저장소는 하루에 한 번 업데이트를 확인하거나, 업데이트 확인 버튼을 사용하여 업데이트를 확인할 수 있습니다. 변경 사항이 감지되면 업데이트 확인 버튼이 최신 버전으로 업데이트로 변경됩니다.

image

테마를 생성하려면 특정 파일 구조를 따라야 합니다. 포함할 수 있는 파일은 다음과 같습니다:

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

이러한 파일 중 :arrow_up: 어떤 것이든 선택 사항이므로, 필요한 파일만 생성하면 됩니다.

테마 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 태그가 있는 다른 글들을 확인해 보세요.

:information_source: 관련 항목:


[date=2022-08-15 time=14:00 timezone=“America/Los_Angeles”]에 @SaraDev가 최종 검토함


이 문서는 버전 관리됩니다 - 변경 사항을 github에서 제안하세요.

62개의 좋아요
Alien Night Theme - A free Dark Theme for Discourse
Override values for auto-generated color variables
How to modify the header HTML, but still remaining the default founctions
Custom user fields show on Activity, but not Summary page
Some basic questions about discourse and rails
Create and share a font theme component
Add support for theme settings
How do I get started with Discourse development as a regular end user with no programming experience?
Color Scheme Contest (with Prizes!)
Custom assets upload folder?
Designer's Guide to getting started with themes in Discourse
Create and share a color scheme
Theme Developer Quick Reference Guide
Adding metadata and screenshots to a Theme
Theme Developer Tutorial: 2. Creating a remote theme
Mobile View Loading different HTML as compared to Desktop
Developing Discourse Themes & Theme Components
Minimizing Maintenance on Theme Customizations
Need help with theme component Github
Challenges creating a custom color palette
Allow users to select new color palettes
Split up theme SCSS into multiple files
Push to digital ocean from command line and rebuild
Battle Axe - A free theme by the Tappara.co hockey community
Beginner's guide to using Discourse Themes
Discourse deployment using github or bitbucket?
How to remove sticky top bar?
Do you have original customisations?
Add custom content that only appears on your homepage
Highlight color
Timefuser Theme
Compact member list
Understanding the development/deployment process
CSS Theme Contest (with Prizes!)
How to bring in Latest topics when using category boxes
Need to include PGN (chess game notation) in a post
Custom header colour and category icons and login button
Automatic dark mode for embedded comments as well?
Add settings to your Discourse theme