Skip to content

Commit 9761dbb

Browse files
committed
feat: tags style
1 parent a9eb5e0 commit 9761dbb

File tree

4 files changed

+46
-27
lines changed

4 files changed

+46
-27
lines changed

theme/static/css/style.css

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ body, html, root {
8585
}
8686

8787
.navbar-menu a:hover {
88-
background-color: #000;
88+
background-color: #E22914;
8989
color: #f8f1ee;
9090
}
9191

@@ -178,16 +178,21 @@ body, html, root {
178178
}
179179

180180
.preview-date {
181+
font-style: italic;
181182
display: flex;
182-
justify-content: end;
183-
margin-right: 1rem;
183+
position: absolute;
184+
bottom: 16%;
185+
justify-content: start;
186+
margin-left: 1rem;
184187
}
185188

186189
.preview-author {
187190
font-style: italic;
188191
display: flex;
189-
justify-content: end;
190-
margin-right: 1rem;
192+
position: absolute;
193+
bottom: 12%;
194+
justify-content: start;
195+
margin-left: 1rem;
191196
font-size: 90%;
192197
}
193198

@@ -207,7 +212,15 @@ body, html, root {
207212
background-color: #f8f1ee;
208213
border-radius: 5px;
209214
padding: 2px;
210-
border: 2px solid #000
215+
border: 2px solid #000;
216+
text-decoration: none;
217+
color: black;
218+
transition: all 0.2s ease-in-out;
219+
}
220+
221+
.preview-tag:hover {
222+
background-color: #578FCA;
223+
color: #f8f1ee;
211224
}
212225

213226
/* Paginación */
@@ -229,6 +242,7 @@ body, html, root {
229242
position: relative;
230243
transition: all 0.2s ease-in-out;
231244
box-shadow: 0 0 0 #000;
245+
color: black;
232246
}
233247

234248
.pagination a:hover {
@@ -255,6 +269,11 @@ body, html, root {
255269
padding: 1rem;
256270
}
257271

272+
.post a {
273+
text-decoration: none;
274+
color: black;
275+
}
276+
258277
/* imágenes que están en el contenido del post */
259278
.post-img {
260279
margin: 1rem auto !important;

theme/templates/article.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33

44
{% block content %}
55
<article class="post">
6-
<div class="meta">Por {{ article.author }} — {{ article.date.strftime('%Y-%m-%d') }}</div>
7-
<h2>{{ article.title }}</h2>
8-
<h3>{{ article.summary }}</h3>
9-
<div>Tags:
10-
{% for tag in article.tags %}
11-
<a href="{{ SITEURL }}/tag/{{ tag.slug }}.html">{{ tag.name }}</a>{% if not loop.last %}, {% endif %}
12-
{% endfor %}
13-
</div>
14-
<div class="content">
6+
<div>🗓️ {{ article.date.strftime('%Y-%m-%d') }}</div>
7+
<div>✏️ {{ article.author }}</div>
8+
<h2>{{ article.title }}</h2>
9+
<h3>{{ article.summary }}</h3>
10+
<div>Tags:
11+
{% for tag in article.tags %}
12+
<a href="{{ SITEURL }}/tag/{{ tag.slug }}.html">{{ tag.name }}</a>{% if not loop.last %}, {% endif %}
13+
{% endfor %}
14+
</div>
15+
<div class="content">
1516
{{ article.content }}
16-
</div>
17+
</div>
1718
</article>
1819
{% endblock %}

theme/templates/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@
7979
li.innerHTML = `
8080
<a class="preview-link" href="${article.url}">
8181
<img class="preview-img" src="${article.image || '{{ SITEURL }}/img/otros/default.webp'}" alt="">
82-
<div class="preview-title">${article.title}</div>
83-
<div class="preview-summary">${article.summary || ""}</div>
84-
<div class="preview-date">${article.date || ""}</div>
85-
<div class="preview-author">${article.author ? "Por " + article.author : ""}</div>
8682
</a>
83+
<div class="preview-title">${article.title}</div>
84+
<div class="preview-summary">${article.summary || ""}</div>
85+
<div class="preview-date">🗓️ ${article.date.split(' ')[0] || ""}</div>
86+
<div class="preview-author">✏️ ${article.author ? "Por " + article.author : ""}</div>
8787
<div class="preview-tags-container">
88-
${(article.tags || []).map(tag => `<div class="preview-tag">${tag}</div>`).join("")}
88+
${(article.tags || []).map(tag => `<a class="preview-tag" href="{{ SITEURL }}/tag/${tag}.html">${tag}</a>`).join("")}
8989
</div>
9090
`;
9191
previewContainer.appendChild(li);

theme/templates/index.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ <h1 class="welcome-msg-title">¡Hola Pythonista!</h1>
2121
<li class="preview-post">
2222
<a class="preview-link" href="{{ SITEURL }}/{{ article.url }}">
2323
<img class="preview-img" src="{{ SITEURL }}/{{ article.image }}" alt="">
24-
<div class="preview-title">{{ article.title }}</div>
25-
<div class="preview-summary">{{ article.summary }}</div>
26-
<div class="preview-date">{{ article.date.strftime('%Y-%m-%d') }}</div>
27-
<div class="preview-author">Por {{ article.author }}</div>
2824
</a>
25+
<div class="preview-title">{{ article.title }}</div>
26+
<div class="preview-summary">{{ article.summary }}</div>
27+
<div class="preview-date">🗓️ {{ article.date.strftime('%Y-%m-%d') }}</div>
28+
<div class="preview-author">✏️ {{ article.author }}</div>
2929
<div class="preview-tags-container">
3030
{% for tag in article.tags %}
31-
<div class="preview-tag"> {{ tag.name }} </div>
31+
<a class="preview-tag" href="{{ SITEURL }}/tag/{{ tag.slug }}.html">{{ tag.name }}</a>
3232
{% endfor %}
3333
</div>
3434
</li>
@@ -39,7 +39,6 @@ <h1 class="welcome-msg-title">¡Hola Pythonista!</h1>
3939
{% if articles_page.has_previous() %}
4040
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}">Previous</a>
4141
{% endif %}
42-
4342
{% if articles_page.has_next() %}
4443
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">Next</a>
4544
{% endif %}

0 commit comments

Comments
 (0)