diff options
author | luxagraf <sng@luxagraf.net> | 2016-02-07 20:26:58 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-02-07 20:26:58 -0500 |
commit | 09756d90d71711749512af471f2faf1f57cc639f (patch) | |
tree | e9ef2600c0964756f7ef04ab1d1f5ada8311dd4a | |
parent | aa65ac8c06d493a35a5822c85f882da3ef9022f4 (diff) |
added in-page links to book highlights for easier linking
-rw-r--r-- | design/sass/_books.scss | 14 | ||||
-rw-r--r-- | design/templates/details/book.html | 5 |
2 files changed, 17 insertions, 2 deletions
diff --git a/design/sass/_books.scss b/design/sass/_books.scss index ec81b7e..b0159c0 100644 --- a/design/sass/_books.scss +++ b/design/sass/_books.scss @@ -166,6 +166,20 @@ .highlights article:first-of-type { margin-top: 1em; } +.highlink { + margin-right: 1em; + float: left; + font-size: 0.75em; + line-height: 1.6; + color: lighten($body_font, 60); + @include breakpoint(alpha) { + margin-top: 0.5em; + } + &:visited { + color: lighten($body_font, 60); + } +} .highlights .foot { @include fontsize(14); } + diff --git a/design/templates/details/book.html b/design/templates/details/book.html index e1d211a..c9e9089 100644 --- a/design/templates/details/book.html +++ b/design/templates/details/book.html @@ -38,8 +38,9 @@ <h4>Highlights:</h4> {% for object in object.bookhighlight_set.all reversed %} <article class="h-entry hentry post--article book" itemscope itemType="http://schema.org/Article"> - {{object.body_html|safe|amp|smartypants}} - <p class="foot">page: {{object.page}} <small>kindle location: {{object.location|cut:"["|cut:"]"}}</small></p> + <a class="highlink" name="h{{forloop.counter}}-page-{{object.page}}" href="#h{{forloop.counter}}-page-{{object.page}}">¶</a> + {{object.body_html|safe|amp|smartypants}} + <p class="foot">page: {{object.page}} {% if object.location %}<small>kindle location: {{object.location|cut:"["|cut:"]"}}</small>{%endif%}</p> </article> {% endfor %} </div> |