WordPress.org

Making WordPress.org

Changeset 10677


Ignore:
Timestamp:
02/16/2021 07:01:53 AM (10 months ago)
Author:
dd32
Message:

Trac: Allow for the s.w.org CDN to be bypassed and have requests go to wordpress.org to test style changes in production.

Location:
sites/trunk/trac.wordpress.org/templates
Files:
2 edited

Legend:

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

    r10509 r10677  
    5353    ticket_preview.html (as site.html isn't) -->
    5454<xi:include href="site-ticket.html" />
    55 
    56 <!--! Append a version string to CSS files hosted on the w.org CDN -->
    57 <py:match path="link[@rel='stylesheet' and starts-with(@href,'https://s.w.org/') and substring-after(@href,'.css') = '']">
    58     <link rel="stylesheet" href="${select('@href')}?v=${scripts_version}" />
    59 </py:match>
    6055
    6156<!--! Styles and such. Load before first JS file (jquery.js) -->
     
    7469    <xi:include href="wporg-head.html" />
    7570    <meta name="viewport" content="width=device-width" />
    76     <link rel='stylesheet' href='https://s.w.org/wp-includes/css/dashicons.min.css?20150710' type='text/css' />
     71    <link rel='stylesheet' href='https://s.w.org/wp-includes/css/dashicons.min.css?${scripts_version}' type='text/css' />
    7772    <link rel="stylesheet" type="text/css" href="https://s.w.org/style/trac/wp-trac.css?${scripts_version}" />
    78     <link py:if="req.session['authenticated']" rel="stylesheet" href="https://s.w.org/wp-includes/css/wp-auth-check.css?ver=3.9-alpha" type="text/css" media="all" />
     73    <link py:if="req.session['authenticated']" rel="stylesheet" href="https://s.w.org/wp-includes/css/wp-auth-check.css?${scripts_version}" type="text/css" media="all" />
    7974
    8075    <script py:attrs="select('@*')"></script>
     
    9691        <meta name="robots" content="$robots"/>
    9792    </py:if>
    98 </py:match>
    99 
    100 <!--! Append a version string to JS files hosted on the w.org CDN -->
    101 <py:match path="script[starts-with(@src,'https://s.w.org/') and substring-after(@src,'.js') = '']">
    102     <script src="${select('@src')}?v=${scripts_version}">${select('*|comment()|text()')}</script>
    10393</py:match>
    10494
     
    330320
    331321    <!--! JavaScript -->
    332     <script src="https://s.w.org/style/js/navigation.min.js?20190128"></script>
    333     <script src="https://s.w.org/style/trac/jquery.caret.min.js?ver=2015-02-01"></script>
    334     <script src="https://s.w.org/style/trac/jquery.atwho.min.js?ver=1.0.1"></script>
     322    <script src="https://s.w.org/style/js/navigation.min.js?${scripts_version}"></script>
     323    <script src="https://s.w.org/style/trac/jquery.caret.min.js?${scripts_version}"></script>
     324    <script src="https://s.w.org/style/trac/jquery.atwho.min.js?${scripts_version}"></script>
    335325    <script src="https://s.w.org/style/trac/wp-trac.js?${scripts_version}"></script>
    336326
     
    380370
    381371<xi:include href="site-specific.html"><xi:fallback /></xi:include>
     372
     373<!--! The following rules should be just before `</html>` to ensure it affects all of the document. -->
     374
     375<!--! Append a version string to CSS files hosted on the w.org CDN -->
     376<py:match path="link[@rel='stylesheet' and starts-with(@href,'https://s.w.org/') and substring-after(@href,'.css') = '']">
     377    <link rel="stylesheet" href="${select('@href')}?v=${scripts_version}" />
     378</py:match>
     379
     380<!--! Append a version string to JS files hosted on the w.org CDN -->
     381<py:match path="script[starts-with(@src,'https://s.w.org/') and substring-after(@src,'.js') = '']">
     382    <script src="${select('@src')}?v=${scripts_version}">${select('*|comment()|text()')}</script>
     383</py:match>
     384
     385<!--! Allow bypassing the WordPress.org CDN for testing. -->
     386<py:if test="'cdn' in req.args and 'wordpress.org' == req.args.cdn">
     387    <py:match path="link[@rel='stylesheet' and starts-with(@href,'https://s.w.org/')]">
     388        <link rel="stylesheet" href="${select('@href').render().replace('s.w.org','wordpress.org')}" />
     389    </py:match>
     390    <py:match path="script[starts-with(@src,'https://s.w.org/')]">
     391        <script src="${select('@src').render().replace('s.w.org','wordpress.org')}">${select('*|comment()|text()')}</script>
     392    </py:match>
     393</py:if>
     394
    382395</html>
  • sites/trunk/trac.wordpress.org/templates/wporg-head.html

    r9095 r10677  
    2424    </style>
    2525    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600&amp;subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic' rel='stylesheet' type='text/css' />
    26     <link rel="stylesheet" href="https://s.w.org/style/wp4.css?80" />
     26    <link rel="stylesheet" href="https://s.w.org/style/wp4.css" />
    2727    <!--[if lte IE 8]>
    2828    <style type="text/css">
Note: See TracChangeset for help on using the changeset viewer.