> On 4 Dec 2015, at 10:06, Thomas Goirand <z...@debian.org> wrote:
> 
> That's actually a very good idea, I didn't think it was possible. Could
> you explain a bit more how this kind of patch would look like?

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.

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.

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].

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.

Cory

[0]: https://github.com/bitprophet/alabaster
[1]: 
https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/alabaster/layout.html#L36-L52
[2]: 
https://github.com/bitprophet/alabaster/blob/49f1bfec244609ab1a47592087342725163a2e88/README.rst#theme-options
[3]: 
https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/layout.html#L97-L108
[4]: 
https://github.com/openstack/oslosphinx/blob/f8d71ac5ad023a32cbbe04e109eb2793433ee558/oslosphinx/theme/openstack/theme.conf

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to