Finished copy button, Improved opengraph, Updated scripts

Update sidebar.php, composer.php, and 13 more files...
This commit is contained in:
2023-12-22 08:01:17 +01:00
parent c8c59c8271
commit fe72b3a62e
15 changed files with 78 additions and 31 deletions

View File

@@ -46,6 +46,9 @@ if($contentManager->hasError) {
// Remark: The 'glider' and 'highlight.js' stylesheets are included here.
include 'commons/DOM/head.php';
$content_head_image = $host_uri . "/resources/NibblePoker/images/logos/v2_opengraph.png";
$content_head_image_type = "image/png";
// Preparing values for the head's tags.
if ($contentManager->hasError) {
$content_head_title = localize("content.error.head.title");
@@ -63,6 +66,36 @@ if($contentManager->hasError) {
$content->get_head_title() .
localize("content.item.og.title.suffix");
$content_head_og_description = $content->get_head_description();
if(!is_null($content->metadata->opengraph->image)) {
$content_head_image = $host_uri . $content->metadata->opengraph->image;
}
if(!is_null($content->metadata->opengraph->image_type)) {
$content_head_image_type = $content->metadata->opengraph->image_type;
} else {
switch(pathinfo($content_head_image, PATHINFO_EXTENSION)) {
case "png":
$content_head_image_type = "image/png";
break;
case "jpg":
case "jpeg":
$content_head_image_type = "image/jpeg";
break;
case "gif":
$content_head_image_type = "image/gif";
break;
case "svg":
$content_head_image_type = "image/svg+xml";
break;
case "webp":
$content_head_image_type = "image/webp";
break;
case "apng":
$content_head_image_type = "image/apng";
break;
}
}
} elseif($contentManager->displayType == ContentDisplayType::SEARCH) {
$content_head_title = localize("content.search.head.title");
$content_head_description = localize("content.search.head.description");
@@ -77,8 +110,8 @@ if($contentManager->hasError) {
<meta property="og:title" content="<?php echo($content_head_og_title); ?>"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="<?php echo($host_uri . l10n_url_abs('/')); ?>"/>
<meta property="og:image" content="<?php echo($host_uri); ?>/resources/NibblePoker/images/logos/v2_opengraph.png"/>
<meta property="og:image:type" content="image/png"/>
<meta property="og:image" content="<?php echo($content_head_image); ?>"/>
<meta property="og:image:type" content="<?php echo($content_head_image_type); ?>"/>
<meta property="og:description" content="<?php echo($content_head_og_description); ?>"/>
</head>
<body>

View File

@@ -92,7 +92,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/circuitpython-ebyte-e32/main.png",
"image_type": null
},
"article": {

View File

@@ -44,7 +44,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/dotnet-arguments/main.png",
"image_type": null
},
"article": {

View File

@@ -42,7 +42,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/excel-password-remover/excel-password-remover.png",
"image_type": null
},
"article": {

View File

@@ -16,7 +16,7 @@
"improvements.title": "Improvements over PB-ListComPort",
"improvements.1": "Switched from PureBasic to .NET 6.0.",
"improvements.2": "Improved a lot of the program's logic.",
"improvements.3": "Added the <code>-h/--short-help</code>.",
"improvements.3": "Added the <code>-H/--short-help</code>.",
"improvements.4": "Added support for Windows ARM & ARM64.",
"improvements.5": "Support for running without a console.",
"usage.title": "Usage",
@@ -53,7 +53,7 @@
"improvements.title": "Améliorations",
"improvements.1": "Changement de PureBasic vers .NET 6.0.",
"improvements.2": "Amélioration de la logique interne du programme.",
"improvements.3": "Ajout de l'option <code>-h/--short-help</code>.",
"improvements.3": "Ajout de l'option <code>-H/--short-help</code>.",
"improvements.4": "Support pour Windows ARM et ARM64.",
"improvements.5": "Support pour le lancement sans invité de commande.",
"usage.title": "Utilisation",
@@ -85,7 +85,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/lscom/lscom-v2-text-01-bkgd-cli.png",
"image_type": null
},
"article": {

View File

@@ -36,7 +36,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/lscom/lscom-legacy-simple.png",
"image_type": null
},
"article": {

View File

@@ -62,7 +62,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/mc-expanded-iron-bundles/item-icon.png",
"image_type": null
},
"article": {

View File

@@ -66,7 +66,7 @@
"description": "meta.description",
"type": null,
"url": null,
"image": null,
"image": "/resources/NibblePoker/images/content/yaa/icon-final.png",
"image_type": null
},
"article": {