Updated static site generator, replaced status setting with build options
This commit is contained in:
parent
2854628258
commit
04e4ee59d9
4 changed files with 14 additions and 13 deletions
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
// Bundle extension, https://github.com/datenstrom/yellow-extensions/tree/master/features/bundle
|
||||
// Copyright (c) 2013-2019 Datenstrom, https://datenstrom.se
|
||||
// Copyright (c) 2013-2020 Datenstrom, https://datenstrom.se
|
||||
// This file may be used and distributed under the terms of the public license.
|
||||
|
||||
class YellowBundle {
|
||||
const VERSION = "0.8.7";
|
||||
const VERSION = "0.8.8";
|
||||
const TYPE = "feature";
|
||||
public $yellow; //access to API
|
||||
|
||||
|
@ -84,7 +84,7 @@ class YellowBundle {
|
|||
$base = $this->yellow->system->get("coreServerBase");
|
||||
foreach ($data as $key=>$value) {
|
||||
if (preg_match("/^\w+:/", $key)) continue;
|
||||
if (preg_match("/data-bundle=\"none\"/i", $value)) continue;
|
||||
if (preg_match("/data-bundle=\"exclude\"/i", $value)) continue;
|
||||
if (substru($key, 0, strlenu($base))!=$base) continue;
|
||||
$location = substru($key, strlenu($base));
|
||||
$fileName = $this->yellow->lookup->findFileFromSystem($location);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
// Command extension, https://github.com/datenstrom/yellow-extensions/tree/master/features/command
|
||||
// Copyright (c) 2013-2019 Datenstrom, https://datenstrom.se
|
||||
// Copyright (c) 2013-2020 Datenstrom, https://datenstrom.se
|
||||
// This file may be used and distributed under the terms of the public license.
|
||||
|
||||
class YellowCommand {
|
||||
const VERSION = "0.8.10";
|
||||
const VERSION = "0.8.11";
|
||||
const TYPE = "feature";
|
||||
const PRIORITY = "3";
|
||||
public $yellow; //access to API
|
||||
|
@ -579,9 +579,9 @@ class YellowCommand {
|
|||
list($scheme, $address, $base) = $this->yellow->lookup->getUrlInformation($staticUrl);
|
||||
$this->yellow->page->setRequestInformation($scheme, $address, $base, "", "");
|
||||
foreach ($this->yellow->content->index(true, true) as $page) {
|
||||
if (($page->get("status")!="ignore" && $page->get("status")!="draft") || $includeAll) {
|
||||
array_push($locations, $page->location);
|
||||
}
|
||||
if (preg_match("/exclude/i", $page->get("build")) && !$includeAll) continue;
|
||||
if ($page->get("status")=="private" || $page->get("status")=="draft") continue;
|
||||
array_push($locations, $page->location);
|
||||
}
|
||||
if (!$this->yellow->content->find("/") && $this->yellow->system->get("coreMultiLanguageMode")) array_unshift($locations, "/");
|
||||
return $locations;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// This file may be used and distributed under the terms of the public license.
|
||||
|
||||
class YellowEdit {
|
||||
const VERSION = "0.8.22";
|
||||
const VERSION = "0.8.23";
|
||||
const TYPE = "feature";
|
||||
public $yellow; //access to API
|
||||
public $response; //web response
|
||||
|
@ -73,8 +73,8 @@ class YellowEdit {
|
|||
$output = null;
|
||||
if ($name=="header" && $this->response->isActive()) {
|
||||
$extensionLocation = $this->yellow->system->get("coreServerBase").$this->yellow->system->get("coreExtensionLocation");
|
||||
$output = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" data-bundle=\"none\" href=\"{$extensionLocation}edit.css\" />\n";
|
||||
$output .= "<script type=\"text/javascript\" data-bundle=\"none\" src=\"{$extensionLocation}edit.js\"></script>\n";
|
||||
$output = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" data-bundle=\"exclude\" href=\"{$extensionLocation}edit.css\" />\n";
|
||||
$output .= "<script type=\"text/javascript\" data-bundle=\"exclude\" src=\"{$extensionLocation}edit.js\"></script>\n";
|
||||
$output .= "<script type=\"text/javascript\">\n";
|
||||
$output .= "// <![CDATA[\n";
|
||||
$output .= "yellow.page = ".json_encode($this->response->getPageData($page)).";\n";
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// This file may be used and distributed under the terms of the public license.
|
||||
|
||||
class YellowUpdate {
|
||||
const VERSION = "0.8.17";
|
||||
const VERSION = "0.8.18";
|
||||
const TYPE = "feature";
|
||||
const PRIORITY = "2";
|
||||
public $yellow; //access to API
|
||||
|
@ -83,10 +83,11 @@ class YellowUpdate {
|
|||
break;
|
||||
}
|
||||
}
|
||||
$fileDataNew = preg_replace("/Status: hidden/i", "Status: shared", $fileDataNew);
|
||||
$fileDataNew = preg_replace("/Status: ignore/i", "Build: exclude", $fileDataNew);
|
||||
if ($fileStatusUnlisted && empty($this->yellow->toolbox->getMetaData($fileDataNew, "status"))) {
|
||||
$fileDataNew = $this->yellow->toolbox->setMetaData($fileDataNew, "status", "unlisted");
|
||||
}
|
||||
$fileDataNew = preg_replace("/Status: hidden/i", "Status: shared", $fileDataNew);
|
||||
if ($fileData!=$fileDataNew) {
|
||||
$modified = $this->yellow->toolbox->getFileModified($entry);
|
||||
if (!$this->yellow->toolbox->deleteFile($entry) ||
|
||||
|
|
Loading…
Add table
Reference in a new issue