improved static website
This commit is contained in:
@ -1,71 +1,40 @@
|
||||
{% import "macros.jinja" as macros -%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ base['title'] }}</title>
|
||||
<link rel="stylesheet" href="{{ base['url_to']('css/bulma.min.css') }}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ base['title'] }}</title>
|
||||
<link rel="stylesheet" href="{{ base['url_to']('css/bulma.min.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="container navbar" role="navigation" aria-label="main navigation">
|
||||
<nav class="navbar container is-light" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="{{ base['url_to']('index.html') }}">
|
||||
Home
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="{{ base['url_to']('games/index.html') }}">
|
||||
Games
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="{{ base['url_to']('developers/index.html') }}">
|
||||
Developers
|
||||
</a>
|
||||
|
||||
<a class="navbar-item{% if 'index' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('index.html') }}">Home</a>
|
||||
<a class="navbar-item{% if 'games' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('games/index.html') }}">Games</a>
|
||||
<a class="navbar-item{% if 'developers' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('developers/index.html') }}">Developers</a>
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a class="navbar-link">
|
||||
Filter
|
||||
</a>
|
||||
|
||||
<a class="navbar-link{% if 'filter' in base['active_nav'] %} is-active{% endif %}">Filter</a>
|
||||
<div class="navbar-dropdown">
|
||||
<a class="navbar-item" href="{{ base['url_to']('inspirations/index.html') }}">
|
||||
By inspiration
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['url_to']('games/genres.html') }}">
|
||||
By category
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['url_to']('games/languages.html') }}">
|
||||
By code language
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['url_to']('games/platforms.html') }}">
|
||||
By OS support
|
||||
</a>
|
||||
<a class="navbar-item{% if 'inspirations' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('inspirations/index.html') }}">By inspiration</a>
|
||||
<a class="navbar-item{% if 'genres' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('games/genres.html') }}">By category</a>
|
||||
<a class="navbar-item{% if 'code language' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('games/languages.html') }}">By code language</a>
|
||||
<a class="navbar-item{% if 'platforms' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('games/platforms.html') }}">By OS support</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="navbar-item" href="{{ base['url_to']('statistics.html') }}">
|
||||
Statistics
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="{{ base['url_to']('contribute.html') }}">
|
||||
Contribute
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="https://github.com/Trilarion/opensourcegames">
|
||||
On GitHub
|
||||
</a>
|
||||
|
||||
<a class="navbar-item{% if 'statistics' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('statistics.html') }}">Statistics</a>
|
||||
<a class="navbar-item{% if 'contribute' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to']('contribute.html') }}">Contribute</a>
|
||||
<a class="navbar-item" href="https://github.com/Trilarion/opensourcegames">On GitHub</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container is-size-7">
|
||||
<a href="https://trilarion.blogspot.com/search/label/osgames">Blog</a><br>
|
||||
Last updated on {{ base['creation-date'] }}
|
||||
Last updated on {{ base['creation-date'] }}<br>
|
||||
Disclaimer / License
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
@ -4,21 +4,23 @@
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="box">
|
||||
<h1 class="title">{{ index['title'] }}</h1>
|
||||
{% set comma = joiner(",") %}
|
||||
{% for category in index['categories'] %}
|
||||
{{ comma() }} <a href="#{{ category }}" class="is-size-4">{{ category }}</a> with {{ index['number_entries'][category] }} item(s)
|
||||
{% endfor %}
|
||||
<div class="block"><h1 class="title">{{ index['title'] }}</h1></div>
|
||||
{% set comma = joiner(", ") %}
|
||||
<div class="is-size-4">
|
||||
{% for category in index['categories'] -%}
|
||||
{{ comma() }} <a href="#{{ category }}" class="has-text-weight-semibold">{{ category }}</a> ({{ index['number_entries'][category] }})
|
||||
{%- endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% for category in index['categories'] %}
|
||||
<div class="box">
|
||||
<h2 id="{{ category }}" class="is-size-4">{{ category }}</h2>
|
||||
<div class="block"><h2 id="{{ category }}" class="is-size-4 has-text-weight-semibold">{{ category }}</h2></div>
|
||||
<div class="columns">
|
||||
{% for entries_column in index['entries'][category] %}
|
||||
<div class="column">
|
||||
<ul>
|
||||
{% for entry in entries_column %}
|
||||
<li><a href="{{ base['url_to'](entry['href']) }}">{{ entry['name'] }}</a> {% if 'tags' in entry %}<span class="is-light is-size-7">({{ entry['tags'] }})</span>{% endif %}</li>
|
||||
<li>{{ macros.url(entry['href'], entry['name']) }} {% if 'tags' in entry %}<span class="is-light is-size-7">({{ entry['tags'] }})</span>{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -1,4 +1,3 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
@ -1,16 +0,0 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">Developers ({{ letter.capitalize() }})</h1>
|
||||
{% for developer in developers %}
|
||||
<div class="box">
|
||||
<h2 id="{{ developer['anchor-id'] }}">{{ developer['Name'] }}</h2><br>
|
||||
{% set comma = joiner(", ") %}
|
||||
Game(s):{% for game in developer['Games'] %}{{ comma() }}<a href="{{ base['url_to'](game[0]) }}">{{ game[1] }}</a>{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
@ -1,44 +0,0 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">{{ data['title'] }}</h1>
|
||||
{% for g in data['games'] %}
|
||||
<div class="box">
|
||||
<nav class="level is-mobile">
|
||||
<div class="level-left">
|
||||
<h2 id="{{ g['anchor-id'] }}">{{ g['Title'] }}</h2>
|
||||
</div>
|
||||
<div class="level-right is-size-7">
|
||||
<p class="level-item"><a href="{{ base['url_to']('contribute.html') }}">Edit</a></p>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{%- set comma = joiner(", ") -%}
|
||||
Home: {% for url in g['Home'] %}{{ comma() }}<a href="{{ url }}">{{ url }}</a>{% endfor %}<br>
|
||||
{% if 'Inspirations' in g %}
|
||||
{%- set comma = joiner(", ") -%}
|
||||
Inspirations: {% for inspiration in g['Inspirations']%}{{ comma() }}<a href="{{ base['url_to'](inspiration[0]) }}">{{ inspiration[1] }}</a>{% endfor %}<br>
|
||||
{% endif%}
|
||||
{%- set comma = joiner(", ") -%}
|
||||
{% if 'Media' in g %}Media: {% for url in g['Media'] %}{{ comma() }}<a href="{{ url }}">{{ url }}</a>{% endfor %}<br>{% endif%}
|
||||
{%- set comma = joiner(", ") -%}
|
||||
{% if 'Download' in g %}Download: {% for url in g['Download'] %}{{ comma() }}<a href="{{ url }}">{{ url }}</a>{% endfor %}<br>{% endif%}
|
||||
{%- set comma = joiner(", ") -%}
|
||||
{% if 'Play' in g %}Play: {% for url in g['Play'] %}{{ comma() }}<a href="{{ url }}">{{ url }}</a>{% endfor %}<br>{% endif%}
|
||||
{% if 'Developer' in g %}
|
||||
{%- set comma = joiner(", ") -%}
|
||||
Developer: {% for developer in g['Developer']%}{{ comma() }}<a href="{{ base['url_to'](developer[0]) }}">{{ developer[1] }}</a>{% endfor %}<br>{% endif%}
|
||||
{% if 'Note' in g %}{{ g['Note'] }}<br>{% endif%}
|
||||
Technical info<br>
|
||||
{%- set comma = joiner(", ") -%}
|
||||
Language: {% for language in g['Code language'] %}{{ comma() }}{{ language }}{% endfor %}<br>
|
||||
{%- set comma = joiner(", ") -%}
|
||||
License: {% for license in g['Code license'] %}{{ comma() }}{{ license }}{% endfor %}<br>
|
||||
{% if 'Build system' in g['Building'] %}Build system: <br>{% endif%}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
@ -1,12 +1,14 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<section class="hero is-light is-bold">
|
||||
<div class="hero-body">
|
||||
<div class="container">
|
||||
<h1 class="title">Open source games list (OSGL)</h1>
|
||||
<p class="subtitle">
|
||||
Contains information about {{ index['number_games'] }} open source games.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
@ -1,17 +0,0 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">Inspirations ({{ letter.capitalize() }})</h1>
|
||||
{% for inspiration in inspirations %}
|
||||
<div class="box">
|
||||
<h2 id="{{ inspiration['anchor-id'] }}">{{ inspiration['Name'] }}</h2><br>
|
||||
{% if 'Media' in inspiration %}Media: {{ inspiration['Media'] }}<br>{% endif %}
|
||||
{% set comma = joiner(", ") %}
|
||||
Inspired entries: {% for game in inspiration['Inspired entries'] %}{{ comma() }}<a href="{{ base['url_to'](game[0]) }}">{{ game[1] }}</a>{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
@ -1,14 +0,0 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>{{ data['title'] }}</h1>
|
||||
<ul>
|
||||
{% for item in data['items'] %}
|
||||
<li>{{ item }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
24
code/html/listing.jinja
Normal file
24
code/html/listing.jinja
Normal file
@ -0,0 +1,24 @@
|
||||
{% extends "base.jinja" %}
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">{{ listing['title'] }}</h1>
|
||||
{% for item in listing['items'] %}
|
||||
<div class="box">
|
||||
<nav class="level is-mobile">
|
||||
<div class="level-left">
|
||||
<h2 id="{{ item['anchor-id'] }}" class="title is-4">{{ item['name'] }}</h2>
|
||||
</div>
|
||||
<div class="level-right is-size-7">
|
||||
<p class="level-item"><a href="{{ base['url_to']('contribute.html') }}">Edit</a></p>
|
||||
</div>
|
||||
</nav>
|
||||
{% for field in item['fields'] %}{% set comma = joiner(", ") %}
|
||||
{{ macros.listing_field_title(field['title']) }}{% for entry in field['entries'] %}{{ comma() }}{{ macros.url(entry['href'], entry['name']) }}{% endfor %}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<a class="is-light is-size-7" href="#">Back to top</a>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
13
code/html/macros.jinja
Normal file
13
code/html/macros.jinja
Normal file
@ -0,0 +1,13 @@
|
||||
{% macro url(href, name) -%}
|
||||
{% if href %}
|
||||
<a href="{{ base['url_to'](href) }}">{{ name }}</a>
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro listing_field_title(title) -%}
|
||||
{% if title %}
|
||||
{{ title['name'] }}:
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
@ -1,9 +1,7 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">{{ data['title'] }}</h1>
|
||||
{% set comma = joiner(",") %}
|
||||
{% for section in data['sections'] %}
|
||||
@ -24,5 +22,4 @@
|
||||
</div>
|
||||
</section>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
@ -1,4 +1,3 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user