improved static website

This commit is contained in:
Trilarion
2020-10-08 13:18:15 +02:00
parent 13f8e4fa65
commit 7c79a9bde0
16 changed files with 265 additions and 144 deletions

View File

@ -5,28 +5,30 @@
<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') }}">
<link rel="stylesheet" href="{{ base['url_to'](['css', 'bulma.min.css']) }}">
<link rel="stylesheet" href="{{ base['url_to'](['css', 'osgl.min.css']) }}">
</head>
<body>
{# navigation bar -#}
<nav class="navbar container is-light" role="navigation" aria-label="main navigation">
<nav class="navbar container is-light" aria-label="main navigation">
<div class="navbar-menu">
<div class="navbar-start">
<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>
<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 'frameworks' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to'](['frameworks', 'index.html']) }}">Frameworks/Tools</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{% if 'filter' in base['active_nav'] %} is-active{% endif %}">Filter</a>
<div class="navbar-dropdown">
<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>
<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{% 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>
<a class="navbar-item{% if 'statistics' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to'](['statistics.html']) }}"><span class="icon"><i class="icon-stats-dots"></i></span><span>Statistics</span></a>
<a class="navbar-item{% if 'contribute' in base['active_nav'] %} is-active{% endif %}" href="{{ base['url_to'](['contribute.html']) }}"><span class="icon"><i class="icon-pencil"></i></span><span>Contribute</span></a>
<a class="navbar-item" href="https://github.com/Trilarion/opensourcegames">{{ macros.render_icon('github') }}<span>On GitHub</span></a>
</div>
</div>
</nav>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Binary file not shown.

1
code/html/css/osgl.min.css vendored Normal file
View File

@ -0,0 +1 @@
@font-face{font-family:'osgl';src:url('fonts/osgl.ttf?iylqbe') format('truetype'), url('fonts/osgl.woff?iylqbe') format('woff'), url('fonts/osgl.svg?iylqbe#osgl') format('svg');font-weight:normal;font-style:normal;font-display:block}i{font-family:'osgl' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-wikipedia:before{content:"\e900"}.icon-ios:before{content:"\e901"}.icon-linux:before{content:"\e902";color:#fcc624}.icon-windows:before{content:"\e903";color:#0078d6}.icon-sourceforge:before{content:"\e904";color:#535353}.icon-bitbucket:before{content:"\e905";color:#0052cc}.icon-gitlab:before{content:"\e906";color:#fca121}.icon-pencil:before{content:"\e907"}.icon-dice:before{content:"\e915"}.icon-stats-dots:before{content:"\e99b"}.icon-sphere:before{content:"\e9c9"}.icon-new-tab:before{content:"\ea7e"}.icon-github:before{content:"\eab0"}.icon-appleinc:before{content:"\eabe"}

View File

@ -1,13 +1,11 @@
{% extends "base.jinja" %}
{% block content %}
<section class="hero is-light is-bold">
<section class="hero is-info 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>
<p class="subtitle">{{ macros.render_text(index['subtitle']) }}</p>
</div>
</div>
</section>

View File

@ -5,29 +5,29 @@
<h1 class="title">{{ listing['title'] }}</h1>
{# iterate over items -#}
{% for item in listing['items'] %}
<div class="box">
{# item header with anchor, name and link to contribute -#}
<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>
{# iterate over fields -#}
{% for field in item['fields'] %}
{% if field['type'] == 'text' %}
{{ macros.render_text(field) }}
{% elif field['type'] == 'enumeration' %}
{{ macros.render_enumeration(field) }}
{% elif field['type'] == 'linebreak' %}
{% else %}
{{ raise('Unknown field type.') }}
{% endif %}
<br>
{% endfor %}
</div>
<div class="box">
{# item header with anchor, name and link to contribute -#}
<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']) }}">Improve</a></p>
</div>
</nav>
{#- iterate over fields -#}
{% for field in item['fields'] %}
{% if field['type'] == 'text' %}
{{ macros.render_text(field) }}
{% elif field['type'] == 'enumeration' %}
{{ macros.render_enumeration(field) }}
{% elif field['type'] == 'linebreak' %}
{% else %}
{{ raise('Unknown field type.') }}
{% endif %}
<br>
{% endfor %}
</div>{#- of box -#}
{% endfor %}
<a class="is-light is-size-7" href="#">Back to top</a>
</div>

View File

@ -1,31 +1,40 @@
{# A single line of text with a line break at the end and optionally a format class. (see https://bulma.io/documentation/helpers/typography-helpers/) #}
{# A single piece of text optionally with a format class. (see https://bulma.io/documentation/helpers/typography-helpers/) #}
{%- macro render_text(text) -%}
{%- if 'class' in text -%} {# Enhanced text #}
<span class="{{ text['class'] }}">{{ text['text'] }}</span>
{%- else -%}
{{ text['text'] }}
<span>{{ text['text'] }}</span>
{%- endif -%}
{%- endmacro -%}
{# #}
{%- macro render_icon(icon) -%}
<span class="icon"><i class="icon-{{ icon['class'] }}"></i></span>
{%- endmacro -%}
{# Some text surrounded by a link tag #}
{%- macro render_url(url) -%}
<a href="{{ base['url_to'](url['href']) }}">{{ render_text(url['text']) }}</a>
<a href="{{ base['url_to'](url['href'], url) }}"{% if 'title' in url %} title="{{ url['title'] }}"{% endif %}>{{ render_element(url['content']) }}</a>
{%- endmacro -%}
{# Renders either plain text or a link depending on the type #}
{%- macro render_enumeration_entry(entry) -%}
{%- if entry['type'] == 'text' -%}
{%- macro render_element(entry) -%}
{%- if entry is string -%}
<span>{{ entry }}</span>
{%- elif entry['type'] == 'text' -%}
{{ render_text(entry) }}
{%- elif entry['type'] == 'icon' -%}
{{ render_icon(entry) }}
{%- elif entry['type'] == 'url' -%}
{{ render_url(entry) }}
{%- else -%}
{{ raise('Unknown entry type.') }}
{{ raise('Unknown entry type: {}.'.format(entry)) }}
{%- endif -%}
{%- endmacro -%}
{# Renders a list of enumeration entries (either links or text) #}
{%- macro render_enumeration(enumeration) -%}
{%- set comma = joiner(", ") -%}
{{ render_text(enumeration['name']) }}: {% for entry in enumeration['entries'] -%}{{ comma() }}{{ render_enumeration_entry(entry) }}{%- endfor -%}
{%- set divider = joiner(enumeration['divider']) -%}
{{ render_text(enumeration['name']) }}: {% for entry in enumeration['entries'] -%}{{ divider() }}{{ render_element(entry) }}{%- endfor -%}
{%- endmacro -%}