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 „Gefällt mir“

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 „Gefällt mir“

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

1 „Gefällt mir“

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 „Gefällt mir“

Gibt es eine Möglichkeit, relative URLs zu verwenden, z. B. /t/50904 anstelle von https://meta.discourse.org/t/50904?

Test zum einfachen Einfügen der gesamten URL: Internal Link Shortcuts - #4 by pfaffman

(ich versuche nur, mir das Konzept anzueignen, die vollständige URL zu verwenden, um auf einen Link auf demselben Server zu verweisen, was das Risiko einer Veraltung des Protokolls oder des Hostnamens birgt… in meinem Fall habe ich eine hinter der Firewall laufende http:-Instanz von Discourse, die wir noch nicht auf TLS migriert haben. Wenn wir also eine Reihe von http:-internen Links haben, werden diese Links dann brechen, wenn sich die URLs auf https: ändern?)

Standard-HTML sollte funktionieren

<a href="/t/internal-link-shortcuts/50904/6">Link</a> wird zu Link.

Auch Markdown funktioniert mit

[Link](/t/internal-link-shortcuts/50904/6) wird zu Link

4 „Gefällt mir“

Wenn Sie nicht glauben, dass jeder Nutzer seine URLs jetzt ohne unmittelbaren Vorteil neu schreiben wird, müssen Sie beim Wechsel des Protokolls ohnehin eine Umleitung einrichten. Sicher, beim Erstellen von URLs könnten Sie das vielleicht tun, aber die meisten Menschen werden das nicht machen. Es ist keine große Sache, eine Umleitung von http://yourdomain/ auf https://yourdomain einzurichten.

Das ist so eine Sache, um die wir Computerleute uns Sorgen machen, die aber wirklich keine Rolle spielt. Es ist wirklich, wirklich schwer, aber Sie sollten es loslassen. :wink:

2 „Gefällt mir“

Ich probiere es aus… mit /t/50904/6

Link zum Beitrag 6

Juhu! Danke

4 „Gefällt mir“