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

Already on GitHub? Sign in to your account

Layout: Add anchor links to all subheads #813

Merged
merged 2 commits into from Apr 12, 2015

Conversation

Projects
None yet
2 participants
Contributor

harding commented Apr 9, 2015

This pull adds anchors to all subheadings (h2 through h6) on the site, except for the subheadings on the Choose Your Wallet page (which are almost all hidden by default).

Also added is a test to the Makefile that errors out if any subhead doesn't have the id attribute necessary to create an anchor.

This has no effect on the appearance of the site, but when combined with a pull request #814, it add an iconified link to the a subhead's anchor when a Javascript-enabled user hovers over the subhead.

Live preview of this PR plus PR #814 merged together: http://dg1.dtrt.org/en/bitcoin-for-individuals

Screenshots of the anchor link icon in different layouts:

2015-04-09-112414_1280x800_scrot

2015-04-09-112425_1280x800_scrot

Style: Add anchor links to all subheads
* Adds Makefile test to ensure all subheadings, except those on Choose
  Your Wallet, have an ID (anchor reference)

* Adds an ID to all subheads that didn't have on previously

@saivann saivann and 1 other commented on an outdated diff Apr 9, 2015

_templates/download.html
@@ -21,7 +21,9 @@
<link rel="alternate" type="application/rss+xml" href="/en/rss/releases.rss" title="Bitcoin Core releases">
<div class="download">
<h1>{% translate pagetitle %}</h1>
- <h2>{% translate latestversion %} {{ site.DOWNLOAD_VERSION }}<a type="application/rss+xml" href="/en/rss/releases.rss"><img src="/img/icons/icon_rss.svg" alt="rss" class="rssicon"></a></h2>
+ <div class="inline-block">
+ <h2 id="latestversion">{% translate latestversion %} {{ site.DOWNLOAD_VERSION }}<a type="application/rss+xml" href="/en/rss/releases.rss"><img src="/img/icons/icon_rss.svg" alt="rss" class="rssicon"></a></h2>
+ </div>
@saivann

saivann Apr 9, 2015

Contributor

@harding This workaround kind of breaks down the layout for mobile users (see screenshot below), probably because the download button isn't shown. May I suggest you convert this title into a stylized DIV?

capture du 2015-04-09 15 30 50

@harding

harding Apr 9, 2015

Contributor

@saivann thanks for catching that! I really do have to remember to do more mobile testing. I fixed it by removing the commit that added the workaround, removing the header IDs so no anchor links are displayed, and exempting the Download page from the anchor link checking (it's not like anyone is likely to link to the anchors on this page anyway). I checked that in Firefox's responsive test mode and it's no longer broken.

Contributor

harding commented Apr 10, 2015

In the absence of critical feedback, I will merge this pull around 23:00 UTC Saturday.

@harding harding merged commit 8991568 into bitcoin-dot-org:master Apr 12, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

harding added a commit that referenced this pull request Apr 12, 2015

Merge pulls #813 and #821
* 813: Layout: Add anchor links to all subheads
* 821: Standardize translation links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment