]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5843 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Mar 2023 13:09:20 +0000 (15:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Mar 2023 13:09:20 +0000 (15:09 +0200)
app/Fluidbook/SEO/Page.php
app/Jobs/FluidbookCompiler.php

index fa679e6530ad0cef610a300ab4f7ccfa5a775abb..1a5d1e0840d3350f38ff1ec3f18b0d0fd0ef5c43 100644 (file)
@@ -47,6 +47,12 @@ class Page
             $this->prev = $this->_container->pages[$this->page - 1]->getURL();
         }
 
+        if ($this->robots === true) {
+            $this->robots = 'index, follow';
+        } else if ($this->robots === false) {
+            $this->robots = 'noindex, nofollow';
+        }
+
         $vars = ['description' => $this->description ? '<meta name="description" content="' . $this->description . '">' : '',
             'keywords' => $this->keywords ? '<meta name="keywords" content="' . $this->keywords . '">' : '',
             'titre' => $this->title,
@@ -96,7 +102,7 @@ class Page
             $res = 'p/' . $url;
         }
 
-        if($this->_container->compiler->fluidbookSettings->seoBaseURL == '') {
+        if ($this->_container->compiler->fluidbookSettings->seoBaseURL == '') {
             $res = $url;
         } else {
             $res = str_replace($this->_container->compiler->fluidbookSettings->seoBaseURL, '', $url);
index 512bf968b30d4195c6c6e49d4aa56888869b5132..1399ea484efbae8485d24585e98600c83fdaae57 100644 (file)
@@ -7,6 +7,7 @@ use App\Fluidbook\Link\Link;
 use App\Fluidbook\PDF;
 use App\Fluidbook\SearchIndex;
 use App\Fluidbook\SEO\Document;
+use App\Fluidbook\SEO\Page;
 use App\Http\Controllers\Admin\Operations\FluidbookPublication\Services\SocialImageOperation;
 use App\Http\Controllers\Admin\Operations\Tools\Favicon;
 use App\Models\FluidbookPublication;
@@ -1225,7 +1226,7 @@ class FluidbookCompiler extends Base implements CompilerInterface
             $this->vdir->copyDirectory($from, $directory);
         }
 
-        if ($this->fluidbookSettings->scorm_enable) {
+        if ($this->fluidbookSettings->scorm_enable || $this->fluidbookSettings->secureClientSidePassword) {
             $this->fluidbookSettings->seoVersion = false;
         }
         if ($this->fluidbookSettings->embedAllLibraries) {
@@ -1624,7 +1625,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         if (!isset($this->seo->pages[$page])) {
             return;
         }
+        /** @var Page $seo */
         $seo = $this->seo->pages[$page];
+        if (!$this->fluidbookSettings->seoVersion) {
+            $seo->robots = false;
+        }
         $html = $seo->getHTML();
 
         if ($this->fluidbookSettings->seoVersion) {