Add news posts

This commit is contained in:
DeathByDenim 2023-05-08 20:48:33 -04:00
parent 81946e99bd
commit 646906429f
Signed by: DeathByDenim
GPG Key ID: 4A475283D925365B
7 changed files with 65 additions and 14 deletions

View File

@ -67,7 +67,7 @@ apt install --assume-yes \
fuse g++ gcc curl firewalld automake autoconf libtool \
libcurl3-dev libc-ares-dev zlib1g-dev libncurses-dev make python3-aiohttp \
nginx-core certbot python3-certbot-nginx sudo python3-psutil \
ldc dub libenet-dev python3-bcrypt jq telnet jekyll
ldc dub libenet-dev python3-bcrypt jq telnet jekyll ruby-jekyll-feed
# Create the user for running the game servers
if ! getent passwd ${systemuser}; then

View File

@ -46,6 +46,17 @@ content:
offline: true
ssl: true
md5password: "$(echo -n "${systempassword}" | md5sum | cut -d' ' -f1)"
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
plugins:
- jekyll-feed
EOF
jekyll build --source ${webroot} --destination ${webroot}/_site
tar -cjf web.tar.bz2 --directory="${webroot}/_site" .

View File

@ -47,6 +47,17 @@ content:
offline: false
ssl: ${ssl}
md5password: "$(echo -n "${systempassword}" | md5sum | cut -d' ' -f1)"
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
plugins:
- jekyll-feed
EOF
jekyll build --source "$(dirname "$0")"/../website --destination /var/www/html

View File

@ -1,7 +1,7 @@
<nav class="container">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<img class="bi me-2" width="40" height="32" src="assets/img/blackmage.svg" alt="Site icon">
<img class="bi me-2" width="40" height="32" src="/assets/img/blackmage.svg" alt="Site icon">
<span class="fs-4">onFOSS-LAN hosted by {{ site.content.hosted_by_name }}</span>
</a>
@ -12,18 +12,19 @@
{% assign nav_pill = page.nav_pill %}
{% endif %}
{% case nav_pill %}
{% when "tournament", "schedule", "help", "admin" %}
{% when "tournament", "news", "schedule", "help", "admin" %}
{% assign home = false %}
{% else %}
{% assign home = true %}
{% endcase %}
<li class="nav-item"><a href="index.html" class="nav-link {% if home %}active{% endif %}" aria-current="page">Home</a></li>
<li class="nav-item"><a href="tournament.html" class="nav-link {% if nav_pill == "tournament" %}active{% endif %}">Tournament</a></li>
<li class="nav-item"><a href="schedule.html" class="nav-link {% if nav_pill == "schedule" %}active{% endif %}">Schedule</a></li>
<li class="nav-item"><a href="help.html" class="nav-link {% if nav_pill == "help" %}active{% endif %}">Help</a></li>
{% if site.content.offline == false %}
<li class="nav-item"><a href="admin.html" class="nav-link {% if nav_pill == "admin" %}active{% endif %}">Admin</a></li>
{% endif %}
<li class="nav-item"><a href="/index.html" class="nav-link {% if home %}active{% endif %}" aria-current="page">Home</a></li>
<li class="nav-item"><a href="/news.html" class="nav-link {% if nav_pill == "news" %}active{% endif %}">News</a></li>
<li class="nav-item"><a href="/tournament.html" class="nav-link {% if nav_pill == "tournament" %}active{% endif %}">Tournament</a></li>
<li class="nav-item"><a href="/schedule.html" class="nav-link {% if nav_pill == "schedule" %}active{% endif %}">Schedule</a></li>
<li class="nav-item"><a href="/help.html" class="nav-link {% if nav_pill == "help" %}active{% endif %}">Help</a></li>
{% unless site.content.offline %}
<li class="nav-item"><a href="/admin.html" class="nav-link {% if nav_pill == "admin" %}active{% endif %}">Admin</a></li>
{% endunless %}
</ul>
</header>
</nav>

View File

@ -3,11 +3,12 @@
<head>
<meta charset="utf-8">
<title>onFOSS-LAN</title>
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/serverstats.css">
<link rel="icon" href="icon.svg" sizes="any" type="image/svg+xml">
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/css/serverstats.css">
<link rel="icon" href="/icon.svg" sizes="any" type="image/svg+xml">
<link rel="alternate" type="application/rss+xml" title="{{ site.content.domain_name }}" href="/feed.xml">
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="js/serverstats.js"></script>
<script src="/js/serverstats.js"></script>
</head>
<body>
{% include nav.html %}

View File

@ -0,0 +1,8 @@
---
layout: default
nav_pill: news
---
<h1>{{ page.title }}</h1>
<p>{{ page.date | date_to_string }} - {{ page.author }}</p>
{{ content }}

19
website/news.html Normal file
View File

@ -0,0 +1,19 @@
---
layout: default
nav_pill: news
---
<h1>News</h1>
{% for post in site.posts %}
<h2>{{ post.title }}</h2>
<p><strong>{{ post.date | date_to_string }} by {{ post.author }}</strong></p>
{% if forloop.first %}
{{ post.content }}
<p><a href="{{ post.url }}">Permalink</a></p>
{% else %}
{{ post.excerpt }}
<p><a href="{{ post.url }}">Read more...</a></p>
{% endif %}
{% else %}
<p>No news</p>
{% endfor %}
</ul>