cue icon indicating copy to clipboard operation
cue copied to clipboard

cuelang.org: preprocessor: "link to search page" directive

Open jpluscplusm opened this issue 2 years ago • 4 comments
trafficstars

In addition to being a link, I'd like to represent to the user that a link goes to the in-site search page.

This will be useful for establishing the language and taxonomy of the range of tags they can search inside, and the different keys they can use in addition to tag. Having a specific visual representation, with continuity across the site, will help the user internalise what discovery tools we're placing at their disposal.

I've come up with this, constructed from HTML entities:

[🔍 tag:some tag](/search?q=tag:some%20tag)

Which renders as

🔍 tag:some tag

The magnifying glass has a mirrored variant, #x1F50E;:

🔎 tag:some tag

Personally, I prefer the D variant's appearance, but of course the entire point of having a preprocessor directive is for the appearance to be decoupled from the use.

The non-breaking space is important to avoid a line wrap/break being inserted. Without it, and without a normal space (which might get broken across lines), the appearance is:

🔍tag:some tag

... whose kerning is displeasing, to my eye.

It would be useful if the directive accepted more than just the exact, URL-encoded search string ... perhaps:

  • {{{ search tag "some tag" }}}
  • {{{ search text "some specific text" }}}

... but that's a nice to have.

jpluscplusm avatar Aug 30 '23 10:08 jpluscplusm

@jpluscplusm - I think we have this working now, no?

myitcv avatar Feb 15 '24 06:02 myitcv

@myitcv I don't believe this is a feature I've seen working on the site.

jpluscplusm avatar Feb 15 '24 06:02 jpluscplusm

We have the Hugo tag shortcode, but I'm not sure it achieves the "this is a link to a search page" intent of this issue, and it doesn't allow linking to arbitrary search terms.

jpluscplusm avatar Feb 15 '24 06:02 jpluscplusm

Apologies, you're quite right. Was thinking about something else entirely... without properly re-reading the issue :(

myitcv avatar Feb 15 '24 08:02 myitcv