<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 5:03 AM, Cory Benfield <span dir="ltr"><<a href="mailto:cory@lukasa.co.uk" target="_blank">cory@lukasa.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
> On 4 Dec 2015, at 10:06, Thomas Goirand <<a href="mailto:zigo@debian.org">zigo@debian.org</a>> wrote:<br>
><br>
> That's actually a very good idea, I didn't think it was possible. Could<br>
> you explain a bit more how this kind of patch would look like?<br>
<br>
</span>Sure. Rather than explain and take the credit, I’ll point you directly at the code in the Alabaster[0] repository that controls this and from where I ‘borrowed’ the idea.<br>
<br>
Here[1] is the code in the Alabaster ‘layout.html’ file that optionally includes the GA tracking script. Per the README[2], you can then set html_theme_options = {‘analytics_id’: <some string>}, which will cause the GA tracking script to be included with the appropriate ID.<br>
<br>
I’m not exactly sure where the OpenStack theme lives, but assuming it’s the one in oslosphinx/theme/openstack, then you’d add the appropriate conditional template block here[3], probably with a default value in this file[4].<br>
<br>
If this seems like something that’s generally desired, I’m open to making the actual patch to oslosphinx (or wherever the actual theme is mastered) myself.<br></blockquote><div><br></div><div>Great, thanks! This would work well for both oslosphinx and openstackdocstheme:</div><div><br></div><div><a href="http://git.openstack.org/cgit/openstack/openstackdocstheme/">http://git.openstack.org/cgit/openstack/openstackdocstheme/</a></div><div><br></div><div>Anne</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Cory<br>
<br>
[0]: <a href="https://github.com/bitprophet/alabaster" rel="noreferrer" target="_blank">https://github.com/bitprophet/alabaster</a><br>
[1]: <a href="https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/alabaster/layout.html#L36-L52" rel="noreferrer" target="_blank">https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/alabaster/layout.html#L36-L52</a><br>
[2]: <a href="https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/README.rst#theme-options" rel="noreferrer" target="_blank">https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/README.rst#theme-options</a><br>
[3]: <a href="https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/layout.html#L97-L108" rel="noreferrer" target="_blank">https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/layout.html#L97-L108</a><br>
[4]: <a href="https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/theme.conf" rel="noreferrer" target="_blank">https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/theme.conf</a><br>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Anne Gentle</div><div>Rackspace</div><div>Principal Engineer</div><div><a href="http://www.justwriteclick.com" target="_blank">www.justwriteclick.com</a></div></div></div>
</div></div>