aboutsummaryrefslogtreecommitdiff
path: root/includes/blog
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-08 12:04:30 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-08 12:04:30 +0200
commit95112b1eb06a4be531ded59563d53a63a8d614e8 (patch)
treefd3dc676227309c87a39feab9ca458985e327907 /includes/blog
parent87303b0d3540037fb94efdde24dbaacb2880d6cb (diff)
downloadmain-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.gz
main-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.bz2
main-95112b1eb06a4be531ded59563d53a63a8d614e8.zip
Opening!
Diffstat (limited to 'includes/blog')
-rw-r--r--includes/blog/data/2020-05-01@something.json3
-rw-r--r--includes/blog/data/2020-05-01@something.json.html1
-rw-r--r--includes/blog/data/2020-05-02@something2.json3
-rw-r--r--includes/blog/data/2020-05-02@something2.json.html1
-rw-r--r--includes/blog/data/2020-05-03@something3.json3
-rw-r--r--includes/blog/data/2020-05-03@something3.json.html1
-rw-r--r--includes/blog/data/2020-05-04@something4.json4
-rw-r--r--includes/blog/data/2020-05-04@something4.json.fr.html1
-rw-r--r--includes/blog/data/2020-05-04@something4.json.html1
-rw-r--r--includes/blog/home.php59
-rw-r--r--includes/blog/list.php28
11 files changed, 45 insertions, 60 deletions
diff --git a/includes/blog/data/2020-05-01@something.json b/includes/blog/data/2020-05-01@something.json
deleted file mode 100644
index 51021ea..0000000
--- a/includes/blog/data/2020-05-01@something.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "title": "Some article"
-} \ No newline at end of file
diff --git a/includes/blog/data/2020-05-01@something.json.html b/includes/blog/data/2020-05-01@something.json.html
deleted file mode 100644
index 12ed35a..0000000
--- a/includes/blog/data/2020-05-01@something.json.html
+++ /dev/null
@@ -1 +0,0 @@
-<b>This is some <i>test</i></b><u> or, <i>is it?</i></u>... We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. \ No newline at end of file
diff --git a/includes/blog/data/2020-05-02@something2.json b/includes/blog/data/2020-05-02@something2.json
deleted file mode 100644
index 51021ea..0000000
--- a/includes/blog/data/2020-05-02@something2.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "title": "Some article"
-} \ No newline at end of file
diff --git a/includes/blog/data/2020-05-02@something2.json.html b/includes/blog/data/2020-05-02@something2.json.html
deleted file mode 100644
index 12ed35a..0000000
--- a/includes/blog/data/2020-05-02@something2.json.html
+++ /dev/null
@@ -1 +0,0 @@
-<b>This is some <i>test</i></b><u> or, <i>is it?</i></u>... We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. \ No newline at end of file
diff --git a/includes/blog/data/2020-05-03@something3.json b/includes/blog/data/2020-05-03@something3.json
deleted file mode 100644
index 51021ea..0000000
--- a/includes/blog/data/2020-05-03@something3.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "title": "Some article"
-} \ No newline at end of file
diff --git a/includes/blog/data/2020-05-03@something3.json.html b/includes/blog/data/2020-05-03@something3.json.html
deleted file mode 100644
index 12ed35a..0000000
--- a/includes/blog/data/2020-05-03@something3.json.html
+++ /dev/null
@@ -1 +0,0 @@
-<b>This is some <i>test</i></b><u> or, <i>is it?</i></u>... We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. \ No newline at end of file
diff --git a/includes/blog/data/2020-05-04@something4.json b/includes/blog/data/2020-05-04@something4.json
deleted file mode 100644
index c8376de..0000000
--- a/includes/blog/data/2020-05-04@something4.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "title": "Some article",
- "title.fr": "Un article"
-} \ No newline at end of file
diff --git a/includes/blog/data/2020-05-04@something4.json.fr.html b/includes/blog/data/2020-05-04@something4.json.fr.html
deleted file mode 100644
index 8bb1663..0000000
--- a/includes/blog/data/2020-05-04@something4.json.fr.html
+++ /dev/null
@@ -1 +0,0 @@
-<b>Il s'agit d'un <i>test</i></b><u> ou, <i>en est-il un ?</i></u>... Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. Nous ne saurons jamais si il devait vraiment y avoir du texte ou quelque chose d'autre ici. \ No newline at end of file
diff --git a/includes/blog/data/2020-05-04@something4.json.html b/includes/blog/data/2020-05-04@something4.json.html
deleted file mode 100644
index 12ed35a..0000000
--- a/includes/blog/data/2020-05-04@something4.json.html
+++ /dev/null
@@ -1 +0,0 @@
-<b>This is some <i>test</i></b><u> or, <i>is it?</i></u>... We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. We would never know if there really should be any text or whatever thingy just in that place right here. \ No newline at end of file
diff --git a/includes/blog/home.php b/includes/blog/home.php
index 49817e8..287ff64 100644
--- a/includes/blog/home.php
+++ b/includes/blog/home.php
@@ -1,29 +1,32 @@
-<div class="card-group">
- <?php
-
- $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data");
- $i = 1;
- $articles = array_reverse($articles);
- foreach ($articles as $article):
-
- ?>
- <?php if ($i <= 3 && strpos($article, "@") !== false && strpos($article, ".html") === false): ?>
- <?php
- $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true);
- if (l("a", "b") === "b" && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.html")) {
- $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.html");
- } else {
- $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".html");
- }
- ?>
- <div class="card">
- <div class="card-body">
- <h5 class="card-title"><?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></h5>
- <p class="card-text"><?= strlen(strip_tags($data["html"])) > 150 ? substr(strip_tags($data["html"]), 0, 150) . "..." : strip_tags($data["html"]) ?></p>
- <p class="card-text"><small class="text-muted"><?= l("Published", "Publié") ?> <?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></small></p>
- <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="card-link"><?= l("Read more...", "Lire plus...") ?></a>
- </div>
- </div>
- <?php $i++;endif; ?>
- <?php endforeach; ?>
+<div class="card-group">
+ <?php
+
+ $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data");
+ $i = 1;
+ $articles = array_reverse($articles);
+ foreach ($articles as $article):
+
+ ?>
+ <?php if ($i <= 3 && strpos($article, "@") !== false && strpos($article, ".html") === false && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . substr($article, 0, -5) . ".json.md")): ?>
+ <?php
+ $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true);
+ if (l("a", "b") === "b" && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.html")) {
+ $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".fr.md");
+ } else {
+ $data['html'] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article . ".md");
+ }
+
+ /** @var mixed $Parsedown */
+ $data['html'] = $Parsedown->text($data['html']);
+ ?>
+ <div class="card">
+ <div class="card-body">
+ <h5 class="card-title"><?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></h5>
+ <p class="card-text"><?= strlen(strip_tags($data["html"])) > 150 ? substr(strip_tags($data["html"]), 0, 150) . "..." : strip_tags($data["html"]) ?></p>
+ <p class="card-text"><small class="text-muted"><?= l("Published", "Publié") ?> <?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></small></p>
+ <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="card-link"><?= l("Read more...", "Lire plus...") ?></a>
+ </div>
+ </div>
+ <?php $i++;endif; ?>
+ <?php endforeach; ?>
</div> \ No newline at end of file
diff --git a/includes/blog/list.php b/includes/blog/list.php
index 1c81630..4777027 100644
--- a/includes/blog/list.php
+++ b/includes/blog/list.php
@@ -1,15 +1,15 @@
-<div class="list-group">
- <?php
-
- $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data");
- $i = 1;
- $articles = array_reverse($articles);
- foreach ($articles as $article):
-
- ?>
- <?php if (strpos($article, "@") !== false && strpos($article, ".html") === false): ?>
- <?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true); ?>
- <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></span> · <?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></a>
- <?php endif;$i++; ?>
- <?php endforeach; ?>
+<div class="list-group">
+ <?php
+
+ $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data");
+ $i = 1;
+ $articles = array_reverse($articles);
+ foreach ($articles as $article):
+
+ ?>
+ <?php if (strpos($article, "@") !== false && strpos($article, ".html") === false && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . substr($article, 0, -5) . ".json.md")): ?>
+ <?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true); ?>
+ <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></span> · <?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></a>
+ <?php endif;$i++; ?>
+ <?php endforeach; ?>
</div> \ No newline at end of file