Compare commits

...

1 Commits

Author SHA1 Message Date
81f1819d3a
Add support for articles 2023-12-31 12:08:15 +01:00
4 changed files with 74 additions and 4 deletions

40
articles/index.php Normal file
View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<?php require "../inc/head.inc" ?>
</head>
<body>
<?php require "../inc/nav.inc" ?>
<div id="main-and-sidebar" dir="rtl" class="inline-block">
<div id="main-wrapper" class="inline-block">
<div id="main" class="inline-block">
<main>
<div class="section container">
<h1>Articles</h1>
This is a collection of articles written by me and my friends
</div>
<div class="section container">
<?php $articles = json_decode(file_get_contents("../data/articles.json")) ?>
<?php foreach ($articles as $i=>$article): ?>
<a class="reverse-link" href="/articles/<?= $article->slug ?>">
<h2 style="margin: 0"><?= $article->title ?></h2>
</a>
by <?= $article->author ?> &bull; <i>written <?= $article->created ?></i>
<?php if ($i != count($articles) - 1): ?><hr><?php endif ?>
<?php endforeach ?>
</div>
</main>
</div>
</div><!--
--><?php require "../inc/sidebar.inc" ?>
</div>
<?php require "../inc/background.inc" ?>
</body>
</html>

View File

@ -27,12 +27,15 @@ body {
-webkit-transition: all 0.2s linear, width 0s;
-moz-transition: all 0.2s linear, width 0s;
}
a {
outline: none;
}
a:hover {
text-decoration: none;
}
a.reverse-link {
text-decoration: none;
}
a.reverse-link:hover {
text-decoration: underline;
}
.loading, .loading * {
cursor: wait !important;
}
@ -265,3 +268,14 @@ object {
img {
border: none; /* Fix ico images on internet explorer */
}
@media print {
#grass, .light.tree, .dark.tree {
display: none !important;
}
.container {
background-color: red !important;
}
}

15
data/articles.json Normal file
View File

@ -0,0 +1,15 @@
[
{
"author": "Reimar",
"title": "Test",
"slug": "test",
"created": "2022-08-15"
},
{
"author": "Reimar",
"title": "Test",
"slug": "test",
"created": "2022-08-15"
}
]

View File

@ -4,7 +4,8 @@
$links = [
["/", "Home"],
["/about", "About"]
["/articles", "Articles"],
["/about", "About"],
];
$path = parse_url("http://test" . $_SERVER["REQUEST_URI"])["path"];