Skip to content

Commit f9ac577

Browse files
sigorillascottgonzalez
authored andcommitted
All Sites: Make meta description site specific
Fixes gh-261 Closes gh-387
1 parent fbfda9c commit f9ac577

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

sites.php

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function jquery_sites() {
1212
'body_class' => 'jquery',
1313
'options' => array(
1414
'blogname' => 'jQuery',
15+
'description' => 'jQuery: The Write Less, Do More, JavaScript Library',
1516
'stylesheet' => 'jquery.com',
1617
'active_plugins' => array(
1718
'jquery-static-index.php',
@@ -66,6 +67,7 @@ function jquery_sites() {
6667
'body_class' => 'jquery-ui',
6768
'options' => array(
6869
'blogname' => 'jQuery UI',
70+
'description' => 'jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you\'re building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.',
6971
'stylesheet' => 'jqueryui.com',
7072
'active_plugins' => array(
7173
'jquery-static-index.php',
@@ -133,6 +135,7 @@ function jquery_sites() {
133135
'body_class' => 'qunitjs',
134136
'options' => array(
135137
'blogname' => 'QUnit',
138+
'description' => 'QUnit: A JavaScript Unit Testing framework.',
136139
'stylesheet' => 'qunitjs.com',
137140
'active_plugins' => array(
138141
'jquery-static-index.php',

themes/jquery/functions.jquery.php

+16
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,19 @@ function jq_logo_link() {
177177
return empty( $sites[ JQUERY_LIVE_SITE ][ 'logo_link' ] ) ? '/' :
178178
$sites[ JQUERY_LIVE_SITE ][ 'logo_link' ];
179179
}
180+
181+
/**
182+
* Meta description about current site
183+
* Setup descriptions in 'sites.php'
184+
*
185+
* @return [String] description
186+
*/
187+
function jq_meta_description() {
188+
if ( !function_exists( 'jquery_sites' ) ) {
189+
return '';
190+
}
191+
192+
$sites = jquery_sites();
193+
return empty( $sites[ JQUERY_LIVE_SITE ][ 'options' ][ 'description' ] ) ? '' :
194+
$sites[ JQUERY_LIVE_SITE ][ 'options' ][ 'description' ];
195+
}

themes/jquery/header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
?></title>
1818

1919
<meta name="author" content="jQuery Foundation - jquery.org">
20-
<meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">
20+
<meta name="description" content="<?php echo jq_meta_description(); ?>">
2121

2222
<meta name="viewport" content="width=device-width">
2323

0 commit comments

Comments
 (0)