Browse Source

Fixed a bunch of things on Hyde, by extending inside the blog itself

master
Julio Biason 3 years ago
parent
commit
75c413f5cf
  1. 6
      config.toml
  2. 93
      templates/index.html
  3. 7
      templates/macros.html
  4. 13
      templates/page.html

6
config.toml

@ -49,5 +49,11 @@ menu_items = [
{url = "$BASE_URL/quotes", name = "Quotes"},
{url = "$BASE_URL/research", name = "Research Notes"},
]
hyde_links = [
{url = "$BASE_URL", name = "English"},
{url = "$BASE_URL/pt", name = "Português"},
{url = "$BASE_URL/tags", name = "Tags (EN)"},
{url = "$BASE_URL/pt/tags", name = "Tags (PT)"},
]
after_dark_title = "JulioBiason.Net 4.1"
enable_post_view_navigation = false

93
templates/index.html

@ -0,0 +1,93 @@
{% import "macros.html" as macros -%}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<!-- viewport-fit=cover is to support iPhone X rounded corners and notch in landscape-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<!-- CSS -->
<link rel="stylesheet" href="{{ get_url(path="print.css", trailing_slash=false) }}" media="print">
<link rel="stylesheet" href="{{ get_url(path="poole.css", trailing_slash=false) }}">
<link rel="stylesheet" href="{{ get_url(path="hyde.css", trailing_slash=false) }}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
{% if config.generate_feed %}
<link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{% endif %}
{% block extra_head %}
{% endblock extra_head %}
</head>
<body class="{{ config.extra.hyde_theme }} {% if config.extra.hyde_reverse %}layout-reverse{% endif %}">
{% block sidebar %}
<div class="sidebar">
<div class="container {% if config.extra.hyde_sticky %}sidebar-sticky{% endif %}">
<div class="sidebar-about">
{% block sidebar_about %}
<a href="{{ config.base_url }}"><h1>{{ config.title }}</h1></a>
{% if config.description %}
<p class="lead">{{config.description}}</p>
{% endif %}
{% endblock sidebar_about %}
</div>
<ul class="sidebar-nav">
{% block sidebar_nav %}
{% for link in config.extra.hyde_links %}
<li class="sidebar-nav-item"><a href="{{link.url}}">{{link.name}}</a></li>
{% endfor %}
{% endblock sidebar_nav %}
</ul>
</div>
</div>
{% endblock sidebar %}
<div class="content container">
{% block content %}
<div class="posts">
{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{%- set show_pages = section.pages -%}
{% endif -%}
{% for page in show_pages %}
<div class="post">
<h1 class="post-title">
<a href="{{ page.permalink }}">
{{ page.title }}
</a>
</h1>
<div class="post-meta">
<span class="post-date">
{{ page.date | date(format="%Y-%m-%d") }}
{{ macros::tags(page=page) }}
</span>
</div>
{%- if page.summary %}
<div class="post-summary">
{{ page.summary | safe }}
</div>
<a href="{{ page.permalink | safe }}">
Read more...
</a>
{% endif -%}
</div>
{% endfor %}
</div>
{% endblock content %}
</div>
</body>
</html>

7
templates/macros.html

@ -0,0 +1,7 @@
{% macro tags(page) %}
{%- if page.taxonomies and page.taxonomies.tags %}
{%- for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind='tags', lang=page.lang, name=tag) | safe }}">#{{ tag }}</a>
{% endfor -%}
{% endif -%}
{% endmacro tags %}

13
templates/page.html

@ -0,0 +1,13 @@
{% extends "index.html" %}
{% block content %}
<div class="post">
<h1 class="post-title">{{ page.title }}</h1>
<span class="post-date">
{{ page.date | date(format="%Y-%m-%d") }}
{{ macros::tags(page=page) }}
</span>
{{ page.content | safe }}
</div>
{% endblock content %}
Loading…
Cancel
Save