Add macros & project listing
parent
7ffad10601
commit
ffe6e62ced
@ -1,3 +1,4 @@
|
||||
+++
|
||||
title = "Projekty"
|
||||
template = "projects.html"
|
||||
+++
|
||||
|
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Project 0"
|
||||
description = "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat."
|
||||
+++
|
@ -0,0 +1,3 @@
|
||||
+++
|
||||
title = "Project 1"
|
||||
+++
|
Binary file not shown.
After Width: | Height: | Size: 69 B |
@ -0,0 +1,25 @@
|
||||
{% macro project_list() %}
|
||||
{% for project in section.pages %}
|
||||
<a href="{{ project.permalink }}">
|
||||
{% set_global image = "/static/img/project_placeholder.png" %}
|
||||
{% for asset in project.assets %}
|
||||
{% if asset is matching("[img.](jpg|png)$") %}
|
||||
{% set_global image = asset %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set image = resize_image(path=image, width=300, height=300, op="fill") %}
|
||||
<div class="image" style="background-image: url('{{ image.url }}')"></div>
|
||||
<div class="description">
|
||||
<div class="title">{{ project.title }}</div>
|
||||
<p>
|
||||
{% if project.description %}
|
||||
{{ project.description }}
|
||||
{% else %}
|
||||
…
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="project-list">
|
||||
{{ macros::project_list() }}
|
||||
</section>
|
||||
{% endblock content %}
|
Loading…
Reference in New Issue