From 646906429f5ee357e349ad0e4f269c4210ed7532 Mon Sep 17 00:00:00 2001 From: DeathByDenim Date: Mon, 8 May 2023 20:48:33 -0400 Subject: [PATCH] Add news posts --- deploy.sh | 2 +- pack_web_offline.sh | 11 +++++++++++ scripts/deploy_webserver.sh | 11 +++++++++++ website/_includes/nav.html | 19 ++++++++++--------- website/_layouts/default.html | 9 +++++---- website/_layouts/post.html | 8 ++++++++ website/news.html | 19 +++++++++++++++++++ 7 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 website/_layouts/post.html create mode 100644 website/news.html diff --git a/deploy.sh b/deploy.sh index 45ed3db..c40875c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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 diff --git a/pack_web_offline.sh b/pack_web_offline.sh index e373e1b..6be4360 100755 --- a/pack_web_offline.sh +++ b/pack_web_offline.sh @@ -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" . diff --git a/scripts/deploy_webserver.sh b/scripts/deploy_webserver.sh index 5b57864..4d492f9 100755 --- a/scripts/deploy_webserver.sh +++ b/scripts/deploy_webserver.sh @@ -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 diff --git a/website/_includes/nav.html b/website/_includes/nav.html index fe1eeb0..db19c35 100644 --- a/website/_includes/nav.html +++ b/website/_includes/nav.html @@ -1,7 +1,7 @@ diff --git a/website/_layouts/default.html b/website/_layouts/default.html index fc94985..76ad95c 100644 --- a/website/_layouts/default.html +++ b/website/_layouts/default.html @@ -3,11 +3,12 @@ onFOSS-LAN - - - + + + + - + {% include nav.html %} diff --git a/website/_layouts/post.html b/website/_layouts/post.html new file mode 100644 index 0000000..3123215 --- /dev/null +++ b/website/_layouts/post.html @@ -0,0 +1,8 @@ +--- +layout: default +nav_pill: news +--- +

{{ page.title }}

+

{{ page.date | date_to_string }} - {{ page.author }}

+ +{{ content }} diff --git a/website/news.html b/website/news.html new file mode 100644 index 0000000..461d6d7 --- /dev/null +++ b/website/news.html @@ -0,0 +1,19 @@ +--- +layout: default +nav_pill: news +--- +

News

+ {% for post in site.posts %} +

{{ post.title }}

+

{{ post.date | date_to_string }} by {{ post.author }}

+ {% if forloop.first %} + {{ post.content }} +

Permalink

+ {% else %} + {{ post.excerpt }} +

Read more...

+ {% endif %} + {% else %} +

No news

+ {% endfor %} +