Skip to content

Commit

Permalink
All: Import config for blog.jqueryui.com and blog.jquerymobile.com
Browse files Browse the repository at this point in the history
Follows-up 9131422, which did most
of the legwork already by importing theme code for blog.jquery.com,
which I did (mostly) in a way that is shared and blended into the
jquery base theme so that there is very little to import from the
jqueryui and jquerymobile blog themes, yet producing an identical
rendering for them.

From https://github.com/jquery/blog.jquery.com-theme/tree/6710984735eb980cc9845b17f98aa0db8eac09e6/jqueryui.com
and https://github.com/jquery/blog.jquery.com-theme/tree/6710984735eb980cc9845b17f98aa0db8eac09e6/jquerymobile.com

blog/jqueryui.com -> themes/jqueryui.com
blog/jquerymobile.com -> themes/jquerymobile.com

* /category.php
  /index.php
  /style.css

  Redundant with inherited themes/jquery/category.php.
  Is identical apart from minor coding style differences.

* /content.php

  Redundant with inherited themes/jquery/content.php.

  Slight differences regarding showing excerpts for non-first
  results on the home page, which has been intentionally
  changed in previous commits to jquery-wp-content, and blog still
  has the older version. Ignore in favour of what we have here.

* /footer.php

  Same as destination themes/jqueryui.com/footer.php.

* /single.php
  /sidebar.php

  These differ from the base theme in an important way, but are
  identical to the one for blog.jquery.com, which I previously
  imported into the base theme single-blogpost.php and
  sidebar-blogpost.php, so we only need stubs there, just like we
  did in themes/jquery.com/ before.

* /functions.php
  - Hardcodes "jquery-ui" or "jquery-mobile" for body_class.
    We set this via the jquery_body_class option in sites.php instead.
  - Various dynamic body class entries.
    This is already covered by /plugins/jquery-filters.php,
    which we enable on all sites and will be enabled on the blog too
    when we switch it to use jquery-wp-content.

Additionally, blog/jquerymobile.com/ had a builder.css and builder.js.
They were copied to the blog when the blog originally forked off
from jquery-wp-content, and were never used there. The copy in the
original repo here has since been removed in
bd3f0d61cdc98
as part of #272.

Ref jquery/infrastructure-puppet#17
  • Loading branch information
Krinkle committed Apr 18, 2024
1 parent c974c08 commit b12072b
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 12 deletions.
29 changes: 24 additions & 5 deletions sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function jquery_sites() {
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'jQuery',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'stylesheet' => 'jquery.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquery_com',
Expand All @@ -35,12 +35,13 @@ function jquery_sites() {
'options' => array(
'blogname' => 'Official jQuery Blog',
'blogdescription' => 'New Wave JavaScript',
'jquery_author' => 'jQuery Team - jquery.com',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
'stylesheet' => 'jquery.com',
'jquery_body_class' => 'jquery',
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery',
),
),
'api.jquery.com' => array(
Expand Down Expand Up @@ -87,8 +88,13 @@ function jquery_sites() {
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI Blog',
'stylesheet' => 'blog.jqueryui.com',
'blogdescription' => 'All news about jQuery UI',
'permalink_structure' => '/%year%/%monthnum%/%postname%/',
'stylesheet' => 'jqueryui.com',
'jquery_body_class' => 'jquery-ui',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
Expand Down Expand Up @@ -181,6 +187,19 @@ function jquery_sites() {
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'blog.jquerymobile.com' => array(
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile Blog',
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
'stylesheet' => 'jquerymobile.com',
'jquery_body_class' => 'jquery-mobile',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'brand.jquery.org' => array(
'cookie_domain' => '.jquery.org',
'options' => array(
Expand Down
2 changes: 1 addition & 1 deletion themes/jquery.com/single.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
get_template_part( 'single', 'blogpost' );
get_template_part( 'single-blogpost' );
2 changes: 1 addition & 1 deletion themes/jquery/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The default sidebar lists categories, up to 2 levels deep.
*/
if ( get_option( 'jquery_is_blog' ) ):
require __DIR__ . '/sidebar-blogpost.php';
get_template_part( 'sidebar-blogpost' );
else:
?>
<div id="sidebar" class="widget-area" role="complementary">
Expand Down
2 changes: 1 addition & 1 deletion themes/jquerymobile.com/footer.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php get_template_part( 'footer', 'mobile' ); ?>
<?php get_template_part( 'footer', 'mobile' );
2 changes: 0 additions & 2 deletions themes/jquerymobile.com/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@

// jquerymobile.com doesn't use sidebars, so we alias page to page-contentfull
get_template_part( 'page', 'contentfull' );

?>
2 changes: 2 additions & 0 deletions themes/jquerymobile.com/single.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
get_template_part( 'single-blogpost' );
2 changes: 1 addition & 1 deletion themes/jqueryui.com/footer.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php get_template_part( 'footer', 'ui' ); ?>
<?php get_template_part( 'footer', 'ui' );
8 changes: 7 additions & 1 deletion themes/jqueryui.com/sidebar.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div id="sidebar" class="widget-area" role="complementary">
<?php
if ( get_option( 'jquery_is_blog' ) ):
get_template_part( 'sidebar-blogpost' );
else:
?><div id="sidebar" class="widget-area" role="complementary">
<aside class="widget">
<h3 class="widget-title">Interactions</h3>
<ul>
Expand All @@ -24,3 +28,5 @@
</ul>
</aside>
</div>
<?php
endif;
2 changes: 2 additions & 0 deletions themes/jqueryui.com/single.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
get_template_part( 'single-blogpost' );

0 comments on commit b12072b

Please sign in to comment.