Parcourir la source

Merge branch 'main' of https://github.com/pftnhr/yellow

Robert Pfotenhauer il y a 1 an
Parent
commit
079e560913

+ 20 - 12
system/extensions/edit.php

@@ -2,7 +2,7 @@
 // Edit extension, https://github.com/annaesvensson/yellow-edit
 
 class YellowEdit {
-    const VERSION = "0.8.76";
+    const VERSION = "0.8.77";
     public $yellow;         // access to API
     public $response;       // web response
     public $merge;          // text merge
@@ -1411,13 +1411,13 @@ class YellowEditResponse {
     public function getPageNewLocation($rawData, $pageLocation, $editNewLocation, $pageMatchLocation = false) {
         $location = is_string_empty($editNewLocation) ? "@title" : $editNewLocation;
         $location = preg_replace("/@title/i", $this->getPageNewTitle($rawData), $location);
-        $location = preg_replace("/@timestamp/i", $this->getPageNewData($rawData, "published", true, "U"), $location);
-        $location = preg_replace("/@date/i", $this->getPageNewData($rawData, "published", true, "Y-m-d"), $location);
-        $location = preg_replace("/@year/i", $this->getPageNewData($rawData, "published", true, "Y"), $location);
-        $location = preg_replace("/@month/i", $this->getPageNewData($rawData, "published", true, "m"), $location);
-        $location = preg_replace("/@day/i", $this->getPageNewData($rawData, "published", true, "d"), $location);
-        $location = preg_replace("/@tag/i", $this->getPageNewData($rawData, "tag", true), $location);
-        $location = preg_replace("/@author/i", $this->getPageNewData($rawData, "author", true), $location);
+        $location = preg_replace("/@timestamp/i", $this->getPageNewData($rawData, "published", "U"), $location);
+        $location = preg_replace("/@date/i", $this->getPageNewData($rawData, "published", "Y-m-d"), $location);
+        $location = preg_replace("/@year/i", $this->getPageNewData($rawData, "published", "Y"), $location);
+        $location = preg_replace("/@month/i", $this->getPageNewData($rawData, "published", "m"), $location);
+        $location = preg_replace("/@day/i", $this->getPageNewData($rawData, "published", "d"), $location);
+        $location = preg_replace("/@tag/i", $this->getPageNewData($rawData, "tag"), $location);
+        $location = preg_replace("/@author/i", $this->getPageNewData($rawData, "author"), $location);
         if (!preg_match("/^\//", $location)) {
             if ($this->yellow->lookup->isFileLocation($pageLocation) || !$pageMatchLocation) {
                 $location = $this->yellow->lookup->getDirectoryLocation($pageLocation).$location;
@@ -1425,6 +1425,14 @@ class YellowEditResponse {
                 $location = $this->yellow->lookup->getDirectoryLocation(rtrim($pageLocation, "/")).$location;
             }
         }
+        if (preg_match("/\d/", $location)) {
+            $locationNew = "";
+            $tokens = explode("/", $location);
+            for ($i=1; $i<count($tokens); ++$i) {
+                $locationNew .= "/".$this->yellow->lookup->normaliseToken($tokens[$i]);
+            }
+            $location = $locationNew;
+        }
         if ($pageMatchLocation) {
             $location = rtrim($location, "/").($this->yellow->lookup->isFileLocation($pageLocation) ? "" : "/");
         }
@@ -1436,17 +1444,17 @@ class YellowEditResponse {
         $title = $this->yellow->toolbox->getMetaData($rawData, "title");
         $titleSlug = $this->yellow->toolbox->getMetaData($rawData, "titleSlug");
         $value = is_string_empty($titleSlug) ? $title : $titleSlug;
-        $value = $this->yellow->lookup->normaliseName($value, true, false, true);
+        $value = $this->yellow->lookup->normaliseName($value, false, false, true);
         return trim(preg_replace("/-+/", "-", $value), "-");
     }
     
     // Return data for new/modified page
-    public function getPageNewData($rawData, $key, $filterFirst = false, $dateFormat = "") {
+    public function getPageNewData($rawData, $key, $dateFormat = "") {
         $value = $this->yellow->toolbox->getMetaData($rawData, $key);
-        if ($filterFirst && preg_match("/^(.*?)\,(.*)$/", $value, $matches)) $value = $matches[1];
+        if (preg_match("/^(.*?)\,(.*)$/", $value, $matches)) $value = $matches[1];
         if (!is_string_empty($dateFormat)) $value = date($dateFormat, strtotime($value));
         if (is_string_empty($value)) $value = "none";
-        $value = $this->yellow->lookup->normaliseName($value, true, false, true);
+        $value = $this->yellow->lookup->normaliseName($value, false, false, true);
         return trim(preg_replace("/-+/", "-", $value), "-");
     }
     

+ 2 - 2
system/extensions/update-current.ini

@@ -18,12 +18,12 @@ system/layouts/navigation.html: navigation.html, create, update, careful
 system/layouts/pagination.html: pagination.html, create, update, careful
 
 Extension: Edit
-Version: 0.8.76
+Version: 0.8.77
 Description: Edit your website in a web browser.
 DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/annaesvensson/yellow-edit
 DocumentationLanguage: en, de, sv
-Published: 2023-09-18 20:10:06
+Published: 2023-12-20 23:19:46
 Developer: Anna Svensson
 Tag: feature
 system/extensions/edit.php: edit.php, create, update

+ 15 - 4
system/extensions/update-latest.ini

@@ -184,12 +184,12 @@ Tag: language
 system/extensions/dutch.php: dutch.php, create, update
 
 Extension: Edit
-Version: 0.8.76
+Version: 0.8.77
 Description: Edit your website in a web browser.
 DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/annaesvensson/yellow-edit
 DocumentationLanguage: en, de, sv
-Published: 2023-09-18 20:10:06
+Published: 2023-12-20 23:19:46
 Developer: Anna Svensson
 Tag: feature
 system/extensions/edit.php: edit.php, create, update
@@ -564,9 +564,9 @@ Extension: Private
 Version: 0.8.13
 Tag: feature, page, private, security
 Description: Support for password-protected pages.
+DownloadUrl: https://github.com/schulle4u/yellow-private/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/schulle4u/yellow-private
 DocumentationLanguage: en, de
-DownloadUrl: https://github.com/schulle4u/yellow-private/archive/refs/heads/main.zip
 Published: 2023-05-22 14:35:25
 Developer: Steffen Schultz
 system/extensions/private.php: private.php, create, update
@@ -582,6 +582,17 @@ Developer: Anna Svensson
 Tag: feature
 system/extensions/publish.php: publish.php, create, update
 
+Extension: Readingtime
+Version: 0.8.22
+Description: Show estimated reading time for page content.
+DownloadUrl: https://github.com/schulle4u/yellow-readingtime/archive/refs/heads/main.zip
+DocumentationUrl: https://github.com/schulle4u/yellow-readingtime
+DocumentationLanguage: en, de
+Published: 2023-05-23 13:25:56
+Developer: Steffen Schultz
+Tag: feature, page, blog, readingtime
+system/extensions/readingtime.php: readingtime.php, create, update
+
 Extension: Russian
 Version: 0.8.43
 Description: Russian language.
@@ -752,9 +763,9 @@ content/2-wiki/wiki-example-page.md: wiki-example-page.md, create, optional
 Extension: Wittstock
 Version: 0.8.28
 Description: Wittstock is a classless theme.
+DownloadUrl: https://github.com/schulle4u/yellow-wittstock/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/schulle4u/yellow-wittstock
 DocumentationLanguage: en, de
-DownloadUrl: https://github.com/schulle4u/yellow-wittstock/archive/refs/heads/main.zip
 Published: 2023-10-27 13:55:23
 Designer: Steffen Schultz
 Tag: classless, theme