Wikified投稿コンポーネント

Simple Description

This theme component enables you to make Wiki posts (and Shared Edits posts) more obvious.

Wikis and Shared Edits are a powerful feature of Discourse, but many users are unfamiliar with the concept and find the UI just a bit too subtle. This component makes it crystal clear, packaging the content from Change the style of a wiki post.

Screenshots

Detailed Description

Installing this component enables you to control the background colour of Wiki posts, and to add some text to the history/edit icon in the top right of the post.

It is a fork of discourse-wikified-post-background-color by @pacharanero, incorporates stuff from Change the style of a wiki post and re-used code from Personal Message Bubbles by @Rhidian.

Settings

Wiki post background color

The background colour of Wiki posts can be set to whatever you like. It defaults to ‘highlight’, but you can use any of these options:

  1. It works best when a Scheme colour is chosen (i.e. primary, secondary, tertiary, etc), as these are responsive to automatic dark mode.
  2. A named color recognised in CSS (e.g. blue, red, yellow, black, etc)
  3. An HTML color code (e.g. #effbfb, etc)

Shared edits background color

You can choose one of the same color options for Shared Edits posts (see the Shared Edits Plugin)

Wiki added text

This adds the little bit of green text (defaulting to Wiki Post) in the top right corner of the post:

image

This is dynamic, and changes colour along with the history icon if there has been a recent edit (this is an unintended happy thing):

image

If you don’t want any text there, then delete the text in the setting and save it.

Shared edits added text

The text displayed when it is a Shared Edits post. This is in the Danger color from your palate.

image

Roadmap

  1. Auto tag Topics with ‘wiki’

Please make suggestions as replies to this post.

Install this theme component

「いいね!」 25

Lovely stuff @nathank
I’m going to archive the old wikified post background color repo, in favour of this your new version, which adds much more.

「いいね!」 4

このエラーが発生している人は他にいますか?

Error: Undefined variable: "$Shared-edits-hide". on line 42 of common.scss >> @if ($Shared_edits_hide == "Yes"){ -----^

それを再現できませんし、コードに明らかな問題も見られません。他に何か情報を提供していただけますか?

「いいね!」 1

共有編集を非表示いいえに設定されていたためです。TC設定でエラーが発生しました。はいに設定した後、エラーは解消されました。

最新のDiscourseベータ版で、いいえでもはいでも、それは得られません。古いDiscourseバージョンを使用していますか?バージョン管理は一切行っていません。申し訳ありません。

「いいね!」 1

すみません、私のミスでした。少し古くなっていました。指摘されるまで、最近のアップデート後に再度テストするのを忘れていました。ありがとうございます。 :slight_smile:

「いいね!」 1

共有編集投稿に対応するため、コンポーネントを更新しました。

これには、共有編集の変更への対応が含まれます。

「いいね!」 2

デフォルトの背景色をわずかに調整しました。@メンションが見えにくかったためです

また、共有編集の背景色がデフォルトで tertiary-very-low になりました。

「いいね!」 1

優れたコンポーネントです。しかし、トピックページでのみ表示が改善されます。カテゴリページ、トピックリスト「最近」、「未読」などにウィキアイコンが表示されるように変更することは可能でしょうか?

良い提案ですね。きっと可能だと思います(プルリクエスト歓迎です!)。

私はインスタンスで投稿に#wikiというタグを付けることで、それを処理しています。もちろん半手動ですが、高度な検索でwikiの投稿/トピックを特定できます。サイドバーナビゲーションからも簡単に発見できるという利点もあります。

このコンポーネントの一部として、wiki投稿の自動タグ付け(または、あなたが提案するように)ができれば良いと思っていましたが、残念ながら、それに取り組むほどの苦痛を感じていません。

「いいね!」 2

これは2021年にここで尋ねました:Add an icon in front of wikis in the topic list?

回答は次のとおりでした:

機能リクエスト:

「いいね!」 1

(自動)ダークモードに合わせて背景色を調整する方法についてアドバイスを求めています。

現在、背景に選択した明るい色は、ダークモードで投稿が読めなくなってしまいます。

ウィキやパッドの背景色を定義するために、カラーパレットを拡張し、色の計算を行うことは可能でしょうか?

「wiki」トピックにタグを使用できます。
タグはCSSでスタイル設定できます(IIRC)。
タグのリスト表示/ドリルダウンオプションも追加で利用できます。

さらに、プラグインでwikiを含むトピックにwikiタグを自動的に追加できます。

Scheme カラーを推奨する理由は以下のとおりです。\n\n[quote="Nathan Kershaw, post:1, topic:199492, username:nathank"]\nScheme カラー(つまり、プライマリ、セカンダリ、ターシャリなど)を選択すると、自動ダークモードにレスポンシブに対応するため、最も効果的です。\n[/quote]\nもし、カラーでオフ・ピステを行いたい場合は、ダークモードに対処する巧妙な方法を見つける必要があります。\n\nダークモードカラーの指定を可能にすることも、Nice feature になるでしょう。時間があれば、それを見てみます。

「いいね!」 1

はい。しかし、これらの色は背景にはあまりにも目立ちすぎます。
そのため、10%のSchemeカラーと90%の背景を混ぜたようなものを夢見ていました。SASS(またはそれに類するもの)はフロントエンドでは利用できないと思います。
しかし、このような CSSマジックは機能するでしょうか?

更新:rgba(0, 255, 0, 0.1) はダークモードとライトモードの両方でかなりうまく機能します。

SASS関数はテーマカスタマイズセクションで利用可能です。変更を保存するとコンパイルされます。ただし、テーマやCSS変数でSASS関数を使用することはできません。
カラーコードからSASS関数を使用したい場合は、対応するSASS変数を使用する必要があります。

機能します :white_check_mark:

body {
    background: darken($secondary, 10%);
}

機能しません :x:

body {
    background: darken($my_theme_variable, 10%);
}

機能しません :x:

body {
    background: darken(var(--secondary), 10%);
}

そして、あなたのリンクが説明していることは機能するはずだと思います。:slight_smile:

「いいね!」 3

これは試す価値があるかもしれません。SASSのmix()関数の使用方法に関するガイド(私の参照用)を以下に示します。