diff options
author | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-06-30 00:07:21 +0200 |
---|---|---|
committer | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-06-30 00:07:21 +0200 |
commit | 1f23d65f32e37d0c6d703951d6735c9926f8521c (patch) | |
tree | 57cd1399dd05a088b2a2fb3d6bdc5d0dc3a2961b /_site | |
parent | 5c5014a95ae79af4b052b5011e7d0c11d6eae6a6 (diff) | |
download | unchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.tar.gz unchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.tar.bz2 unchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.zip |
Really done this time
Diffstat (limited to '_site')
-rw-r--r-- | _site/about/index.php | 2 | ||||
-rw-r--r-- | _site/articles/index.php | 2 | ||||
-rw-r--r-- | _site/feed.xml/index.php | 43 | ||||
-rw-r--r-- | _site/home/index.php | 4 | ||||
-rw-r--r-- | _site/includes/articles/getlist.php | 10 | ||||
-rw-r--r-- | _site/includes/dom/footer.php | 3 | ||||
-rw-r--r-- | _site/includes/dom/header.php | 5 | ||||
-rw-r--r-- | _site/index.html | 39 | ||||
-rw-r--r-- | _site/index.php | 4 | ||||
-rw-r--r-- | _site/rewrites/article.php | 2 |
10 files changed, 66 insertions, 48 deletions
diff --git a/_site/about/index.php b/_site/about/index.php index 57afa94..c377abc 100644 --- a/_site/about/index.php +++ b/_site/about/index.php @@ -22,7 +22,7 @@ <h2>Who is behind this blog?</h2> <div class="list-group no-link"> - <li class="list-group-item"><img src="/authors/antoine62.jpg" width="32px" style="vertical-align: middle;"> <b>antoine62</b>g writer, correcter, UI/UX tester · Contact him on <a href="https://matrix.to/#/@antoine62:halogen.city" style="text-decoration: underline;">Matrix</a></li> + <li class="list-group-item"><img src="/authors/antoine62.jpg" width="32px" style="vertical-align: middle;"> <b>antoine62</b> writer, correcter, UI/UX tester · Contact him on <a href="https://matrix.to/#/@antoine62:halogen.city" style="text-decoration: underline;">Matrix</a></li> <li class="list-group-item"><img src="/authors/minteck.jpg" width="32px" style="vertical-align: middle;"> <b>Minteck</b> writer, developer, UI/UX designer · Contact him on <a href="https://matrix.to/#/@minteck:kde.org" style="text-decoration: underline;">Matrix</a> and <a href="https://twitter.com/_Minteck" style="text-decoration: underline;">Twitter</a></li> </div> </div> diff --git a/_site/articles/index.php b/_site/articles/index.php index b694a15..1ea7270 100644 --- a/_site/articles/index.php +++ b/_site/articles/index.php @@ -8,7 +8,7 @@ <div class="container"> <div class="list-group"> <?php $index = 0;foreach ($list as $id => $item): ?> - <a href="/article/<?= $id ?>" class="list-group-item list-group-item-action"><?= $item["title"] ?></a> + <a href="/article/<?= $item["id"] ?>" class="list-group-item list-group-item-action"><?= $item["title"] ?></a> <?php $index++;endforeach; ?> </div> </div> diff --git a/_site/feed.xml/index.php b/_site/feed.xml/index.php new file mode 100644 index 0000000..a1fa3df --- /dev/null +++ b/_site/feed.xml/index.php @@ -0,0 +1,43 @@ +<?php + +header("Content-Type: application/xml"); +echo('<?xml version="1.0" encoding="UTF-8" ?>'); + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/markdown.php"; +$Parsedown = new Parsedown(); + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/articles/getlist.php"; +$list = getArticlesList(); + +?> + +<rss version="2.0"> + + <!-- + + This is Blogchain's RSS feed! + Only the last 10 articles are shown to preserve your and my bandwidth. + + Blogchain is + (c) Blogchain Authors, All rights reserved. + + --> + + <channel> + <title>Blogchain</title> + <link>https://blogchain.minteck.ro.lt</link> + <description>Blogchain is a tech-centric blog written by two people on their free time</description> + <copyright><?= date('Y') ?> Blogchain Authors, All rights reserved.</copyright> + <language>en-us</language> + <?php $index = 0; foreach ($list as $item): ?> + <?php if ($index < 10): ?> + <item> + <title><?= $item["title"] ?></title> + <link>https://blogchain.minteck.ro.lt/article/<?= $item["id"] ?></link> + <description><?= $item["content"]["full"] ?></description> + </item> + <?php endif; ?> + <?php $index++; endforeach; ?> + </channel> + +</rss>
\ No newline at end of file diff --git a/_site/home/index.php b/_site/home/index.php index 2425013..62a076d 100644 --- a/_site/home/index.php +++ b/_site/home/index.php @@ -13,7 +13,7 @@ <div class="card-body"> <h2><?= $item["title"] ?></h2> <p><?= $item["content"]["mini"] ?></p> - <a class="btn btn-primary" href="/article/<?= $id ?>">Read more</a> + <a class="btn btn-primary" href="/article/<?= $item["id"] ?>">Read more</a> <span style="margin-top: 10px;display:block;"><small><?php $dt = DateTime::createFromFormat('Ymd', $item["date"]); @@ -31,7 +31,7 @@ <div class="list-group"> <?php $index = 0;foreach ($list as $id => $item): ?> <?php if ($index >= 3 && $index < 100): ?> - <a href="/article/<?= $id ?>" class="list-group-item list-group-item-action"><?= $item["title"] ?></a> + <a href="/article/<?= $item["id"] ?>" class="list-group-item list-group-item-action"><?= $item["title"] ?></a> <?php endif; ?> <?php $index++;endforeach; ?> </div> diff --git a/_site/includes/articles/getlist.php b/_site/includes/articles/getlist.php index e3947f2..e82a192 100644 --- a/_site/includes/articles/getlist.php +++ b/_site/includes/articles/getlist.php @@ -2,7 +2,7 @@ $listGetTimeout = 0; -function getArticlesList() { +function getArticlesList($ordered = true) { $listGetStart = new DateTime("now"); global $Parsedown; global $listGetTimeout; @@ -24,6 +24,7 @@ function getArticlesList() { "cover" => null, "extract" => "" ]; + $list[$id]["id"] = $id; $propertiesMode = false; $propertiesDone = false; @@ -91,5 +92,12 @@ function getArticlesList() { $listGetTimeoutA = $listGetStart->diff($listGetEnd); $listGetTimeout = $listGetTimeoutA->f; + if ($ordered) { + usort($list, function($a, $b) { + return strtoupper($a['date']) <=> strtoupper($b['date']); + }); + $list = array_reverse($list); + } + return $list; }
\ No newline at end of file diff --git a/_site/includes/dom/footer.php b/_site/includes/dom/footer.php index 4832ed2..1d0fb97 100644 --- a/_site/includes/dom/footer.php +++ b/_site/includes/dom/footer.php @@ -1,3 +1,5 @@ +<p style="margin-top:20px;text-align:center;"><a href="/feed.xml" style="text-decoration: underline;">View RSS feed</a></p> + <hr> <div class="container"> @@ -14,6 +16,7 @@ ?> </span></p> + <small><p style="text-align: center;">© <?= date('Y') ?> Blogchain Authors, All rights reserved. · <a href="https://minteck-projects.alwaysdata.net/legal" target="_blank" style="text-decoration: underline;">Legal</a></p></small> </div> </body> diff --git a/_site/includes/dom/header.php b/_site/includes/dom/header.php index 079adb5..db37bab 100644 --- a/_site/includes/dom/header.php +++ b/_site/includes/dom/header.php @@ -175,6 +175,7 @@ function customError($errno, $errstr, $errfile = "<unknown file>", $errlin <pre> #{$errno}: {$errstr} at {$errfile}:{$errline} + at Blogchain.\$Core (PHP " . PHP_VERSION . ") </pre> </div> </body> @@ -276,6 +277,7 @@ register_shutdown_function("customShutdown"); img { max-width: 100%; + max-height: 50vh; } .nav-link:hover, .nav-link:focus { @@ -313,9 +315,6 @@ register_shutdown_function("customShutdown"); <li class="nav-item"> <a class="nav-link" href="/about">About</a> </li> - <li class="nav-item"> - <a class="nav-link" href="https://minteck-projects.alwaysdata.net/legal">Legal</a> - </li> </ul> </nav>
\ No newline at end of file diff --git a/_site/index.html b/_site/index.html deleted file mode 100644 index 68e3551..0000000 --- a/_site/index.html +++ /dev/null @@ -1,39 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Blogchain</title> - <style> - - * { - font-family: sans-serif; - overflow: hidden; - } - - html, body { - background: #ddd; - height: 100%; - width: 100%; - } - - div { - display: flex; - text-align:center; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - } - - - </style> -</head> -<body> - <div> - <article> - <h1>No chain for you!</h1> - <p>We closed Blogchain while we tidy up things. It will be back soon!</p> - </article> - </div> -</body> -</html>
\ No newline at end of file diff --git a/_site/index.php b/_site/index.php new file mode 100644 index 0000000..96a374d --- /dev/null +++ b/_site/index.php @@ -0,0 +1,4 @@ +<?php + +header("Location: /home"); +die();
\ No newline at end of file diff --git a/_site/rewrites/article.php b/_site/rewrites/article.php index 613121b..69a3014 100644 --- a/_site/rewrites/article.php +++ b/_site/rewrites/article.php @@ -19,7 +19,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/markdown.php"; $Parsedown = new Parsedown(); require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/articles/getlist.php"; -$list = getArticlesList(); +$list = getArticlesList(false); $item = $list[$_GET['i']]; $_TITLE = $item["title"]; |