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

Add "permalink" anchor links to page subsections #461

Open
jywarren opened this issue Apr 27, 2021 · 5 comments · May be fixed by #462
Open

Add "permalink" anchor links to page subsections #461

jywarren opened this issue Apr 27, 2021 · 5 comments · May be fixed by #462
Labels
add-code-links Please help by adding links to where the code is for the described work. help wanted

Comments

@jywarren
Copy link
Member

We have a nice menu now to link down to subsections on the page, using id attributes and URL hashes, like this:

https://code.publiclab.org/#fto-author

The code for the menu looks like this:

<li><a class="line" href="#candidate">Candidates</a></li>
<li><a class="line" href="#fto-author">FTO Authors</a></li>
<li><a class="line" href="#contributer">Contributers</a></li>
<li><a class="line" href="#lang-sec">Languages Used</a></li>

Let's make each header into a link as well, so they're easy to "deep link" to, so you get right to the correct section. This will require adding an A tag around the text of each header, like <a href="#fto-author">...</a>, similarly to the above.

However, some sections get edited live by JavaScript, for example to update the counts, in sections like this, "Stale issues (COUNT)":

image

For those, we need to see if making that section into a link breaks this functionality, or if we need to adjust other areas of code to accommodate them being links.

This is therefore a little more complex than a first-timers-only issue! We'd still love help on it however!

@jywarren jywarren added help wanted add-code-links Please help by adding links to where the code is for the described work. labels Apr 27, 2021
@TildaDares
Copy link
Member

@jywarren I'd love to work on this.

@jywarren
Copy link
Member Author

jywarren commented Apr 27, 2021 via email

@TildaDares
Copy link
Member

@jywarren I replaced this https://github.com/publiclab/community-toolbox/blob/main/src/UI/issuesUI.js#L37 with

$('#stale-head').html('<a href="#stale-head">Stale Issues ('+issuesLen+'+)</a>');

The change does not break the count functionality

Untitled.mov

@jywarren
Copy link
Member Author

jywarren commented Apr 28, 2021 via email

@TildaDares TildaDares linked a pull request Apr 28, 2021 that will close this issue
5 tasks
@vedant-z
Copy link

vedant-z commented Nov 7, 2022

@jywarren Is this issue still open. If so I would like to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-code-links Please help by adding links to where the code is for the described work. help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants