-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Relative links for non-JS browsers #228
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts?
src/theme/index.hbs
Outdated
@@ -20,6 +20,14 @@ | |||
<link rel="stylesheet" href="highlight.css"> | |||
<link rel="stylesheet" href="tomorrow-night.css"> | |||
|
|||
{{#previous}} | |||
<link rel="prev" href="{{link}}#content"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling that this should be connected to https://github.com/azerupi/mdBook/pull/228/files#diff-9f0d373829e789d9a6923dd290c5b174R83
src/theme/index.hbs
Outdated
{{/previous}} | ||
|
||
{{#next}} | ||
<link rel="next" href="{{link}}#content"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. Here's a simplification. I added #content for convenience, but this doesn't seem to disturb chrome or firefox. |
@azerupi what do you think? |
src/theme/index.hbs
Outdated
{{/previous}} | ||
|
||
{{#next}} | ||
{{/next}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to do anything, is this a relic you forgot to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, yes.
@@ -72,13 +78,13 @@ | |||
|
|||
<!-- Mobile navigation buttons --> | |||
{{#previous}} | |||
<a href="{{link}}" class="mobile-nav-chapters previous"> | |||
<a rel="prev" href="{{link}}#content" class="mobile-nav-chapters previous"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is #content
supposed to do? When I test it locally it doesn't seem to change anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 'eww', #content causes prev/next to jump past the TOC to the content. A "skip to content" link would probably be better for supporting screen readers etc, this is just what I'm using to generate books locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, focusing on the content rather than the TOC has been requested in #235. But #content
does not solve that issue, could you maybe try adding tabindex=1
to the content to see if it solves both issues at the same time? :)
I merged this with a small modification, I left out the Thanks a lot for the PR and I'm terribly sorry for the delay. :) |
mdBook is a mostly pleasant experience in emacs' 'eww' browser (and probably other non-JS browsers). Next and prev links make it a bit more seemless.