This commit is contained in:
2025-09-18 13:29:43 +02:00
commit 164a89ea3e
14 changed files with 673 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
ini_set("display_errors", "On");
error_reporting(E_ALL);
include '../parts/header.php';
?>
<div id="top-bar">
<h1>> Blog</h1>
</div>
<article id="content">
<div class="post">Poniżej znajdziesz listę wszystkich postów na blogu ~<<USER>></div>
<?php
$posts_dir = 'posts/';
$posts = array_diff(scandir($posts_dir), array('..', '.'));
foreach ($posts as $post) {
$f = fopen("posts/$post", "r");
$line = fgets($f);
fclose($f);
$data = substr(substr($line, 4), 0, -4);
$post_data = explode(";%%%;", $data);
$title = $post_data[0];
$date = $post_data[1];
echo "<div class=\"post\"><i class=\"post_date\">$date</i> - <a href=\"posts/$post\" class=\"link\">$title</a></div>";
}
?>
</article>
<?php
include '../parts/footer.php';
?>

16
public_html/blog/newpost Normal file
View File

@@ -0,0 +1,16 @@
#title:Tytuł posta
Tutaj zaczyna się treść posta, dozwolony markdown
# Nagłówek
## Nagłówek 2
![alt](image.png)
> to
> jest
> cytat
```
a tu kod
```

View File

@@ -0,0 +1,11 @@
<!-- Witaj świecie!;%%%;2025-07-29 17:33:01 -->
<?php include '../../parts/header.php'; ?>
<div id="top-bar">
<h1>> Witaj świecie!</h1>
</div>
<i class="post_date">2025-07-29 17:33:01</i>
<article id="content">
<p>To jest pierwszy post na twojej stronie. Możesz go usunąć usuwając plik witaj-swiecie.php :)</p>
</article>
<?php include '../../parts/footer.php'; ?>

57
public_html/index.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
include 'parts/header.php';
?>
<div id="top-bar">
<h1>> Strona Główna</h1>
</div>
<article id="content">
<pre>
__ __ _ _
\ \ / /__| | ___ ___ _ __ ___ ___ | |_ ___
\ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \ | __/ _ \
\ V V / __/ | (_| (_) | | | | | | __/ | || (_) |
\_/\_/ \___|_|\___\___/|_| |_| |_|\___| \__\___/
</pre>
<h1>Witaj na swojej stronie, <code><<USER>></code>!</h1>
<p>
To Twoja osobista przestrzeń w <strong>systemie Tylda</strong> — tu możesz pisać bloga, eksperymentować z HTML, PHP, Ash, Perl, Python… albo po prostu zostawić wiadomość dla świata.
</p>
<p>
Twój katalog to <code>/home/<<USER>>/</code><br>
Twoja strona jest dostępna w katalogu: <code>/home/<<USER>>/public_html/</code>
</p>
<hr>
<h2>Co możesz teraz zrobić?</h2>
<ul>
<li>Edytuj ten plik, by zacząć tworzyć swoją stronę</li>
<li>Dodaj wpis na bloga: <code>komenda <i>blog</i></code></li>
<li>Dołącz do czatu IRC na <code>#ogolny</code> (WeeChat)</li>
<li>Sprawdź skrzynkę: <code>neomutt</code></li>
<li>Dodaj swój styl: stwórz <code>style.css</code></li>
</ul>
<hr>
<p>
Chcesz więcej inspiracji? Zajrzyj do innych użytkowników: <a class="link" href="/users.php">Lista użytkowników</a><br>
Albo odwiedź <a class="link" href="https://tildeverse.org">tildeverse.org</a>, by zobaczyć inne społeczności.
</p>
<p>
Niech Twój katalog rośnie razem z Tobą. Baw się dobrze i nie bój się próbować!
</p>
<pre>
~ v0id1st
</pre>
</article>
<?php
include 'parts/footer.php';
?>

View File

@@ -0,0 +1,4 @@
</div>
</body>
</html>

View File

@@ -0,0 +1,21 @@
<?php
$req = $_SERVER['REQUEST_URI'];
?>
<html lang="pl">
<head>
<link rel="stylesheet" type="text/css" href="/~<<USER>>/style.css">
<?php
if (str_contains($req, "/blog/")) {
echo '<title>~<<USER>> Blog | tylda.org</title>';
} else {
echo '<title>~<<USER>> | tylda.org</title>';
}
?>
</head>
<body>
<div class="main-content">
<header id="menu">
<a href="/~<<USER>>/">~<<USER>></a>
<a <?php if ($req == "/~<<USER>>/" || $req == "~/<<USER>>/index.php") { echo 'class="active"'; } ?>href="/~<<USER>>/">strona główna</a>
<a <?php if (str_starts_with($req, "/~<<USER>>/blog/")) { echo 'class="active"'; } ?>href="/~<<USER>>/blog/">blog</a>
</header>

View File

@@ -0,0 +1,8 @@
<div id="top-bar">
<h1>> <<TITLE>></h1>
</div>
<i class="post_date"><<DATE>></i>
<article id="content">
<<CONTENT>>
</article>

125
public_html/style.css Normal file
View File

@@ -0,0 +1,125 @@
@media only screen and (max-width: 850px) {
header#menu {
flex-direction: column !important;
}
}
:root {
--main: #dd9a1a;
--bg: #111;
--link: #ffdb96;
--link-hover: #dd9a1a;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: var(--bg);
color: var(--main);
font-family: "Helvetica", "Arial", sans-serif;
}
div.main-content {
display: flex;
flex-direction: column;
width: 60%;
margin: 0 auto;
padding: 1rem;
}
header#menu {
display: flex;
flex-direction: row;
height: 3rem;
border-width: 5px;
border-color: var(--main);
border-style: double;
border-radius: 5px;
margin-bottom: 2rem;
align-items: center;
}
header#menu a {
padding: 7px;
color: var(--main);
text-decoration: none;
text-transform: uppercase;
padding-inline: 30px;
font-weight: bold;
}
header#menu a.active {
background: var(--main);
color: var(--bg);
}
header#menu a:hover {
background: var(--main);
color: var(--bg);
}
div#top-bar {
font-family: 'Courier New';
}
article#content {
display: flex;
flex-direction: column;
border-width: 5px;
border-color: var(--main);
border-style: double;
border-radius: 5px;
margin-top: 2rem;
padding: 1rem;
gap: 8px;
padding-block: 2rem;
}
footer#footer {
margin-top: 3rem;
display: flex;
flex-direction: row;
gap: 1rem;
justify-content: center;
}
.link {
color: var(--link);
text-decoration: none;
}
.link:hover {
color: var(--link-hover);
}
footer#footer > *:not(:last-child)::after {
content: " ~ ";
margin-left: 0.7rem;
color: var(--main);
}
pre.ascii {
margin-bottom: 2rem;
font-size: 15px;
}
.user_home {
display: grid;
grid-template-columns: 100px 30px 100px 100px 40px 120px 15px;
font-family: monospace;
white-space: pre;
}
ol, ul {
margin-left: 2rem;
}
.post {
display: flex;
gap: 1rem;
}