Files
web/articles.php
T

29 lines
781 B
PHP

<?php
require_once 'functions/init.php';
require_once 'functions/functions.php';
include_once 'components/head.php';
include_once 'functions/article_functions.php';
// TODO: Move to a grid, where the left hand column is either a search and filtering system, or...Table of Contents?
// Default view, it'll show articles by recency
if (!isset($_GET['article_id']) && !isset($_GET['tag'])) {
$ids = article_ids_by_recency();
foreach ($ids as $id) {
echo article_card($id);
}
} else if (isset($_GET['article_id'])) {
echo article_page_from_markdown($_GET['article_id']);
} else if (isset($_GET['tag'])) {
$ids = article_ids_by_tag($_GET['tag']);
foreach ($ids as $id) {
echo article_card($id);
}
}
include_once 'components/foot.php';