Commit d4b4b465 authored by Deimos's avatar Deimos

Redo CSS/HTML to use main site CSS/themes

This redoes the HTML and CSS of the Docs and Blog sites so that it uses
the main site's stylesheet instead of having its own separate one. This
also allows the theme set on the main site to transfer over to the Docs
and Blog. Note that there is currently no method of switching theme
here, but if you do it on the main site it will be able to be in effect
here as well.
parent 429602cf
This diff is collapsed.
// Copyright (c) 2019 Tildes contributors <code@tildes.net>
// SPDX-License-Identifier: AGPL-3.0-or-later
function getCookie(cookieName) {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookiePieces = cookies[i].split("=");
if (cookieName === cookiePieces[0]) {
return cookiePieces[1];
}
}
return null;
}
window.onload = function() {
var theme = getCookie("theme");
if (theme) {
document.body.classList.add("theme-"+theme);
}
}
......@@ -13,13 +13,13 @@
{% block title %}{{ article.title }}{% endblock %}
{% block header %}
<a href="https://{{ DOMAIN }}">Tildes Blog</a>
<a class="site-header-logo" href="https://{{ DOMAIN }}">Tildes Blog</a>
{% endblock header %}
{% block content %}
<h1>{{ article.title }}</h1>
<div class="date-info">
<div class="date-info text-secondary text-small">
Posted on {{ article.locale_date }} by {{ article.author }}
{% if article.modified %}
<br>Last edited on {{ article.locale_modified }}
......
......@@ -7,6 +7,7 @@
<meta property="og:image" content="{{ SITEURL }}/theme/images/favicon-144x144.png">
{% block meta_og_tags %}{% endblock %}
<link rel="stylesheet" type="text/css" href="https://tildes.net/css/tildes.css">
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/styles.css">
<link rel="icon" type="image/png" href="{{ SITEURL }}/theme/images/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="{{ SITEURL }}/theme/images/favicon-32x32.png" sizes="32x32">
......@@ -14,8 +15,8 @@
<title>{% block title %}{% endblock %}</title>
</head>
<body>
<header>
<body class="static-site">
<header id="site-header">
{% block header %}{% endblock %}
</header>
......@@ -23,16 +24,18 @@
{% block content %}{% endblock %}
</main>
<nav id="page-list">
<aside id="sidebar">
{% block pagelist %}{% endblock %}
</nav>
</aside>
<footer>
<ul class="site-footer">
<li class="site-footer-item"><a href="https://tildes.net">Tildes</a></li>
<li class="site-footer-item"><a href="https://blog.tildes.net">Blog</a></li>
<li class="site-footer-item"><a href="https://docs.tildes.net">Docs</a></li>
<footer id="site-footer">
<ul class="site-footer-links">
<li class="site-footer-link"><a href="https://tildes.net">Tildes</a></li>
<li class="site-footer-link"><a href="https://blog.tildes.net">Blog</a></li>
<li class="site-footer-link"><a href="https://docs.tildes.net">Docs</a></li>
</ul>
</footer>
<script src="{{ SITEURL }}/theme/js/tildes-static-sites.js"></script>
</body>
</html>
......@@ -5,7 +5,7 @@
{% block title %}Donate to Tildes via Stripe{% endblock %}
{% block header %}
<a href="https://{{ DOMAIN }}">Tildes Docs</a>
<a class="site-header-logo" href="https://{{ DOMAIN }}">Tildes Docs</a>
{% endblock header %}
{% block content %}
......
......@@ -3,7 +3,7 @@
{% set DOMAIN = 'blog.tildes.net' %}
{% block header %}
<a href="https://{{ DOMAIN }}">Tildes Blog</a>
<a class="site-header-logo" href="https://{{ DOMAIN }}">Tildes Blog</a>
{% endblock header %}
{% block title %}Tildes Blog{% endblock %}
......@@ -14,7 +14,7 @@
{% for article in articles %}
<article class="article-summary">
<h2><a href="{{ article.url }}">{{ article.title }}</a></h2>
<div class="date-info">
<div class="text-secondary text-small">
Posted on {{ article.locale_date }} by {{ article.author }}
</div>
<p>{{ article.summary }}</p>
......
......@@ -13,14 +13,14 @@
{% block title %}{{ page.title }}{% endblock %}
{% block header %}
<a href="https://{{ DOMAIN }}">Tildes Docs</a>
<a class="site-header-logo" href="https://{{ DOMAIN }}">Tildes Docs</a>
{% endblock header %}
{% block content %}
<h1>{{ page.title }}</h1>
{% if page.modified %}
<div class="date-info">
<div class="date-info text-secondary text-small">
Page last updated: {{ page.locale_modified }}
(<a href="{{ GITLAB_HISTORY_BASE_URL ~ page.get_relative_source_path() }}">view history</a>)
</div>
......
......@@ -3,7 +3,7 @@
{% set DOMAIN = 'docs.tildes.net' %}
{% block header %}
<a href="https://{{ DOMAIN }}">Tildes Docs</a>
<a class="site-header-logo" href="https://{{ DOMAIN }}">Tildes Docs</a>
{% endblock header %}
{% block title %}Tildes Docs{% endblock %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment