Skip to content

Commit

Permalink
organize web directory a bit better (content is now in web/src)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtupy committed May 11, 2024
1 parent e0f500f commit 7994d39
Show file tree
Hide file tree
Showing 36 changed files with 4,814 additions and 57 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/web_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
wget -q -O - https://github.com/cobalt-org/cobalt.rs/releases/download/v0.19.2/cobalt-v0.19.2-x86_64-unknown-linux-gnu.tar.gz|tar -xzf - ./cobalt
cd web
../cobalt build
cd _site
tar -czf ../../_site.tar.gz *
cd public_html
tar -czf ../../public_html.tar.gz *
cd ../..
curl -u "${{secrets.CIFTP}}" -s -T _site.tar.gz ftp://nvgt.gg/_site.tar.gz
curl -s -H "x-auth: ${{secrets.CIPHP}}" https://nvgt.gg/ci/website_update.php
curl -u "${{secrets.CIFTP}}" -s -T public_html.tar.gz ftp://nvgt.gg
curl -H "X-Auth: ${{secrets.CIPHP}}" -s https://nvgt.gg/ci/website_update.php
6 changes: 3 additions & 3 deletions doc/docgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def output_html_section(md_path, title):
f.close()
# The NVGT website is built using cobalt (a tiny static site generator that uses liquid templates), and an html version of the docs are hosted on that website. We want this version of the docs to use the liquid layout that the static site uses, so we simply create very basic .liquid files in the nvgt repo's web directory, if that exists.
liquid_path = md_path[:-5] + ".liquid"
if os.path.isdir(os.path.join("..", "web", "docs")):
f = open(os.path.join("..", "web", "docs", liquid_path), "w", encoding = "utf8")
if os.path.isdir(os.path.join("..", "web", "src", "docs")):
f = open(os.path.join("..", "web", "src", "docs", liquid_path), "w", encoding = "utf8")
f.write(liquid_base.format(title = title, body = html_body))
f.close()

Expand All @@ -259,7 +259,7 @@ def main():
if not os.path.exists("html"): os.mkdir("html")
if not os.path.exists("md"): os.mkdir("md")
if os.path.exists(os.path.join("..", "web")):
if not os.path.exists(os.path.join("..", "web", "docs")): os.mkdir(os.path.join("..", "web", "docs"))
if not os.path.exists(os.path.join("..", "web", "src", "docs")): os.makedirs(os.path.join("..", "web", "src", "docs"))
txt_output = open("nvgt.txt", "w", encoding = "UTF8")
hhc_output = open("chm/nvgt.hhc", "w")
hhc_output.write("<html>\n<head>\n</head>\n<body>\n<ul>\n")
Expand Down
27 changes: 19 additions & 8 deletions web/_cobalt.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
source: src
destination: public_html

site:
title: The Nonvisual Gaming Toolkit
description: website for the NonVisual Gaming Toolkit (nvgt) audiogame creation engine
base_url: https://nvgt.gg
title: The Nonvisual Gaming Toolkit
description: website for the NonVisual Gaming Toolkit (nvgt) audiogame creation engine
base_url: https://nvgt.gg
sitemap: sitemap.xml
data:
nav:
- [Home, "/"]
- ["Documentation", "/docs"]
- [Blog, "/blog"]
- [Source code on Github, "https://github.com/samtupy/nvgt"]

posts:
title: The NVGT blog
description: The NVGT blog is where developers and contributors to the engine can post helpful tips about it's use, news and updates, insites about development, or anything else that doesn't fit very well in the documentation or in other areas of this site. It is a very minamilistic blogging setup using a static site generator and is meant for informational purposes only.
dir: blog
rss: blog.xml
jsonfeed: blog.json
title: The NVGT blog
description: The NVGT blog is where developers and contributors to the engine can post helpful tips about it's use, news and updates, insites about development, or anything else that doesn't fit very well in the documentation or in other areas of this site. It is a very minamilistic blogging setup using a static site generator and is meant for informational purposes only.
dir: blog
rss: blog.xml
jsonfeed: blog.json
1 change: 0 additions & 1 deletion web/_includes/footer.liquid

This file was deleted.

6 changes: 0 additions & 6 deletions web/_includes/nav.liquid

This file was deleted.

34 changes: 0 additions & 34 deletions web/_layouts/default.liquid

This file was deleted.

File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions web/src/_layouts/default.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
{% if page.published_date -%}
<title>{{ page.title }} &ndash; {{ collections.posts.title }}</title>
{% else %}
<title>{{ page.title }} &ndash; {{ site.title }}</title>
{%- endif %}
<style>
details summary
{
cursor: pointer;
}
details summary > *
{
display: inline;
}
</style>
</head>
<body>
<a href="#content-anchor">Skip to content</a>
<div id="navigation"><nav>
{%- assign permalink = "/" | append: page.permalink -%}
<ul class="links" style="list-style-type:none;">
{% for item in site.data.nav -%}
{%- assign item_with_index = item[0] | append: "/index.html" %}
{%- if permalink == item[0] or permalink == item_with_index -%}
<li><a href="{{ item[0] }}" aria-current="page">{{ item[1] }}</a></li>
{% else -%}
<li><a href="{{ item[0] }}">{{ item[1] }}</a></li>
{% endif %}
{%- endfor -%}
</ul>
</div></nav>
<main><div id="content">
<div id="content-anchor"></div>
{{ page.content }}
</div></main>
<footer><div id="footer">
&copy; 2022&ndash;{{ site.time | date: "%Y" }} <a href="https://samtupy.com">Sam Tupy Productions</a>
</div></footer>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
echo `rm -r ../docs`;
echo `rm -r *`; // We even delete ourself!
// Now load the updated site and undo anything we just deleted.
echo `tar -xzf ../../ci/_site.tar.gz -C ..`;
echo `tar -xzf ../../ci/public_html.tar.gz -C ..`;
?>
Loading

0 comments on commit 7994d39

Please sign in to comment.