Skip to content

Link to Keywords is a broken link #653

@kevinlin1

Description

@kevinlin1

The on-hover "Link to Keywords" element is a broken link since the anchor #keywords does not exist. Compare the broken implementation of Keywords.tsx:

<div className={classNames('mb-10 group', className)}>
<span className="mr-2 font-semibold">Keywords:</span>
{keywords.map((k, i) => (
<span
key={k}
className={classNames({
"after:content-[','] after:mr-1": i < keywords.length - 1,
})}
>
{k}
</span>
))}
<HashLink id="keywords" title="Link to Keywords" hover className="ml-2" />
</div>

To the working implementation of Abstract.tsx:

<div className={className}>
<h2 id={id} className="mb-3 text-base font-semibold group">
{title}
<HashLink id={id} title={`Link to ${title}`} hover className="ml-2" />
</h2>
<div className="px-6 py-1 mb-3 rounded-sm bg-slate-50 dark:bg-slate-800">
<MyST ast={content} className="col-body" />
</div>
</div>

Line 18 of Abstract.tsx defines the id for the h2, which provides the destination for the HashLink. This is missing from Keywords.tsx

While we could easily add an id to the Keywords.tsx span, how important is the "Keywords" link? Unlike the abstract, the keywords aren't given a specific heading level so I'm wary of just adding the id.

I suggest removing the HashLink in Keywords.tsx. If this sounds good, I can submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions