Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 920557f

Browse files
committed
use an imagemap for the "fork me on github" ribbon
Right now, the ribbon on the front page blocks out the possiblity of clicking on the "Index" link, because the "Fork me on Github" link is on top of it. I've rectified this by providing an imagemap, which only makes part of the image clickable as a link. I've verified that it works under Firefox, Chromium, and w3m. I have also moved the ribbon from being only on the front page, to appearing on all pages, since that has the potential of inviting contributors more actively, as most people won't spend much time on the index page, once they are actually using matplotlib, whereas they will be peaking at the gallery, as well as the api docs, etc. I got the numbers for the ribbon from here: susestudio/studio-help#20, but then adjusted them so that the full upper left triangle would be clickable, and not just the ribbon.
1 parent 21b44d3 commit 920557f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/_templates/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
}
3636
</script>
3737

38-
<!-- The "Fork me on github" ribbon -->
39-
<a href="https://github.com/matplotlib/matplotlib"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
4038

4139
<h1>John Hunter (1968-2012)</h1>
4240

doc/_templates/layout.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
<a href="{{ pathto('index') }}"><img src="{{
3737
pathto("_static/logo2.png", 1) }}" border="0" alt="matplotlib"/></a>
3838
</div>
39+
40+
<!-- The "Fork me on github" ribbon -->
41+
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" usemap="#ribbonmap"/>
42+
<map name="ribbonmap">
43+
<area shape="poly" coords="20,2,148,-1,148,135" href="https://github.com/matplotlib/matplotlib" alt="Fork me on GitHub" />
44+
</map>
45+
3946
{{ super() }}
4047
{% endblock %}
4148

0 commit comments

Comments
 (0)