Skip to content

Translator credit is hidden on the landing page #432

Description

@mmcky

The translators option added in v0.22.0 credits translators on content pages but not on the landing page. docs/user/authors.md already lists this under Limitations, so this is a known gap rather than a regression — filing it to track closing it, because the landing page is the one page where the credit matters most.

Why it matters

For a translated edition the landing page is the front door. A reader arriving at a Malayalam or Persian edition wants to know who produced that translation before they start reading, and that is exactly the page where the credit is missing. The authors line is already relocated into that position, so the reader sees the original authors but no indication that anyone translated the edition at all.

What actually happens

The credit is not omitted from the landing page — it is rendered into the HTML and then hidden. Two pieces combine:

  1. _page.scss hides the entire page header on the landing page: the &__header rule opens with .main-index & { display: none; }.
  2. page-header.js initPageHeader() recovers only the authors from that hidden block. It reads .qe-page__header-authors, clones its innerHTML into a new <p id="qe-page-author-links">, and inserts it after the .main-index h1. There is no equivalent recovery for .qe-page__header-translators.

So the translators paragraph stays inside the hidden container. display: none also removes it from the accessibility tree, so it is not reaching screen readers either — it is inert markup.

Reproduction

Live on a real edition — lecture-python-programming.ml PR #10 preview, built against 0.22.0 with a single translator configured:

Page qe-page__header-translators in HTML Visible to reader
Landing page (class="main-index") yes no — inside the hidden header
A lecture page yes yes

Suggested direction

Extend initPageHeader() to relocate the translators paragraph alongside the authors one, so both survive the hidden header. One detail to decide as part of that: .main-index #qe-page-author-links carries the border-bottom: 5px solid #0072bc accent rule, so if the translators line is appended below the authors line it either needs to sit above that rule or the rule needs to move to whichever element ends up last. On content pages the two already share the accent rule, so matching that reading on the landing page seems right.

Worth confirming the intended behaviour when a landing page sets translators: [] in its own front matter — presumably the same suppression that already works on content pages should apply.

Config that reproduces it, for reference:

sphinx:
  config:
    html_theme_options:
      translators:
        - name: Adisankar Manoj Thanuja
          url: https://www.linkedin.com/in/adisankar-m-t/

Follows on from #426.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing material

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions