タグバナーのタグ名を大文字にする

This component is working really well with categories banners now :slight_smile: Category (or subcategory) + tag will display both the category and tag banner. Really awesome, thanks @awesomerobot! :100: :partying_face:

Have a suggestion for the tag banner. There is an Discourse option ‘force lowercase tags’ which is enabled by default. If it is disabled, then tags can have upper and lowercase characters. I’ve used custom CSS as a work around (text-transform: capitalize) for capitalising first characters in the tag banner where needed, but would be nice if this component supported uppercase as well (like the Discourse tag drop down filter does currently). E.g. ‘Mytag’ and ‘MyTag’ will both be displayed as ‘mytag’ in the banner currently (without custom CSS).

「いいね!」 3

これはコンポーネントによるものではなく、Discourseの他のUX要素からタグが解決される方法によるものだと思います。私のサイトには大文字のタグがあります。

Screenshot from 2022-01-19 20-41-34

上記のようなトピックリスト項目からタグを選択すると、/tag/tips に移動します。そしてバナーには「tips」と表示されます。

しかし、/tag/Tips に移動すると、バナーには「Tips」と表示されます。

「いいね!」 2

ええ、しばらく経ちますが、記憶が正しければ、問題はタグバナーがUIの他の部分のようにタグを大文字にしなかったことでした。タグのURLは小文字のままでしたが、それは予想通りであり、私の意見では理想的です。

プラグインを修正していただきありがとうございます @awesomerobot。アンダースコアを削除するオプションも追加していただきありがとうございます :tada: 自分のフォークでタグを大文字化するコミットをテストしたところ、formattedTagName で動作しました。ただし、formattedAdditionalTagNames でどのように機能するかはわかりません。いずれにせよ、すでに問題に気づいています。PDF のようなタグはすべて大文字の略語です。最初の文字を大文字にするだけでは、正しく見えません。もちろん、PDF やその他の単語を含めるためにタグのリストを挿入し、それらを異なるように扱い、完全に toUpperCase() することもできます。しかし、コミュニティメンバーがタグを作成できるインスタンスでは、一貫性を保つことが難しくなります。そのため、タグはそのまま小文字にしておくことにします。もっと良い解決策はありますか?

「いいね!」 1