first commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// Načtení dat
|
||||
// __DIR__ je eos-modern/public
|
||||
// ../content je eos-modern/content
|
||||
// Ale JSON je v public/data, takže:
|
||||
// Cesta k config.php: __DIR__ je public, ../ je eos-modern, includes/config.php je správně
|
||||
require_once __DIR__ . '/../includes/config.php';
|
||||
$dataPath = __DIR__ . '/data/articles.json';
|
||||
if (!file_exists($dataPath)) {
|
||||
// Fallback, pokud je JSON v content (což by neměl být)
|
||||
// Nebo generuj JSON
|
||||
die("Chyba: articles.json nenalezen v " . $dataPath);
|
||||
}
|
||||
|
||||
$articlesJson = file_get_contents($dataPath);
|
||||
$articles = json_decode($articlesJson, true);
|
||||
|
||||
// Obsah stránky
|
||||
$content = '
|
||||
<section class="hero">
|
||||
<h1 style="text-align: center;">🇨🇿 Vítám Tě na webu České komunity EndeavourOS! 🇨🇿</h1>
|
||||
<p style="text-align: center;">Lehká, rychlá a moderní distribuce založená na Arch Linuxu.</p>
|
||||
</section>
|
||||
<h4 style="text-align: center;">Je navržena tak, aby poskytovala uživatelům přístup k nejnovějším technologiím a softwaru, přičemž zachovává jednoduchost a stabilitu. Distribuce nabízí několik předinstalovaných prostředí.</h4>
|
||||
<br>
|
||||
<h2 style="text-align: center;" id="articles">👇 Začínáme 👇</h2>
|
||||
<div class="article-grid">
|
||||
';
|
||||
|
||||
foreach ($articles as $article) {
|
||||
$content .= '
|
||||
<a href="' . WEB_ROOT . '/article.php?slug=' . htmlspecialchars($article['slug']) . '" class="article-card">
|
||||
<h3>' . htmlspecialchars($article['title']) . '</h3>
|
||||
<p>' . htmlspecialchars($article['excerpt']) . '</p>
|
||||
<span class="article-meta">' . $article['date'] . '</span>
|
||||
</a>
|
||||
';
|
||||
}
|
||||
|
||||
$content .= '</div>';
|
||||
|
||||
// Renderování šablony
|
||||
$pageTitle = 'Domů - EndeavourOS CZ';
|
||||
$pageDesc = 'Úvodní stránka české komunity EndeavourOS';
|
||||
|
||||
// Použijeme absolutní cestu k šabloně
|
||||
require PATH_TEMPLATES . 'base.php';
|
||||
?>
|
||||
Reference in New Issue
Block a user