diff --git a/commons/composer.php b/commons/composer.php
index be51836..0388a8d 100644
--- a/commons/composer.php
+++ b/commons/composer.php
@@ -619,12 +619,25 @@ class ComposerElement {
// Defining the text's indent level.
$_paragraph_ident_level = is_null($this->indent) ? 0 : $this->indent;
+ // Calculating the vertical margin modifiers
+ $_paragraph_no_margin_top = ComposerElementModifiers::is_modifier_in_modifiers(
+ ComposerElementModifiers::GENERIC_MARGIN_NO_TOP, $this->modifiers);
+ $_paragraph_no_margin_bottom = ComposerElementModifiers::is_modifier_in_modifiers(
+ ComposerElementModifiers::GENERIC_MARGIN_NO_BOTTOM, $this->modifiers);
+
+ if($_paragraph_no_margin_top && $_paragraph_no_margin_bottom) {
+ $_paragraph_margin_modifier = 'my-0';
+ } else if($_paragraph_no_margin_top) {
+ $_paragraph_margin_modifier = 'mt-0 mb-10';
+ } else if($_paragraph_no_margin_bottom) {
+ $_paragraph_margin_modifier = 'mt-10 mb-0';
+ } else {
+ $_paragraph_margin_modifier = 'my-10';
+ }
+
// Composing the paragraph
- $htmlCode .= '
' .
- $this->get_inner_html($content_root) . '
';
+ $htmlCode .= '' . $this->get_inner_html($content_root) . '
';
break;
@@ -834,8 +847,10 @@ function get_content_file_path(string $content_id) : ?string {
}
function load_content_by_file_path(string $file_path) : ?ComposerContent {
- // FIXME: Add handling for JSON errors !
$content_json_data = json_decode(file_get_contents($file_path), true);
+ if(is_null($content_json_data)) {
+ return null;
+ }
return ComposerContent::from_json($content_json_data);
}
diff --git a/commons/sidebar.php b/commons/sidebar.php
index 4f724c8..cd164d5 100644
--- a/commons/sidebar.php
+++ b/commons/sidebar.php
@@ -32,10 +32,14 @@ if(!isset($SIDEBAR_ID)) {
-
+
View on GitHub",
+ "intro.title": "Introduction",
+ "feature.current.title": "Current features",
+ "feature.current.1": "Recipe for the vanilla bundle",
+ "feature.current.2": "Multiple variants with more storage space and special properties:",
+ "feature.current.3": "Copper Bundle (128 slots / 2 stacks)",
+ "feature.current.4": "Iron Bundle (256 slots / 4 stacks)",
+ "feature.current.5": "Gold Bundle (384 slots / 6 stacks)",
+ "feature.current.6": "Diamond Bundle (512 slots / 8 stacks)",
+ "feature.current.7": "Obsidian Bundle (768 slots / 12 stacks)",
+ "feature.current.8": "Ancient Scraps Bundle (896 slots / 14 stacks)",
+ "feature.current.9": "Netherite Bundle (1024 slots / 16 stacks & Immune to fire and lava)",
+ "feature.planned.title": "Planned features",
+ "feature.planned.1": "Versions for Forge and previous versions of Minecraft",
+ "feature.planned.2": "A config file to enable/disable specific bundles, change capacity",
+ "feature.planned.3": "Better visuals for the occupancy bar",
+ "feature.planned.4": "More bundles with special mechanics (i.e.: Ender Bundle, ...)",
+ "feature.planned.5": "More bundle upgrades",
+ "feature.planned.6": "Improved bundle mechanics (i.e.: Swapping last inserted item, ...)",
+ "feature.planned.7": "Support for modded ores and modded clones of existing ores",
+ "links.title": "Links"
+ },
+ "fr": {
+ "meta.title": "Minecraft - Expanded Iron Bundlest",
+ "meta.description": "Un petit mod pour Minecraft qui ajoute des sacs avec plus d'espace de stockage et de nouvelles fonctionalitées dans le futur.",
+ "article.subtitle": " Voir sur GitHub",
+ "intro.title": "Introduction",
+ "feature.current.title": "Fonctionnalités",
+ "feature.current.1": "Une recette pour le sac en cuir",
+ "feature.current.2": "Plusieurs variantes des sacs avec de nouvelles propriétés:",
+ "feature.current.3": "Sac en cuivre (128 slots / 2 stacks)",
+ "feature.current.4": "Sac en fer (256 slots / 4 stacks)",
+ "feature.current.5": "Sac en or (384 slots / 6 stacks)",
+ "feature.current.6": "Sac en diamant (512 slots / 8 stacks)",
+ "feature.current.7": "Sac en obsidienne (768 slots / 12 stacks)",
+ "feature.current.8": "Sac en fragments de Netherite (896 slots / 14 stacks)",
+ "feature.current.9": "Sac en Netherite (1024 slots / 16 stacks & Immune to fire and lava)",
+ "feature.planned.title": "Fonctionnalités planifiées",
+ "feature.planned.1": "Une version pour Forge et les anciennes versions du jeu",
+ "feature.planned.2": "Un fichier de configuration pour activer/désactiver des fonctionnalités et changer la taille des sacs",
+ "feature.planned.3": "Des meilleurs effets visuels pour la barre d'utilisation",
+ "feature.planned.4": "Des sacs avec des mécaniques spéciales (ex: Sac d'Ender, ...)",
+ "feature.planned.5": "Plus d'améliorations de sacs",
+ "feature.planned.6": "Mécaniques d'utilisations améliorées (ex: Changer l'objet qui sera sorti)",
+ "feature.planned.7": "Support pour les minerais issus d'autres mods",
+ "links.title": "Liens"
+ }
+ },
+ "metadata": {
+ "template": "article",
+ "head": {
+ "title": "meta.title",
+ "description": "meta.description"
+ },
+ "opengraph": {
+ "title": "meta.title",
+ "description": "meta.description",
+ "type": null,
+ "url": null,
+ "image": null,
+ "image_type": null
+ },
+ "article": {
+ "icon": "fad fa-cubes",
+ "title": "meta.title",
+ "subtitle": "article.subtitle",
+ "tags": ["game", "minecraft", "mod"]
+ }
+ },
+ "elements": [
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "intro.title"},
+ {"type": "paragraph", "indent": 2, "content": "meta.description"}
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "feature.current.title"},
+ {
+ "type": "paragraph",
+ "indent": 2,
+ "parts": [
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.current.1"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.current.2"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.3"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.4"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.5"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.6"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.7"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.8"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": " ⚬ ", "localize": false},
+ {"type": "raw", "content": "feature.current.9"}
+ ]
+ }
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "feature.planned.title"},
+ {
+ "type": "paragraph",
+ "indent": 2,
+ "parts": [
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.1"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.2"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.3"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.4"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.5"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.6"},
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {"type": "raw", "content": "feature.planned.7"}
+ ]
+ }
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "links.title"},
+ {
+ "type": "paragraph",
+ "indent": 2,
+ "modifiers": ["no-bottom-padding"],
+ "parts": [
+ {"type": "raw", "content": "● ", "localize": false},
+ {
+ "type": "raw",
+ "link": "https://github.com/aziascreations/MC-Expanded-Iron-Bundles",
+ "parts": [
+ {"type": "raw", "content": "content.commons.github"},
+ {"type": "raw", "content": " - ", "localize": false},
+ {
+ "type": "raw",
+ "content": "(https://github.com/aziascreations/MC-Expanded-Iron-Bundles)",
+ "localize": false
+ }
+ ]
+ },
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {
+ "type": "raw",
+ "link": "https://git.nibblepoker.lu/aziascreations/MC-Expanded-Iron-Bundles",
+ "parts": [
+ {"type": "raw", "content": "content.commons.gitea"},
+ {"type": "raw", "content": " - ", "localize": false},
+ {
+ "type": "raw",
+ "content": "(https://git.nibblepoker.lu/aziascreations/MC-Expanded-Iron-Bundles)",
+ "localize": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "indent": 2,
+ "modifiers": ["no-top-padding"],
+ "parts": [
+ {"type": "raw", "content": "● ", "localize": false},
+ {
+ "type": "raw", "link": "https://modrinth.com/mod/expanded-iron-bundles",
+ "parts": [
+ {"type": "raw", "content": "Modrinth [Fabric & Forge]", "localize": false},
+ {"type": "raw", "content": " - ", "localize": false},
+ {
+ "type": "raw",
+ "content": "(https://modrinth.com/mod/expanded-iron-bundles)",
+ "localize": false
+ }
+ ]
+ },
+
+ {"type": "raw", "content": "
", "localize": false},
+ {"type": "raw", "content": "● ", "localize": false},
+ {
+ "type": "raw", "link": "https://www.curseforge.com/minecraft/mc-mods/expanded-iron-bundles-fabric",
+ "parts": [
+ {"type": "raw", "content": "CurseForge [Fabric]", "localize": false},
+ {"type": "raw", "content": " - ", "localize": false},
+ {
+ "type": "raw",
+ "content": "(https://www.curseforge.com/minecraft/mc-mods/expanded-iron-bundles-fabric)",
+ "localize": false
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/content/items/youtube-auto-archiver.json b/content/items/youtube-auto-archiver.json
new file mode 100644
index 0000000..2f2cc53
--- /dev/null
+++ b/content/items/youtube-auto-archiver.json
@@ -0,0 +1,130 @@
+{
+ "strings": {
+ "en": {
+ "meta.title": "Youtube Auto Archiver",
+ "meta.description": "A simple and yet highly configurable Python application that automatically checks if a Youtuber is streaming, and downloads said streams while also archiving its latest uploads.",
+ "article.subtitle": " View on GitHub",
+
+ "intro.title": "Introduction",
+ "warning.title": "Warning",
+ "warning.p1": "Due to the way some commands are executed, it is possible to have a command injection vulnerability if you mess up or leave the config file editable by everyone.",
+ "warning.p2": "This might be fixed in the future, but don't count on it as this project is a personal one.",
+
+ "features.title": "Features",
+ "features.list.1.1": "● General",
+ "features.list.1.2": "⚬ Can run on Windows and Linux (Tested on x64 and ARMv8)",
+ "features.list.1.3": "⚬ Relatively high level of configurability.",
+ "features.list.2.1": "● YouTube",
+ "features.list.2.2": "⚬ Automatic livestream download through https://youtube.com/c/.../live",
+ "features.list.2.3": "⚬ Automatic livestream thumbnail and description download.",
+ "features.list.2.4": "⚬ Automatic download of uploads and their metadata.",
+ "features.list.2.5": "⚬ Configurable delays, actions, locations per channel.",
+ "features.list.3.1": "● Planned for v1.0.0",
+ "features.list.3.2": "⚬ Native support for cookies for yt-dlp and maybe streamlink.",
+ "features.list.3.3": "⚬ Better support to prevent command injection. (Will block some features if used)",
+ "features.list.4.1": "● Planned for later",
+ "features.list.4.2": "⚬ Using TOML for the config file when Python 3.11 is released and stable.",
+
+ "links.title": "Links"
+ },
+ "fr": {
+ "_meta.title": "",
+ "meta.description": "Une simple petite application hautement configurable qui vérifie automatiquement si un Youtubeur stream et as uploadé des vidéos afin de les archiver.",
+ "article.subtitle": " Voir sur GitHub",
+
+ "intro.title": "Introduction",
+ "warning.title": "Avertissements",
+ "warning.p1": "Due au fait que certaines commandes sont exécutées avec des paramètres arbitraires configurables cette application est vulnérable aux attaques par injection de commande si le fichier de configuration est modifiable par des personnes non autorisées.",
+ "warning.p2": "Ce problème sera probablement réglé dans le futur, mais il n'y a pas de date fixe comme ce projet est plus personnel qu'autre-chose.",
+
+ "features.title": "Fonctionnalités",
+ "features.list.1.1": "● General",
+ "features.list.1.2": "⚬ Can run on Windows and Linux (Tested on x64 and ARMv8)",
+ "features.list.1.3": "⚬ Relatively high level of configurability.",
+ "features.list.2.1": "● YouTube",
+ "features.list.2.2": "⚬ Automatic livestream download through https://youtube.com/c/.../live",
+ "features.list.2.3": "⚬ Automatic livestream thumbnail and description download.",
+ "features.list.2.4": "⚬ Automatic download of uploads and their metadata.",
+ "features.list.2.5": "⚬ Configurable delays, actions, locations per channel.",
+ "features.list.3.1": "● Planned for v1.0.0",
+ "features.list.3.2": "⚬ Native support for cookies for yt-dlp and maybe streamlink.",
+ "features.list.3.3": "⚬ Better support to prevent command injection. (Will block some features if used)",
+ "features.list.4.1": "● Planned for later",
+ "features.list.4.2": "⚬ Using TOML for the config file when Python 3.11 is released and stable.",
+
+ "links.title": "Liens"
+ }
+ },
+ "metadata": {
+ "template": "article",
+ "head": {
+ "title": "meta.title",
+ "description": "meta.description"
+ },
+ "opengraph": {
+ "title": "meta.title",
+ "description": "meta.description",
+ "type": null,
+ "url": null,
+ "image": null,
+ "image_type": null
+ },
+ "article": {
+ "icon": "fab fa-youtube",
+ "title": "meta.title",
+ "subtitle": "article.subtitle",
+ "tags": ["docker", "application", "web", "python"]
+ }
+ },
+ "elements": [
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "intro.title"},
+ {"type": "paragraph", "indent": 2, "content": "meta.description"}
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "warning.title"},
+ {"type": "paragraph", "indent": 2, "content": "warning.p1"},
+ {"type": "paragraph", "indent": 2, "content": "warning.p2"}
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "features.title"},
+ {"type": "paragraph", "indent": 2, "content": "features.list.1.1", "modifiers": ["no-bottom-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.1.2", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.1.3", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 2, "content": "features.list.2.1", "modifiers": ["no-bottom-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.2.2", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.2.3", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.2.4", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.2.5", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 2, "content": "features.list.3.1", "modifiers": ["no-bottom-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.3.2", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.3.3", "modifiers": ["no-bottom-margin", "no-top-margin"]},
+ {"type": "paragraph", "indent": 2, "content": "features.list.4.1", "modifiers": ["no-bottom-margin"]},
+ {"type": "paragraph", "indent": 4, "content": "features.list.4.2", "modifiers": ["no-top-margin"]}
+ ]
+ },
+
+ {
+ "type": "container", "padding": 20,
+ "modifiers": ["no-bottom-padding", "no-top-margin"],
+ "parts": [
+ {"type": "h1", "content": "warning.title"},
+ {"type": "paragraph", "indent": 2, "content": "warning.p1"},
+ {"type": "paragraph", "indent": 2, "content": "warning.p2"}
+ ]
+ }
+ ]
+}
diff --git a/index.php b/index.php
index 75ffd5a..9c4c704 100644
--- a/index.php
+++ b/index.php
@@ -21,7 +21,7 @@ include_once 'langs.php';