Skip to content

Commit d4d92cb

Browse files
committed
added better blog page
1 parent 5d01256 commit d4d92cb

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

Diff for: content/blogs/testblog.md renamed to content/blogs/testblog 1.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = "Test Blog"
2+
title = "Example blog post with a very huge title that is very long and will be truncated in the index page."
33
date = 2024-11-08
44
description = "A simple test blog."
55
[taxonomies]

Diff for: content/blogs/testblog copy.md renamed to content/blogs/testblog 2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = "Test Blog"
2+
title = "Example blog post"
33
date = 2024-11-08
44
description = "A simple test blog."
55
[taxonomies]

Diff for: static/css/styles.css

+31
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,37 @@ article {
102102
width: 100%;
103103
}
104104

105+
/* Blog-specific styling */
106+
.blog-post {
107+
padding: 2rem;
108+
width: 60%;
109+
text-align: left;
110+
}
111+
112+
.blog-post-left {
113+
display: inline-block;
114+
font-size: 1.25rem;
115+
}
116+
.blog-post-left:hover {
117+
color: #fff;
118+
}
119+
.blog-post-left p {
120+
margin-top: 1rem;
121+
font-size: 1.1rem;
122+
opacity: 0.85rem;
123+
}
124+
125+
.blog-post-right {
126+
opacity: 0.5;
127+
padding-top: 1rem;
128+
float: right;
129+
font-size: 0.85rem;
130+
}
131+
.blog-post-right i,
132+
.blog-post-left i {
133+
margin-right: 5px;
134+
}
135+
105136
/* Media queries */
106137
@media (min-width: 1025px) {
107138
.container {

Diff for: templates/blogs.html

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
{% extends "base.html" %} {% block content %}
22

33
<center>
4-
<h1>Latest Blogs</h1>
4+
<h1><i class="fa-solid fa-mug-hot"></i> Latest <u>Blogs</u></h1>
5+
<hr />
6+
57
{% if paginator.pages|length == 0 %} no blogs! {%else%} {% for page in
68
paginator.pages %}
79

8-
<a href="{{ page.permalink | safe }}">{{ page.title }}</a> on {{ page.date |
9-
date(format="%b %d, %Y") }} <br />
10-
<!-- {# COMMENT: find all attributes from https://www.getzola.org/documentation/content/page/ #} -->
10+
<div class="blog-post">
11+
<div class="blog-post-left pico-color-sand-500">
12+
<a href="{{ page.permalink | safe }}"> {{ page.title }} </a>
13+
<p>{{ page.description }}</p>
14+
</div>
15+
<div class="blog-post-right">
16+
<i class="fa-solid fa-hourglass-half"></i> {{ page.date |
17+
date(format="%b %d, %Y") }}
18+
</div>
19+
</div>
20+
1121
{% endfor %} {% endif %} {% endblock content %}
1222
</center>

0 commit comments

Comments
 (0)