Discourse 아이콘을 전역적으로 변경하기 위한 간단한 방법입니다.
-
변경할 아이콘을 마우스 오른쪽 버튼으로 클릭하고 “요소 검사” 또는 "검사"를 선택합니다 (브라우저에 따라 다름).
-
아이콘 이름을 찾습니다.
-
Find Icons with the Perfect Look & Feel | Font Awesome 에서 새 아이콘을 검색합니다. 예: external-link-alt
-
관리자 > 테마 사용자 지정 > 테마 편집 > 코드 편집 -> JS탭에서 코드를 맞춤 설정하여 추가합니다.
// {theme}/javascripts/discourse/api-initializers/init-theme.gjs
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer((api) => {
api.replaceIcon("link", "external-link-tab");
});
- Discourse에서 기본적으로 사용되지 않는 아이콘은 사이트 설정
svg icon subset에 추가한 후, 브라우저에서 변경 사항이 적용된 것을 확인하기 위해 강제로 새로고침합니다.
결과:

모든 “link” 아이콘이 "external-link-tab"으로 대체됩니다.
아이콘이 배지 등 다른 페이지의 여러 요소에 사용되는 경우에도 해당 아이콘이 대체됩니다.
예외
이미 좋아요 아이콘 변경을 허용하는 테마 컴포넌트가 존재합니다. 이 사례를 예로 들어 설명합니다.
좋아요에 사용되는 “heart” 아이콘은 다른 이름('d-liked' 및 'd-unliked')으로 하드코딩되어 있어 다른 아이콘과 달리 취급해야 합니다. 따라서
아이콘을
아이콘으로 변경하려면:
api.replaceIcon("d-liked", "thumbs-up");
api.replaceIcon("d-unliked", "thumbs-o-up");
![]()
![]()
하지만 배지 페이지에서는 아이콘이 여전히 "heart"로 표시됩니다.
따라서 해당 페이지에서도 변경하려면 다음을 추가합니다:
api.replaceIcon("heart", "thumbs-up");
다른 예:
api.replaceIcon("d-watching", "eye");
watching 아이콘을 변경합니다:
팔로우 상태, 펼침/접힘, 알림 및 좋아요에 대한 다른 예외는 여기에 포함되어 있습니다.
const REPLACEMENTS = {
"d-tracking": "bell",
"d-muted": "discourse-bell-slash",
"d-regular": "far-bell",
"d-watching": "discourse-bell-exclamation",
"d-watching-first": "discourse-bell-one",
"d-drop-expanded": "caret-down",
"d-drop-collapsed": "caret-right",
"d-unliked": "far-heart",
"d-liked": "heart",
"d-post-share": "link",
"d-topic-share": "link",
"notification.mentioned": "at",
"notification.group_mentioned": "users",
"notification.quoted": "quote-right",
"notification.replied": "reply",
"notification.posted": "reply",
"notification.edited": "pencil-alt",
"notification.bookmark_reminder": "discourse-bookmark-clock",
"notification.liked": "heart",
"notification.liked_2": "heart",
"notification.liked_many": "heart",
"notification.liked_consolidated": "heart",
"notification.private_message": "far-envelope",
"notification.invited_to_private_message": "far-envelope",
"notification.invited_to_topic": "hand-point-right",
"notification.invitee_accepted": "user",
"notification.moved_post": "sign-out-alt",
"notification.linked": "link",
"notification.granted_badge": "certificate",
"notification.topic_reminder": "far-clock",
"notification.watching_first_post": "discourse-bell-one",
"notification.group_message_summary": "users",
"notification.post_approved": "check",
"notification.membership_request_accepted": "user-plus",
"notification.membership_request_consolidated": "users",
"notification.reaction": "bell",
"notification.votes_released": "plus",
"notification.chat_quoted": "quote-right",
};
참고: discourse/icon-library.ts at main · discourse/discourse (github.com)
다른 테마 컴포넌트를 자유롭게 제작하여 Theme component 카테고리에 공유해 주세요!
이 문서는 버전 관리를 받고 있습니다 - github에서 변경 사항을 제안하세요.








