태그 이름에서 대시 제거

:discourse2: 요약 주제 목록 및 주제 페이지의 태그 이름에서 대시(-) 제거
:eyeglasses: 미리보기 Discourse Theme Creator에서 미리보기
:hammer_and_wrench: 리포지토리 https://github.com/discourse/discourse-remove-dashes-from-tag-names
:open_book: Discourse 테마를 처음 사용하시나요? Discourse 테마 사용 가이드

이 테마 컴포넌트 설치

기능

이 테마 컴포넌트는 UI에서 태그 이름이 표시되는 모든 곳에서 대시를 제거합니다.

Discourse는 태그 이름의 공백을 대시로 대체하므로, 이 테마 컴포넌트는 표시되는 대시공백으로 시각적으로 되돌리는 데 유용합니다.


:discourse2: 우리가 호스팅하나요? 테마 컴포넌트는 Standard, Business, Enterprise 플랜에서 사용할 수 있습니다.

14개의 좋아요

7 posts were split to a new topic: Dashes not removed from sidebar tags

Thank for your component,
Remove Dash from Tags side bar is OK, How about title Tag?
%{filter} %{tag} %{category}

Thank you for this. I could never understand the dashes there :smiley:


The current theme component still misses many positions where the hyphen of the Tag Name cannot be removed, especially the website title to be friendly to Google. Can you update it?

1개의 좋아요

When enabling this theme component it also removes Tag icons from tags. So a bit conflict with this component: Tag Icons

Also as said before it misses removing those pesky dashes in few places.

1개의 좋아요

This script replace this component for awhile

function replaceTextNodes(node) {
    node.childNodes.forEach(child => {
      if (child.nodeType === Node.TEXT_NODE) {
        child.textContent = child.textContent
          .replace(/-E-/gi, ' & ')
          .replace(/-/g, ' ');
      } else {
        replaceTextNodes(child);
      }
    });
  }

  api.onPageChange(() => {

    document.querySelectorAll('.discourse-tag.box').forEach(tag => {
      replaceTextNodes(tag);
    });
    
    document.querySelectorAll('#sidebar-section-content-tags .sidebar-section-link-content-text').forEach(tag => {
      replaceTextNodes(tag);
    });
  });
1개의 좋아요

이것에 대해 언급하고 싶어서 왔으며, 상호운용성을 위해 이 구성 요소를 최신 상태로 업데이트해 주실 것을 요청드립니다. Sammy의 스크립트는 충분히 잘 작동하여, PR을 통해 최적화 후 포함될 수 있습니다.