Internal Link Shortcuts

Today I was looking for a way to link to a post in the same topic.

The :link: icon, when clicked, shows post #4, so I tried: using #4 and post#4, only to get frustrated, but discovering that the # character pops up categories to link (which I read about extensively since, in meta.)

Now, I find this quite inconsistent, and would like to propose ways to consistently address internal links that matches the actual URL format, or already used patterns…

Generic Patterns

Using colon as a prefix or separator would be nice, but it already autocompletes to emoticons and that could become messy. But consider: :4, :10:4, and 3:10:4 (with optional colon prefix) to link to post number 4 in the current topic, post number 4 in topic 10, and post number 4 in topic 10 of category 3.

Using / instead might work, but then it should match the URL, e.g., /c/3, /t/10, and /t/10/4.

The “quote reply” to a post uses keyword colon number, e.g., post:4 or topic:123. This can be very useful is there’s a way to show these IDs with every post (e.g., with an element title or tooltip).

In general though, #post_4 would use the actual anchor in the HTML. #4 would be great too, but it conflicts with the (current) category shortcut (BTW, what happens when you have a category name matching a tag name?)

Both solutions though are problematic for i10n since they impose English words.

The shortcut to a post in the current topic should make category and topic implicit.

Since topic IDs are global, .. can be useful, as in .[optional topic ID].[post number], e.g.:

  • ..4 to link to post #4 in current topic
  • .10.4 to link to post #4 in topic 10
「いいね!」 1

Use the URL to the post. You can also edit the URL to make it refer to a specific post number in the topic as needed.

「いいね!」 1

But that requires using the mouse instead of the keyboard, doesn’t it?

「いいね!」 1

You can use j and k to navigate through the posts and the URL changes accordingly, so you can ^L^C to copy the URL of the current post.

Except it’s off by one:

https://meta.discourse.org/t/url-off-by-one-when-moving-through-posts-with-keyboard/50925

「いいね!」 4

相対 URL(例:/t/50904)を使用して、https://meta.discourse.org/t/50904 のような完全な URL の代わりに参照することは可能でしょうか?

URL 全体を貼り付けるだけのテスト:Internal Link Shortcuts - #4 by pfaffman

(同じサーバー上のリンクを参照するために完全な URL を使用する概念について理解しようとしています。プロトコルやホスト名の陳腐化のリスクがあるように思えます。私の場合、ファイアウォール裏で動作する http: 版の Discourse インスタンスがあり、まだ TLS への移行を行っていません。もし多数の http: 内部リンクが存在する場合、URL が https: に変更された際にリンクが壊れてしまうのでしょうか?)

標準の HTML は機能します

<a href="/t/internal-link-shortcuts/50904/6">Link</a><a href="/t/internal-link-shortcuts/50904/6">Link</a> になります。

Markdown も機能し、

[Link](/t/internal-link-shortcuts/50904/6)Link になります。

「いいね!」 4

すべてのユーザーが即座のメリットもないのに、いつでも URL を書き換えるとは考えられない限り、プロトコルを変更する際にはリマップを行う必要があります。もちろん、URL を作成する際にそれを行うことをいとわないかもしれませんが、ほとんどの人はそうしません。http://yourdomain/https://yourdomain にリマップするのは、それほど大きな問題ではありません。

これは、私たちコンピューター関係者が気にしがちですが、実際には影響しないようなことです。非常に、非常に難しいことですが、気にしなくて大丈夫です。:wink:

「いいね!」 2

試してみます… /t/50904/6

投稿 6 へのリンク

やった!ありがとう

「いいね!」 4