Browse Source

fix the comic thing

refactoring
Nico Schottelius 2 years ago
parent
commit
b3929b1d31
  1. 2
      content/u/penguincomics/contents.lr
  2. 8
      content/u/penguincomics/somethingelse/contents.lr
  3. BIN
      content/u/penguincomics/somethingelse/ipv6_header-only-inside-sketch.jpg
  4. 1
      templates/comic.html
  5. 40
      templates/comics.html
  6. 36
      templates/macros/comic.html
  7. 48
      templates/macros/pagination.html
  8. 1
      templates/product.html

2
content/u/penguincomics/contents.lr

@ -1,3 +1,3 @@
_model: comics
---
title: ungleich penguin comics
title: Penguin Comics

8
content/u/penguincomics/somethingelse/contents.lr

@ -0,0 +1,8 @@
subtitle: NOT THE Security Policy
---
pub_date: 2020-02-04
---
_hidden: no
---
_discoverable: yes
---

BIN
content/u/penguincomics/somethingelse/ipv6_header-only-inside-sketch.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

1
templates/comic.html

@ -5,7 +5,6 @@
{% block content %}
{% set image = this.attachments.images.first() %}
<div class="container">
<div class="row mb-5">
<div class="col-md-3">

40
templates/comics.html

@ -1,33 +1,13 @@
{% extends "layout-2020.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/pagination.html" import render_pagination %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
<header class="intro-header" style="background-image: url('/u/static/images/home-bg.jpg');">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>ungleich blog</h1>
<hr class="small">
<span class="subheading"></span>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="app app-blog span8">
<section class="blog-list">
{% for child in this.pagination.items %}
{{ render_blog_post(child, from_index=true) }}
{% endfor %}
{{ render_pagination(this.pagination) }}
</section>
</div>
</div>
</div>
</div>
{% from "macros/comic.html" import render_comic %}
{% block title %}Penguin Comics{% endblock %}
{% block content %}
{% for child in this.pagination.items %}
{{ render_comic(child) }}
{% endfor %}
{{ render_pagination(this.pagination) }}
{% endblock %}

36
templates/macros/comic.html

@ -0,0 +1,36 @@
{% macro render_comic(comic) %}
{% set image = comic.attachments.images.first() %}
<div class="container">
<div class="row mb-5">
<div class="col-md-3">
<!-- unused for centering -->
</div>
<div class="col-md-6">
<h2>{{ comic.subtitle }}</h2>
<img src="{{ image|url }}" alt="{{ comic.subtitle }}"
class="img-fluid"/>
</div>
<div class="col-md-3">
<!-- unused for centering -->
</div>
</div>
</div>
{% if comic.body %}
<div class="container">
<div class="row mb-3">
<div class="col-md-3">
<!-- unused for centering -->
</div>
<div class="col-md-6">
{{ comic.body }}
</div>
<div class="col-md-3">
<!-- unused for centering -->
</div>
</div>
</div>
{% endif %}
{% endmacro %}

48
templates/macros/pagination.html

@ -1,26 +1,34 @@
{% macro render_pagination(pagination) %}
<div class="ungleich-center-div">
<div class="pagination">
{% if pagination.has_prev %}
<a href="{{ pagination.prev|url }}">&laquo; Previous</a>
{% else %}
<span class="disabled">&laquo; Previous</span>
{% endif %} |
{% for page in range(1, pagination.pages + 1) %}
{% if page != pagination.page %}
<a href="{{ pagination.for_page(page)|url }}">{{ page }}</a> |
{% else %}
{{ pagination.page }} |
{% endif %}
{% endfor %}
<div class="container">
<div class="row mb-5">
<div class="col-md-3">
<!-- unused for centering -->
</div>
<div class="col-md-6">
{% if pagination.has_prev %}
<a href="{{ pagination.prev|url }}">&laquo; Previous</a>
{% else %}
&laquo; Previous
{% endif %}
|
{% for page in range(1, pagination.pages + 1) %}
{% if page != pagination.page %}
<a href="{{ pagination.for_page(page)|url }}">{{ page }}</a> |
{% else %}
{{ pagination.page }} |
{% endif %}
{% if pagination.has_next %}
<a href="{{ pagination.next|url }}">Next &raquo;</a>
{% else %}
<span class="disabled">Next &raquo;</span>
{% endif %}
{% endfor %}
{% if pagination.has_next %}
<a href="{{ pagination.next|url }}">Next &raquo;</a>
{% else %}
Next &raquo;
{% endif %}
</div>
<div class="col-md-3">
<!-- unused for centering -->
</div>
</div>
</div>
{% endmacro %}

1
templates/product.html

@ -28,6 +28,7 @@
</div>
</div>
</div>
x-off
{% if this.description2 %}
<div class="container">
<div class="row mb-3">

Loading…
Cancel
Save