Fixed description abstract (thanks to @mthu on #10)

This commit is contained in:
Giuseppe Di Terlizzi 2018-08-15 22:46:07 +02:00
parent 3d4d0233fd
commit 04e4a54701
2 changed files with 7 additions and 7 deletions

View file

@ -21,12 +21,12 @@ class helper_plugin_semantic extends DokuWiki_Plugin {
$json_ld = array( $json_ld = array(
'@context' => 'http://schema.org', '@context' => 'http://schema.org',
'@type' => 'WebSite', '@type' => 'WebSite',
'url' => DOKU_URL, 'url' => DOKU_URL,
'name' => $conf['title'], 'name' => $conf['title'],
'potentialAction' => array( 'potentialAction' => array(
'@type' => 'SearchAction', '@type' => 'SearchAction',
'target' => DOKU_URL.DOKU_SCRIPT.'?do=search&id={search_term_string}', 'target' => DOKU_URL.DOKU_SCRIPT.'?do=search&id={search_term_string}',
'query-input' => 'required name=search_term_string' 'query-input' => 'required name=search_term_string'
) )
); );
@ -80,7 +80,7 @@ class helper_plugin_semantic extends DokuWiki_Plugin {
} }
public function getDescription() { public function getDescription() {
return trim(ltrim(@$this->meta['description']['abstract'], $this->getTitle())); return (@$this->meta['description']['abstract'] ? $this->meta['description']['abstract']: $this->getTitle());
} }
public function getAuthor() { public function getAuthor() {

View file

@ -1,7 +1,7 @@
base semantic base semantic
author Giuseppe Di Terlizzi author Giuseppe Di Terlizzi
email giuseppe.diterlizzi@gmail.com email giuseppe.diterlizzi@gmail.com
date 2018-07-17 date 2018-08-15
name Semantic Plugin name Semantic Plugin
desc Add Semantic Data in DokuWiki desc Add Semantic Data in DokuWiki
url http://www.dokuwiki.org/plugin:semantic url http://www.dokuwiki.org/plugin:semantic