Projects are now able to read from a content dir, posted two projects

This commit is contained in:
2026-10-01 13:53:29 -06:00
parent 7369d0a534
commit 5967222ec0
14 changed files with 148 additions and 28 deletions
+13 -14
View File
@@ -1,19 +1,18 @@
<?php $dots=str_repeat("../", substr_count(__DIR__, '/')-1); ?>
<?php
header('Location: /wip');
exit();
include_once("$dots/includes/all.php");
include_once("$dots/includes/projects.php");
$project_name = "Arch Chromebook";
$project_content_dir = "$dots/assets/project_blogs/arch_chromebook";
?>
<?php $srv_root = __DIR__; $dots = "";
$slash_count = substr_count($srv_root, '/');
for ($i = 1; $i < $slash_count; $i++) {$dots .= "../";};?>
<?php include_once("$dots/includes/all.php"); ?>
<?php include_once("$dots/includes/projects.php"); ?>
<!DOCTYPE html>
<html lang="en">
<?php echo head("test"); ?>
<body>
<?php echo title("Python Website"); ?>
<html>
<?php echo head_css($project_name, ["projects.css"], $dots); ?>
<body>
<?php echo navbar("0"); ?>
<?php echo make_blog($dots, $project_name, $project_content_dir); ?>
<?php echo footer(); ?>
</body>
</body>
</html>
+13 -14
View File
@@ -1,19 +1,18 @@
<?php $dots=str_repeat("../", substr_count(__DIR__, '/')-1); ?>
<?php
header('Location: /wip');
exit();
include_once("$dots/includes/all.php");
include_once("$dots/includes/projects.php");
$project_name = "Operating System from Scratch";
$project_content_dir = "$dots/assets/project_blogs/os_making";
?>
<?php $srv_root = __DIR__; $dots = "";
$slash_count = substr_count($srv_root, '/');
for ($i = 1; $i < $slash_count; $i++) {$dots .= "../";};?>
<?php include_once("$dots/includes/all.php"); ?>
<?php include_once("$dots/includes/projects.php"); ?>
<!DOCTYPE html>
<html lang="en">
<?php echo head("test"); ?>
<body>
<?php echo title("Python Website"); ?>
<html>
<?php echo head_css($project_name, ["projects.css"], $dots); ?>
<body>
<?php echo navbar("0"); ?>
<?php echo make_blog($dots, $project_name, $project_content_dir); ?>
<?php echo footer(); ?>
</body>
</body>
</html>
+45
View File
@@ -0,0 +1,45 @@
<?php $dots=str_repeat("../", substr_count(__DIR__, '/')-1); ?>
<?php
include_once("$dots/includes/all.php");
$project_name = "Template";
$project_content_dir = "$dots/assets/project_blogs/arch_chromebook";
?>
<!DOCTYPE html>
<html>
<?php echo head($project_name); ?>
<body>
<?php echo navbar("0"); ?>
<section id='_hero_creative_journey_v6_001' class='py-20 sm:py-24 bg-white dark:bg-neutral-950'>
<div class='max-w-7xl mx-auto px-4 sm:px-6 lg:px-8'>
<!-- Centered Header -->
<div class='text-center max-w-3xl mx-auto' data-motion='hero' style='opacity: 1;'>
<h1 class='text-3xl sm:text-5xl lg:text-6xl font-bold text-slate-900 dark:text-white leading-tight mb-6'><?php echo $project_name ?></h1>
<?php
$paragraphs = [];
$fh = fopen("$project_content_dir/content.txt",'r');
while ($line = fgets($fh)) {
$paragraphs[] = $line;
if (str_contains($line, "!image ")) {
$image_link = str_replace("!image " , "", $line);
echo "
<div class='pb-10'><div class='relative rounded-3xl overflow-hidden h-80 lg:h-full group'>
<img data-motion='image' src='". "$dots/$image_link" ."' alt='Creative brainstorming session' class='w-full h-full object-cover group-hover:scale-105 transition-transform duration-700' style='opacity: 1; transform: scale(1); filter: blur(0px);'>
</div></div>
";
} else {
echo "
<p class='text-2xl text-left text-slate-600 dark:text-neutral-400 mb-8' data-animate='text' style='opacity: 1;'>
". $line ."
</p>";
}
}
fclose($fh);
?>
</div>
</section>
<?php echo footer(); ?>
</body>
</html>