Hi Adam, that approach is followed in order to be consumed from other projects like theme docs, using an ajax call doing a get and including its content dynamically on the page, also the css dir its not used bc otherwise it will not point to the rite css path on the fore-mentioned approach, instead its using the absolute path in order to load the css correctly through the ajax call ( check https://review.openstack.org/#/c/585516/) on docs theme the deprecation badge is loaded using this snippet <script type="text/javascript"> $(document).ready(function(){ $.ajax({ context: this, dataType : "html", url : "https://docs.openstack.org/{{ series }}/badge.html", success : function(results) { $('#deprecated-badge-container').html(results); } }); }); </script> on file openstackdocstheme/theme/openstackdocs/layout.html hope that shed some lite , have in mind that its a first iteration and any better approach its welcome regards El vie., 4 ene. 2019 a las 20:45, Adam Spiers (<aspiers@suse.com>) escribió:
Hi all,
I'm currently hacking on the deprecation badges in openstack-manuals, and there's a couple of things I don't understand. Any chance someone could explain why www/latest/badge.html doesn't just do:
{% include 'templates/deprecated_badge.tmpl' %}
like all the others?
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
I'm also what exactly would be wrong with the included CSS path if CSSDIR was used in www/templates/deprecated_badge.tmpl instead of heeding this caveat:
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
It would be good to fix it to use CSSDIR because currently it's awkward to test CSS changes.
Thanks! Adam
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet