Excellent - thank for this. I like the menu link changes especially.
Andy
On 21/04/18 23:05, Bruno P. Kinoshita wrote:
Hi all,
Sharing it here i) so others know what changed in case something breaks soon
and ii) because even though
trivial updates, I found an old post-it in the middle of a pile of papers next
to my desk, where I
left a note to myself.
When launching the new site for OpenNLP, I - shamelessly - copied many parts of
the Jena website. However,
I noticed a small padding, 1 or 2 pixels, under the navigation menu. I spent
quite some time chasing that
in the CSS schema, and found that the OpenNLP logo had no size defined, and it
would be set to 52px due
to some inherited height. Instead, now it is set to 50px, as the other menu
items... so when a menu item
is active, there is no more space (regardless of how small!) under it.
Another thing I noticed in Jena site, was that some items would be highlighted as
"active", receiving a
distinct background colour, but others would not. Then I learned that in each
markdown file you had to
call a piece of JS code to set the active link. I scratched my head for a
while, looking for a lazy-er
solution, and found somewhere the following code snippet.
<script type="text/javascript">
var link = $('a[href="' + this.location.pathname + '"]');
if (link != undefined)
link.parents('li,ul').addClass('active');
</script>
The first line locates an HTML <A> element, with HREF attribute set to our
current location. If found,
that should be our link. Then it tries to locate all parents of that link which are
<LI> or <UL>
(failing in case we have a simple link in a page) and then sets the class to
active.
Finally, looks like NZ or perhaps some of my DNS are getting redirect error for
JQuery 2.0.3
(https://code.jquery.com/jquery-2.0.3.min.js), with a message in the browser
"The page isn’t redirecting properly", but all other files were working. So
I've updated
our JQuery to the latest 2.x version. Tested download/improve/menu links, and
everything
seems to be working fine.
If interested, go have a look at
http://jena.staging.apache.org/index.html
Open some links under Getting involved, Learn, and the main menu should have a
different colour now.
Sorry the long e-mail, just happy to throw away such an old post-it.
Cheers
Bruno