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 « J'aime »

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 « J'aime »

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

1 « J'aime »

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 « J'aime »

Existe-t-il un moyen d’utiliser des URL relatives, par exemple /t/50904 au lieu de https://meta.discourse.org/t/50904 ?

test pour coller simplement l’URL complète : Internal Link Shortcuts - #4 by pfaffman

(je tente simplement de comprendre le concept d’utilisation de l’URL complète pour faire référence à un lien sur le même serveur, ce qui semble risquer une obsolescence du protocole ou du nom d’hôte… dans mon cas, j’ai une instance Discourse derrière un pare-feu en http: que nous n’avons pas encore migrée vers TLS. Si nous avons un certain nombre de liens internes en http:, aurons-nous des liens brisés lorsque les URL passeront en https: ?)

Le HTML standard devrait fonctionner

<a href="/t/internal-link-shortcuts/50904/6">Lien</a> devrait devenir Lien.

Le Markdown devrait également fonctionner avec

[Lien](/t/internal-link-shortcuts/50904/6) devient Lien

4 « J'aime »

À moins que vous ne pensiez que chaque utilisateur, à chaque fois, réécrira ses URLs maintenant sans bénéfice immédiat, vous devrez de toute façon procéder à une redirection lors du changement de protocole. Certes, vous pourriez être prêt à le faire lors de la création des URLs, mais la plupart des gens ne le feront pas. Ce n’est pas une grande affaire de rediriger http://votredomaine/ vers https://votredomaine.

C’est le genre de chose dont nous, les informaticiens, nous inquiétons alors que cela ne fait vraiment pas de différence. C’est vraiment, vraiment difficile, mais vous devriez laisser tomber. :wink:

2 « J'aime »

Essai… avec /t/50904/6

lien vers le message 6

Super ! Merci

4 « J'aime »