diff --git a/content/projekty/_index.md b/content/projekty/_index.md index 2fea8ac..650a023 100644 --- a/content/projekty/_index.md +++ b/content/projekty/_index.md @@ -1,3 +1,4 @@ +++ title = "Projekty" +template = "projects.html" +++ diff --git a/content/projekty/project-0.md b/content/projekty/project-0.md new file mode 100644 index 0000000..6ec5d68 --- /dev/null +++ b/content/projekty/project-0.md @@ -0,0 +1,4 @@ ++++ +title = "Project 0" +description = "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat." ++++ diff --git a/content/projekty/project-1.md b/content/projekty/project-1.md new file mode 100644 index 0000000..0b04070 --- /dev/null +++ b/content/projekty/project-1.md @@ -0,0 +1,3 @@ ++++ +title = "Project 1" ++++ diff --git a/sass/style.scss b/sass/style.scss index 7c536c0..95f42d6 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -155,3 +155,45 @@ body>footer { padding: 1rem 0; } } + +.project-list { + display: grid; + grid-template-columns: 1fr; + gap: 1rem; + background: none; + padding: 0; + + @media only screen and (min-width: $width-narrow) { + grid-template-columns: 1fr 1fr; + } + + &>a { + display: flex; + min-height: 10rem; + background: $col-dark; + color: inherit; + + .title { + font-weight: bold; + font-size: 1.5em; + margin-bottom: .5em; + line-height: 1; + } + + .description { + padding: 1.5em 1em; + width: 100%; + + p { + margin: 0; + line-height: 1.5; + } + } + + .image { + display: block; + height: 100%; + width: 12rem; + } + } +} diff --git a/static/img/project_placeholder.png b/static/img/project_placeholder.png new file mode 100644 index 0000000..a041c6c Binary files /dev/null and b/static/img/project_placeholder.png differ diff --git a/templates/base.html b/templates/base.html index 422c897..7e71e47 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,3 +1,5 @@ +{% import "macros.html" as macros %} + diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..a0604af --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,25 @@ +{% macro project_list() %} + {% for project in section.pages %} + + {% 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") %} +
+
+
{{ project.title }}
+

+ {% if project.description %} + {{ project.description }} + {% else %} + … + {% endif %} +

+
+
+ {% endfor %} +{% endmacro %} diff --git a/templates/projects.html b/templates/projects.html new file mode 100644 index 0000000..58a919e --- /dev/null +++ b/templates/projects.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block content %} +
+ {{ macros::project_list() }} +
+{% endblock content %}