summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolas <nikolas@boutalas.com>2024-10-28 18:16:08 +0200
committerNikolas <nikolas@boutalas.com>2024-10-28 18:16:08 +0200
commit9d114262053fe91bca8077773ed5908e1d9e8696 (patch)
tree594023552c4e479f3f3fb94dba9b0b3b2c5628ac
parentd327a8f7e51ac3e6be95f7a7b9204343c9553899 (diff)
index: add photos section
-rw-r--r--content/photos/_index.md9
-rw-r--r--templates/index.html9
-rw-r--r--templates/photos-page.html4
-rw-r--r--templates/photos.html19
4 files changed, 40 insertions, 1 deletions
diff --git a/content/photos/_index.md b/content/photos/_index.md
new file mode 100644
index 0000000..6e5f617
--- /dev/null
+++ b/content/photos/_index.md
@@ -0,0 +1,9 @@
++++
+title="Photos"
+sort_by = "date"
+template = "photos.html"
+page_template = "photos-page.html"
+paginate_by = 2
++++
+
+I recently decided to dive into the exciting world of photography and picked up a used camera. If I like any of the photos I take, I will consider uploading them here.
diff --git a/templates/index.html b/templates/index.html
index 8540d29..b6d794c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,10 +1,17 @@
{% extends "base.html" %} {% block body %}
<h1>Archive</h1>
<p>Opinions are (hopefully) my own.</p>
+
{% set notes_section = get_section(path="notes/_index.md") %}
<h2>{{notes_section.title}}</h2>
{{ notes_section.content | safe}}
-<a href="{{ notes_section.permalink | safe }}">Read More</a>
+<a href="{{ notes_section.permalink | safe }}">Read more</a>
+
+{% set photos_section = get_section(path="photos/_index.md") %}
+<h2>{{photos_section.title}}</h2>
+{{ photos_section.content | safe}}
+<a href="{{ photos_section.permalink | safe }}">Check them out</a>
+
<h2>Links</h2>
<ul>
<li><a href="https://git.boutalas.com">Repositories</a></li>
diff --git a/templates/photos-page.html b/templates/photos-page.html
new file mode 100644
index 0000000..53f8b5c
--- /dev/null
+++ b/templates/photos-page.html
@@ -0,0 +1,4 @@
+{% extends "base.html" %} {% block body %}
+<h1>{{page.extra.caption}}</h1>
+<img alt="{{page.extra.caption}}" src="{{ page.extra.file_name }}" />
+{{ page.content | safe }} {% endblock body %}
diff --git a/templates/photos.html b/templates/photos.html
new file mode 100644
index 0000000..8c55339
--- /dev/null
+++ b/templates/photos.html
@@ -0,0 +1,19 @@
+{% extends "base.html" %} {% block body %}
+<h1>{{ section.title }}</h1>
+{% for page in paginator.pages %}
+<figure>
+ <a {% if page.content %} href="{{ page.permalink }}" {% endif %}>
+ <img
+ alt="{{page.extra.caption}}"
+ src="{{ page.permalink }}/{{ page.extra.file_name }}"
+ />
+ </a>
+ <figcaption>{{page.extra.caption}}</figcaption>
+</figure>
+{% endfor %} {% if paginator.previous or paginator.next%}
+<div class="row">
+ <a class="center" href="{{ paginator.previous }}">Previous</a>
+ <span class="center">{{ paginator.current_index }}</span>
+ <a class="center" href="{{ paginator.next }}">Next</a>
+</div>
+{% endif %} {% endblock body %}