You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "culfin (via GitHub)" <gi...@apache.org> on 2026/08/24 03:34:24 UTC

[PR] fix(template): show tag display names instead of their slugs [answer]

culfin opened a new pull request, #1586:
URL: https://github.com/apache/answer/pull/1586

   The server-rendered templates print a tag's **slug** where the React interface
   prints its **display name**:
   
   ```html
   <a href="{{$.baseURL}}/tags/{{.SlugName}}" class="badge-tag …">
     <span class="">{{.SlugName}}</span>
   </a>
   ```
   
   For Latin-script tags this is a matter of case — `binokularsehen` against
   `Binokularsehen`. For everything else it is worse: Answer transliterates slugs
   (hence `mozillazg-go-unidecode` among the dependencies), so a tag named 眼镜
   renders as `yan-jing` on every server-rendered page.
   
   Two audiences are affected: search engines, which see nothing else, and readers,
   until the interface takes over.
   
   Changed in four templates — `question.html`, `question-detail.html`,
   `tag-detail.html` (the heading and the list) and `tags.html`. **Only the text**;
   every `href` goes on using the slug.
   
   ### Note
   
   `display_name` is `not null default ` in `entity.Tag`, so a tag with an empty
   display name would now render as an empty badge. The API requires the field when
   a tag is created, so this should not occur — but if you would rather have a
   fallback, `{{if .DisplayName}}…{{else}}{{.SlugName}}{{end}}` is a one-line
   change and I am happy to add it.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [PR] fix(template): show tag display names instead of their slugs [answer]

Posted by "culfin (via GitHub)" <gi...@apache.org>.
culfin closed pull request #1586: fix(template): show tag display names instead of their slugs
URL: https://github.com/apache/answer/pull/1586


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [PR] fix(template): show tag display names instead of their slugs [answer]

Posted by "culfin (via GitHub)" <gi...@apache.org>.
culfin commented on PR #1586:
URL: https://github.com/apache/answer/pull/1586#issuecomment-5399283355

   Folded into #1592 together with the other three defects in `ui/template/` — one pull request is easier to review than four, and none of them is more than a line or two. Nothing is dropped, and the new one also targets `dev` as requested in #1572. Closing to keep the queue readable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org