Permalink
Browse files

All Sites: Make meta description site specific

Fixes gh-261
Closes gh-387
  • Loading branch information...
1 parent fbfda9c commit f9ac57776fa8f3b86d1beed21a2cb7b24941a5c0 @sigorilla sigorilla committed with scottgonzalez Jan 25, 2016
Showing with 20 additions and 1 deletion.
  1. +3 −0 sites.php
  2. +16 −0 themes/jquery/functions.jquery.php
  3. +1 −1 themes/jquery/header.php
View
@@ -12,6 +12,7 @@ function jquery_sites() {
'body_class' => 'jquery',
'options' => array(
'blogname' => 'jQuery',
+ 'description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'stylesheet' => 'jquery.com',
'active_plugins' => array(
'jquery-static-index.php',
@@ -66,6 +67,7 @@ function jquery_sites() {
'body_class' => 'jquery-ui',
'options' => array(
'blogname' => 'jQuery UI',
+ '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.',
'stylesheet' => 'jqueryui.com',
'active_plugins' => array(
'jquery-static-index.php',
@@ -133,6 +135,7 @@ function jquery_sites() {
'body_class' => 'qunitjs',
'options' => array(
'blogname' => 'QUnit',
+ 'description' => 'QUnit: A JavaScript Unit Testing framework.',
'stylesheet' => 'qunitjs.com',
'active_plugins' => array(
'jquery-static-index.php',
@@ -177,3 +177,19 @@ function jq_logo_link() {
return empty( $sites[ JQUERY_LIVE_SITE ][ 'logo_link' ] ) ? '/' :
$sites[ JQUERY_LIVE_SITE ][ 'logo_link' ];
}
+
+/**
+ * Meta description about current site
+ * Setup descriptions in 'sites.php'
+ *
+ * @return [String] description
+ */
+function jq_meta_description() {
+ if ( !function_exists( 'jquery_sites' ) ) {
+ return '';
+ }
+
+ $sites = jquery_sites();
+ return empty( $sites[ JQUERY_LIVE_SITE ][ 'options' ][ 'description' ] ) ? '' :
+ $sites[ JQUERY_LIVE_SITE ][ 'options' ][ 'description' ];
+}
@@ -17,7 +17,7 @@
?></title>
<meta name="author" content="jQuery Foundation - jquery.org">
- <meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">
+ <meta name="description" content="<?php echo jq_meta_description(); ?>">
<meta name="viewport" content="width=device-width">

0 comments on commit f9ac577

Please sign in to comment.