elotroalex / ed

A jekyll theme for minimal editions
Other
125 stars 132 forks source link

Append page name to hypothes.is via links #28

Closed MartinPaulEve closed 8 years ago

MartinPaulEve commented 8 years ago

At present the "Annotate this" link is not truly descriptive since the URL to which it points will redirect the user back to the homepage. By append page.name as a liquid variable to the end of the URL the page will reload to the current edition.

However, even with this PR the user will still lose his or her place in the current text, so annotation becomes disruptive. You could consider replacing the via hypothesis method with an inline javascript method:

javascript:(function(){var%20d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/app/embed.js');d.body.appendChild(s);setTimeout(function(){$('[name=\"sidebar-toggle"]').click();}, 1500);})();

since this is what the hypothesis code does anyway.

elotroalex commented 8 years ago

Thanks, Martin! I'll add the javascript later to test it out.