From 04e4a5470131dcbbb469fd72b98a042104cc6aff Mon Sep 17 00:00:00 2001 From: Giuseppe Di Terlizzi Date: Wed, 15 Aug 2018 22:46:07 +0200 Subject: [PATCH] Fixed description abstract (thanks to @mthu on #10) --- helper.php | 12 ++++++------ plugin.info.txt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helper.php b/helper.php index 5a569e9..7950d3b 100644 --- a/helper.php +++ b/helper.php @@ -21,12 +21,12 @@ class helper_plugin_semantic extends DokuWiki_Plugin { $json_ld = array( '@context' => 'http://schema.org', - '@type' => 'WebSite', - 'url' => DOKU_URL, - 'name' => $conf['title'], + '@type' => 'WebSite', + 'url' => DOKU_URL, + 'name' => $conf['title'], 'potentialAction' => array( - '@type' => 'SearchAction', - 'target' => DOKU_URL.DOKU_SCRIPT.'?do=search&id={search_term_string}', + '@type' => 'SearchAction', + 'target' => DOKU_URL.DOKU_SCRIPT.'?do=search&id={search_term_string}', 'query-input' => 'required name=search_term_string' ) ); @@ -80,7 +80,7 @@ class helper_plugin_semantic extends DokuWiki_Plugin { } 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() { diff --git a/plugin.info.txt b/plugin.info.txt index 54dc055..4af6a18 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base semantic author Giuseppe Di Terlizzi email giuseppe.diterlizzi@gmail.com -date 2018-07-17 +date 2018-08-15 name Semantic Plugin desc Add Semantic Data in DokuWiki url http://www.dokuwiki.org/plugin:semantic