rf: move everything to templates, add config for blog details

This commit is contained in:
Aidan 2025-04-26 17:10:29 -04:00
parent 633d3ef634
commit 52a8699363
7 changed files with 77 additions and 59 deletions

5
config/blog-details.php Normal file
View File

@ -0,0 +1,5 @@
<?php
$blog_details = [
'title' => 'Blog Title',
];
?>

View File

@ -0,0 +1,8 @@
<div class="w-full border-b border-black bg-gray-100 p-4">
<h1 class="text-3xl font-bold mb-1"><?php echo $blog_details['title']; ?></h1>
<div class="flex gap-2">
<a href="/login" class="text-blue-500 underline text-sm">posts</a>
<a href="/register" class="text-blue-500 underline text-sm">categories</a>
<a href="/register" class="text-blue-500 underline text-sm">webmaster</a>
</div>
</div>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TinyTalk</title>
<!-- Font -->
<link rel="stylesheet" href="/assets/css/font.css">
<!-- Tailwind CSS -->
<link rel="stylesheet" href="/assets/css/tw.css">
</head>
<body>

View File

@ -0,0 +1,9 @@
<div class="mb-3">
<h1 class="text-3xl font-bold">this is an example post</h1>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
</div>
<div class="flex flex-col mt-2 gap-4">
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
</div>

View File

@ -1,66 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TinyTalk</title>
<!-- Font -->
<link rel="stylesheet" href="/assets/css/font.css">
<!-- Tailwind CSS -->
<link rel="stylesheet" href="/assets/css/tw.css">
</head>
<div class="w-full border-b border-black bg-gray-100 p-4">
<h1 class="text-3xl font-bold mb-1">blog</h1>
<div class="flex gap-2">
<a href="/login" class="text-blue-500 underline text-sm">posts</a>
<a href="/register" class="text-blue-500 underline text-sm">categories</a>
<a href="/register" class="text-blue-500 underline text-sm">webmaster</a>
</div>
</div>
<?php
include_once __DIR__ . '/../config/blog-details.php';
include_once __DIR__ . '/../templates/elements/html-header.php';
include_once __DIR__ . '/../templates/elements/header.php';
?>
<div class="w-full flex">
<div class="w-1/5 border-r border-b border-black bg-gray-100">
<div id="recent-posts">
<div class="w-full border-b border-black py-0.5 px-4">
<h1 class="font-bold">recent posts</h1>
</div>
<div class="w-full px-4 mt-1 mb-4 flex flex-col gap-0.5">
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
</div>
</div>
<div id="categories">
<div class="w-full border-b border-t border-black py-0.5 px-4">
<h1 class="font-bold">categories</h1>
</div>
<div class="w-full px-4 mt-1 mb-2 flex flex-col gap-0.5">
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
</div>
</div>
<?php
include_once __DIR__ . '/../templates/sidebar/recent-posts.php';
include_once __DIR__ . '/../templates/sidebar/categories.php';
?>
</div>
<div class="w-4/5 border-b border-black p-4">
<div class="mb-3">
<h1 class="text-3xl font-bold">this is an example post</h1>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
</div>
<div class="flex flex-col mt-2 gap-4">
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
<p>Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder Placeholder</p>
</div>
<?php
include_once __DIR__ . '/../templates/elements/post.php';
?>
</div>
</div>
</body>

View File

@ -0,0 +1,13 @@
<div id="categories">
<div class="w-full border-b border-t border-black py-0.5 px-4">
<h1 class="font-bold">categories</h1>
</div>
<div class="w-full px-4 mt-1 mb-2 flex flex-col gap-0.5">
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
<a href="/category/1" class="text-blue-500 underline text-sm">Example Category</a>
</div>
</div>

View File

@ -0,0 +1,15 @@
<div id="recent-posts">
<div class="w-full border-b border-black py-0.5 px-4">
<h1 class="font-bold">recent posts</h1>
</div>
<div class="w-full px-4 mt-1 mb-4 flex flex-col gap-0.5">
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
<a href="/post/1" class="text-blue-500 underline text-sm">Example Post</a>
</div>
</div>