mirror of https://github.com/istio/istio.io.git
Workaround for the fact Jekyll generates ALT attributes for <img> entries into of TITLE attributes.
This commit is contained in:
parent
679beb4a8b
commit
c4797866bd
|
@ -39,7 +39,7 @@ There are 3 versions of the reviews microservice:
|
|||
|
||||
The end-to-end architecture of the application is shown below.
|
||||
|
||||

|
||||

|
||||
|
||||
This application is polyglot, i.e., the microservices are written in different languages.
|
||||
|
||||
|
@ -156,7 +156,7 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
http://104.196.248.114:8088/dotviz). After the single `curl` request from an earlier step,
|
||||
the resulting image will look something like:
|
||||
|
||||

|
||||

|
||||
|
||||
The servicegraph should show very low (or zero) QPS values, as only a single request has been sent. The
|
||||
service uses a default time window of 5 minutes for calculating moving QPS averages. Send a consistent
|
||||
|
|
|
@ -77,6 +77,7 @@ layout: compress
|
|||
<script src="{{home}}/js/waves.js"></script>
|
||||
<script src="{{home}}/js/buttons.js"></script>
|
||||
<script src="{{home}}/js/search.js"></script>
|
||||
<script src="{{home}}/js/fixMarkdownImages.js"></script>
|
||||
|
||||
{% if page.customjs %}
|
||||
<script async="" defer="" type="text/javascript" src="{{ page.customjs }}"></script>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
// Jekyll's markdown processor attaches ALT attributes to <img> elements.
|
||||
// That's a bug, it really should be attaching TITLE attributes instead.
|
||||
// This script grovels the DOM and assigns a TITLE attribute if one is not
|
||||
// present by cloning the ALT attribute.
|
||||
(function(){
|
||||
var images = document.getElementsByTagName('img');
|
||||
for (var i = 0; i < images.length; i++) {
|
||||
var img = images[i];
|
||||
var title = img.getAttribute("title");
|
||||
if (title == undefined) {
|
||||
title = img.getAttribute("alt");
|
||||
if (title != undefined) {
|
||||
img.setAttribute("title", title);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
Loading…
Reference in New Issue