Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic anchor links for headers #48

Closed
vapier opened this issue Jan 8, 2020 · 10 comments
Closed

automatic anchor links for headers #48

vapier opened this issue Jan 8, 2020 · 10 comments

Comments

@vapier
Copy link

vapier commented Jan 8, 2020

github automatically generates links for all headers in markdown files. the themes should too.

for example, viewing this repo:
https://github.com/pages-themes/hacker
if you mouse over "The Hacker theme" or "Usage", a little link shows up for easy clicking/copying.

@stale
Copy link

stale bot commented Mar 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 8, 2020
@vapier
Copy link
Author

vapier commented Mar 9, 2020

the request is still relevant. does this project accept FRs ?

@stale stale bot removed the wontfix label Mar 9, 2020
@stale
Copy link

stale bot commented May 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 9, 2020
@stale stale bot closed this as completed May 16, 2020
@PsychoData
Copy link

I believe this theme already adds these headerlinks to the headers from github (or at least possibly keeps them from the Github page? I'm not certain)

On Github, the headers automatically get a link image that appears when you hover over it, which is useful to right-click and copy the link address directly to that section
image

On this theme's pages, it seems like the anchors are already created, and if you manually find them and create a link to them, they work, like this
https://msportals.xyz/#azure-it-admin-portals
image

Could we possibly add something to let you copy the links directly to a section/header more easily?
It looks like AnchorJS might work, but I am not certain how to integrate it into the theme

@vapier
Copy link
Author

vapier commented Oct 30, 2020

the request was about the UI side of things which the theme doesn't do

@PsychoData
Copy link

Oh? I thought that since this theme has the anchors created, but other themes don't, that the theme or something it was using is what was creating the anchors

any idea what might be creating the anchors? Since they are already there once I add the theme, I don't think that trying to recreate them again with AnchorJS like I mentioned above would work correctly, since they would be conflicting

@PsychoData
Copy link

PsychoData commented Oct 30, 2020

wait, I had a bad file - if I remove the Hacker Theme, then my site looks like this and has working header clickable links
image

and the code looks like this, so I'm not sure where the whole <a> element goes once the theme is enabled, but the same anchor appears in the header element directly instead
image

@vapier
Copy link
Author

vapier commented Oct 31, 2020

those pictures aren't using the hacker theme. see this page as an example of missing UI elements:
https://vapier.github.io/nosig/

@PsychoData
Copy link

That's my point though, when I remove the theme, the automatic clickable links are there
image

but when the Hacker theme is added back, they are gone
image

@vapier
Copy link
Author

vapier commented Nov 2, 2020

well, sure, the default theme has the clickable links. that's why this issue is filed against the hacker theme which lacks them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants