WordPress.org

Making WordPress.org

Changeset 7078


Ignore:
Timestamp:
04/10/2018 09:33:50 AM (3 years ago)
Author:
ocean90
Message:

Trac: Append a version string to Trac's JavaScript/CSS files hosted on the w.org CDN.

For testing purposes limited to meta.trac for now.

See #3526.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site.html

    r7066 r7078  
    3737<xi:include href="site-ticket.html" />
    3838
     39<!--! Append a version string to CSS files hosted on the w.org CDN -->
     40<py:if test="project_slug == 'meta'">
     41    <py:match path="link[@rel='stylesheet' and starts-with(@href,'https://s.w.org/') and substring-after(@href,'.css') = '']">
     42        <link rel="stylesheet" href="${select('@href')}?v=${scripts_version}" />
     43    </py:match>
     44</py:if>
     45
    3946<!--! Styles and such. Load before first JS file (jquery.js) -->
    4047<py:match path="head/script[contains(@src,'jquery.js')]">
     
    5764    </py:if>
    5865</py:match>
     66
     67<!--! Append a version string to JS files hosted on the w.org CDN -->
     68<py:if test="project_slug == 'meta'">
     69    <py:match path="script[starts-with(@src,'https://s.w.org/') and substring-after(@src,'.js') = '']">
     70        <script src="${select('@src')}?v=${scripts_version}">${select('*|comment()|text()')}</script>
     71    </py:match>
     72</py:if>
    5973
    6074<!--! Remove Trac logo and footer -->
Note: See TracChangeset for help on using the changeset viewer.