[openstack-dev] Documentation containing external resource links & privacy breaches

Cory Benfield cory at lukasa.co.uk
Fri Dec 4 11:03:23 UTC 2015


> On 4 Dec 2015, at 10:06, Thomas Goirand <zigo at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151204/4a405727/attachment.pgp>


More information about the OpenStack-dev mailing list