Removed meta from standard installation

This commit is contained in:
markseu 2023-07-01 11:06:26 +02:00
parent 8d6784495c
commit fcd2d4c292
5 changed files with 0 additions and 79 deletions

View file

@ -16,7 +16,6 @@ Die folgenden Erweiterungen sind in der Standardinstallation enthalten:
* [Image](https://github.com/annaesvensson/yellow-image/tree/main/README-de.md) - Bilder in unterschiedlichen Größen hinzufügen. Entwickelt von Anna Svensson.
* [Install](https://github.com/annaesvensson/yellow-install/tree/main/README-de.md) - Eine brandneue Webseite installieren. Entwickelt von Anna Svensson.
* [Markdown](https://github.com/annaesvensson/yellow-markdown/tree/main/README-de.md) - Textformatierung für Menschen. Entwickelt von Anna Svensson.
* [Meta](https://github.com/annaesvensson/yellow-meta/tree/main/README-de.md) - Metadaten für Menschen und Maschinen. Entwickelt von Anna Svensson.
* [Serve](https://github.com/annaesvensson/yellow-serve/tree/main/README-de.md) - Eingebauter Webserver. Entwickelt von Anna Svensson.
* [Stockholm](https://github.com/annaesvensson/yellow-stockholm/tree/main/README-de.md) - Stockholm ist ein schlichtes Theme. Entworfen von Anna Svensson.
* [Update](https://github.com/annaesvensson/yellow-update/tree/main/README-de.md) - Webseite auf dem neusten Stand halten. Entwickelt von Anna Svensson.

View file

@ -16,10 +16,8 @@ Följande tillägg ingår i standardinstallationen:
* [Image](https://github.com/annaesvensson/yellow-image/tree/main/README-sv.md) - Lägg til bilder och miniatyrbilder. Utvecklad av Anna Svensson.
* [Install](https://github.com/annaesvensson/yellow-install/tree/main/README-sv.md) - Installera en helt ny webbplats. Utvecklad av Anna Svensson.
* [Markdown](https://github.com/annaesvensson/yellow-markdown/tree/main/README-sv.md) - Textformatering för människor. Utvecklad av Anna Svensson.
* [Meta](https://github.com/annaesvensson/yellow-meta/tree/main/README-sv.md) - Metadata för människor och maskiner. Utvecklad av Anna Svensson.
* [Serve](https://github.com/annaesvensson/yellow-serve/tree/main/README-sv.md) - Inbyggd webbserver. Utvecklad av Anna Svensson.
* [Stockholm](https://github.com/annaesvensson/yellow-stockholm/tree/main/README-sv.md) - Stockholm är ett rent tema. Designad av Anna Svensson.
* [Update](https://github.com/annaesvensson/yellow-update/tree/main/README-sv.md) - Håll din webbplats uppdaterad. Utvecklad av Anna Svensson.
Har du några frågor? [Få hjälp](https://datenstrom.se/sv/yellow/help/).

View file

@ -16,7 +16,6 @@ The following extensions are included in the standard installation:
* [Image](https://github.com/annaesvensson/yellow-image) - Add images and thumbnails. Developed by Anna Svensson.
* [Install](https://github.com/annaesvensson/yellow-install) - Install a brand new website. Developed by Anna Svensson.
* [Markdown](https://github.com/annaesvensson/yellow-markdown) - Text formatting for humans. Developed by Anna Svensson.
* [Meta](https://github.com/annaesvensson/yellow-meta) - Meta data for humans and machines. Developed by Anna Svensson.
* [Serve](https://github.com/annaesvensson/yellow-serve) - Built-in web server. Developed by Anna Svensson.
* [Stockholm](https://github.com/annaesvensson/yellow-stockholm) - Stockholm is a clean theme. Designed by Anna Svensson.
* [Update](https://github.com/annaesvensson/yellow-update) - Keep your website up to date. Developed by Anna Svensson.

View file

@ -1,65 +0,0 @@
<?php
// Meta extension, https://github.com/annaesvensson/yellow-meta
class YellowMeta {
const VERSION = "0.8.17";
public $yellow; // access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
$this->yellow->system->setDefault("metaDefaultImage", "favicon");
}
// Handle page extra data
public function onParsePageExtra($page, $name) {
$output = null;
if ($name=="header" && !$page->isError()) {
list($imageUrl, $imageAlt) = $this->getImageInformation($page);
$locale = $this->yellow->language->getText("languageLocale", $page->get("language"));
$output .= "<meta property=\"og:url\" content=\"".htmlspecialchars($page->getUrl().$this->yellow->toolbox->getLocationArguments())."\" />\n";
$output .= "<meta property=\"og:locale\" content=\"".htmlspecialchars($locale)."\" />\n";
$output .= "<meta property=\"og:type\" content=\"website\" />\n";
$output .= "<meta property=\"og:title\" content=\"".$page->getHtml("title")."\" />\n";
$output .= "<meta property=\"og:site_name\" content=\"".$page->getHtml("sitename")."\" />\n";
$output .= "<meta property=\"og:description\" content=\"".$page->getHtml("description")."\" />\n";
$output .= "<meta property=\"og:image\" content=\"".htmlspecialchars($imageUrl)."\" />\n";
$output .= "<meta property=\"og:image:alt\" content=\"".htmlspecialchars($imageAlt)."\" />\n";
}
return $output;
}
// Handle page output data
public function onParsePageOutput($page, $text) {
$output = null;
if ($text && preg_match("/^(.*?)<html(.*?)>(.*)$/s", $text, $matches)) {
$output = $matches[1]."<html".$matches[2]." prefix=\"og: http://ogp.me/ns#\">".$matches[3];
}
return $output;
}
// Return image information for page
public function getImageInformation($page) {
if ($page->isExisting("image")) {
$name = $page->get("image");
$alt = $page->isExisting("imageAlt") ? $page->get("imageAlt") : $page->get("title");
} elseif (preg_match("/\[image(\s.*?)\]/", $page->getContentRaw(), $matches)) {
list($name, $alt) = $this->yellow->toolbox->getTextArguments(trim($matches[1]));
if (is_string_empty($alt)) $alt = $page->get("title");
} else {
$name = $this->yellow->system->get("metaDefaultImage");
$alt = $page->isExisting("imageAlt") ? $page->get("imageAlt") : $page->get("title");
}
if (!preg_match("/^\w+:/", $name)) {
$location = $name!="favicon" ? $this->yellow->system->get("coreImageLocation").$name :
$this->yellow->system->get("coreThemeLocation").$this->yellow->lookup->normaliseName($page->get("theme")).".png";
$url = $this->yellow->lookup->normaliseUrl(
$this->yellow->system->get("coreServerScheme"),
$this->yellow->system->get("coreServerAddress"),
$this->yellow->system->get("coreServerBase"), $location);
} else {
$url = $this->yellow->lookup->normaliseUrl("", "", "", $name);
}
return array($url, $alt);
}
}

View file

@ -85,16 +85,6 @@ Developer: Anna Svensson
Tag: feature
system/extensions/markdown.php: markdown.php, create, update
Extension: Meta
Version: 0.8.17
Description: Meta data for humans and machines.
DocumentationUrl: https://github.com/annaesvensson/yellow-meta
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/meta.zip
Published: 2023-05-19 00:58:40
Developer: Anna Svensson
Tag: feature
system/extensions/meta.php: meta.php, create, update
Extension: Serve
Version: 0.8.24
Description: Built-in web server.