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
@@ -0,0 +1,6 @@
A while ago I had acquired a chromebook from my school as they were doing a cleanout, so I was able to nab this crappy school chromebook that had a detachable battery and a 5GB 2.5" internal SSD
!image assets/img/projects/arch_chromebook/arch_chromebook.jpg
I wanted to try and install a new operating system on it, and since I was in my distrohopping phase I wanted to try installing Arch Linux on it, since I figure that would allow it to be actually usable rather than in it's chromeOS state
The main issue was that the current operating system had a lock on it that made it so that you as a student wouldn't be able to boot into a different operating system, either through installing a new OS on the current drive or through using a LiveCD.
So what I had to do was go INTO the currently installed operating system, toggle a setting, and then use a tool that would install <a href='https://chromeos.google/products/chromeos-flex/'>ChromeFlex</a>, which basically acted as an intermediary operating system so that I could unlock the actual firmware, letting me plug in a better drive
Now that I could put in my own drive and not have the device yell at me for not having a ChromeOS operating system I went ahead and installed Arch Linux on the drive and booted it up
@@ -0,0 +1,6 @@
A while ago I had acquired a chromebook from my school as they were doing a cleanout, so I was able to nab this crappy school chromebook that had a detachable battery and a 5GB 2.5" internal SSD
!image assets/img/projects/arch_chromebook/arch_chromebook.jpg
I wanted to try and install a new operating system on it, and since I was in my distrohopping phase I wanted to try installing Arch Linux on it, since I figure that would allow it to be actually usable rather than in it's chromeOS state
The main issue was that the current operating system had a lock on it that made it so that you as a student wouldn't be able to boot into a different operating system, either through installing a new OS on the current drive or through using a LiveCD.
So what I had to do was go INTO the currently installed operating system, toggle a setting, and then use a tool that would install <a href='https://chromeos.google/products/chromeos-flex/'>ChromeFlex</a>, which basically acted as an intermediary operating system so that I could unlock the actual firmware, letting me plug in a better drive
Now that I could put in my own drive and not have the device yell at me for not having a ChromeOS operating system I went ahead and installed Arch Linux on the drive and booted it up
@@ -0,0 +1,6 @@
When I was in high school I starting watching some youtube videos from this one guy: <a href='https://www.youtube.com/@dpacarana'>abel cirilo</a> who had made an operating system completely dedicated to a single character (Osaka) in the popular anime - Azumanga Daioh
<iframe width='560' height='315' src='https://www.youtube.com/embed/vYImR-wrTV0?si=ODkfGwTBbsNOC_Lg' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' referrerpolicy='strict-origin-when-cross-origin' allowfullscreen></iframe>
So I decided that I might as well take a crack at something similar since I had a lot of time on my hands with summer break and all, so I started looking at what resources he used and I came upon a website called <a href='https://osdev.org/'>osdev.org</a> which had a bunch of resources and books on how to make your own operating system COMPLETELY from scratch, I'm not talking "I'll just build from the linux kernel" I'm talking you are writing/compiling the bootloader, the different ways different CPUs interact with the OS, and adding in ASCII support.
Obviously I there was a TON of things that I was not ready for, I had barely even written a line of C/C++ code before so this was very strange and I eventually stopped working on it
!image assets/img/projects/os_making/qemu1.png
I was able to finish the <a href='https://wiki.osdev.org/Bare_Bones'>"Bare Bones"</a> part of the documentation but I still feel very proud of it.
+7
View File
@@ -0,0 +1,7 @@
#content a{
color:rgb(169, 26, 169);
text-decoration: underline;
}
#content a:hover {
color:red;
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

+16
View File
@@ -9,6 +9,22 @@ function head($title) {
</head>";
}
function head_css($title, $css, $dots) {
$css_links = "";
foreach($css as $css_item) {
$css_links .= "<link rel='stylesheet' href='". "$dots/css/$css_item" ."'";
}
return "
<head>
<meta charset='UTF-8' />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<script src='https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4'></script>
<title>" . $title . "</title>
$css_links
</head>";
}
function navbar($highlighted_box) {
$selected = "
+36
View File
@@ -119,4 +119,40 @@ function image_project_list() {
</section>
";
}
function get_blog_content($dots, $project_name, $project_content_dir) {
$output = "";
$fh = fopen("$project_content_dir/content.txt",'r');
while ($line = fgets($fh)) {
if (str_contains($line, "!image ")) {
$image_link = str_replace("!image " , "", $line);
$output .= "
<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" ."' 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 {
$output .= "
<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);
return $output;
}
function make_blog($dots, $project_name, $project_content_dir) {
return "
<section id='content' 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'>$project_name</h1>
". get_blog_content($dots, $project_name, $project_content_dir) ."
</div>
</section>
";
}
?>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

+11 -12
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"); ?>
<html>
<?php echo head_css($project_name, ["projects.css"], $dots); ?>
<body>
<?php echo title("Python Website"); ?>
<?php echo navbar("0"); ?>
<?php echo make_blog($dots, $project_name, $project_content_dir); ?>
<?php echo footer(); ?>
</body>
</html>
+11 -12
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"); ?>
<html>
<?php echo head_css($project_name, ["projects.css"], $dots); ?>
<body>
<?php echo title("Python Website"); ?>
<?php echo navbar("0"); ?>
<?php echo make_blog($dots, $project_name, $project_content_dir); ?>
<?php echo footer(); ?>
</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>