Skip to content

Commit 2b264af

Browse files
committed
paxinación de novas
1 parent 891686b commit 2b264af

31 files changed

+121
-42
lines changed

_includes/layouts/news_list.vto

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
---
22
layout: layouts/base.vto
33
---
4-
{{ set allNews = search.pages("type=news lang=" + lang, "date=desc") }}
54

6-
{{ for news of allNews }}
7-
{{ include "templates/news-list.vto" { news } }}
8-
{{ /for }}
5+
<header class="header">
6+
<h1 class="header-title">{{ title }}</h1>
7+
8+
<div class="header-filter ly-tags">
9+
{{ for tag of search.values("tags", "type=news lang=" + lang).sort() }}
10+
<span class="filter">{{ tag }}</span>
11+
{{ /for }}
12+
</div>
13+
</header>
14+
15+
<div class="ly-list news-list top-m-xl">
16+
{{ for news of results }}
17+
{{ include "templates/news-list.vto" { news } }}
18+
{{ /for }}
19+
</div>
20+
21+
<nav class="pagination">
22+
{{ set prev = pagination.previous }}
23+
{{ set next = pagination.next }}
24+
25+
{{ if prev }}
26+
<a href="{{ prev }}">Páxina anterior</a>
27+
{{ /if }}
28+
{{ if next }}
29+
<a href="{{ next }}">Páxina seguinte</a>
30+
{{ /if }}
31+
</nav>

_includes/styles/components/filter.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
border: solid 1px var(--border);
1414
cursor: pointer;
1515
font-size: var(--size-1);
16+
text-decoration: none;
1617

1718
&.is-small {
1819
font-size: var(--size-0);

_includes/styles/components/header.css

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
position: absolute;
6363
right: 0;
6464
top: min(50%, var(--img-height) / 2);
65-
transform: rotate(3deg) translate(2rem, -50%);
65+
transform: rotate(3deg) translateY(-50%);
6666
filter: drop-shadow(
6767
-20px
6868
30px
@@ -73,16 +73,5 @@
7373
@media (width > 1600px) {
7474
right: -5vw;
7575
}
76-
77-
+ :where(.header-img.is-floating) {
78-
transform: rotate(6deg) translate(6rem, -45%);
79-
80-
+ :where(.header-img.is-floating) {
81-
transform: rotate(9deg) translate(10rem, -40%);
82-
}
83-
}
84-
&:hover {
85-
z-index: 1;
86-
}
8776
}
8877
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.news-list {
2+
.news {
3+
display: grid;
4+
grid-column: content;
5+
grid-template-columns: subgrid;
6+
align-items: baseline;
7+
border-bottom: solid 1px;
8+
padding-bottom: var(--row-gap);
9+
}
10+
11+
.news-header {
12+
grid-column: center-start / content-end;
13+
display: flex;
14+
flex-wrap: wrap;
15+
align-items: center;
16+
column-gap: var(--space-xs);
17+
row-gap: var(--space-2xs);
18+
}
19+
20+
.news-title {
21+
font-size: var(--size-4);
22+
letter-spacing: var(--size-4-spacing);
23+
margin: 0;
24+
25+
a {
26+
text-decoration: none;
27+
}
28+
}
29+
30+
.news-time {
31+
grid-column: content-start;
32+
text-align: right;
33+
}
34+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.pagination {
2+
grid-column: center;
3+
}

_includes/styles/layouts/list.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.ly-list {
2+
--row-gap: var(--space-xs);
3+
4+
grid-column: content;
5+
display: grid;
6+
grid-template-columns: subgrid;
7+
row-gap: var(--row-gap);
8+
}

_includes/styles/layouts/main.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
[content-end] 1fr
1010
[full-end];
1111
grid-template-areas:
12-
". logo menu menu . ."
13-
"main main main main main main"
14-
". . footer footer footer .";
12+
". logo menu menu ."
13+
"main main main main main"
14+
". . footer footer .";
1515
justify-content: center;
1616
align-items: start;
1717
align-content: start;
1818
gap: var(--space-m-xl);
1919
margin-block: var(--space-m-xl);
2020
position: relative;
21+
overflow-x: hidden;
2122
}
2223

2324
.ly-main-logo {

_includes/templates/navbar.vto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ menu:
55
- members
66
- portfolio
77
- asociate
8-
- news
8+
- news-1
99
- articles
1010
- projects
1111
languages:

_includes/templates/news-list.vto

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<article>
2-
<header>
3-
<nav>
4-
{{ for tag of news.tags }}
5-
<a href="/tags/{{ tag }}">{{ tag }}</a>
6-
{{ /for }}
7-
</nav>
8-
9-
<time datetime='{{ news.date |> date("DATETIME") }}'>
10-
{{ news.date |> date("HUMAN_DATE") }}
11-
</time>
1+
<article class="news">
2+
<time datetime='{{ news.date |> date("DATETIME") }}' class="news-time">
3+
{{ news.date |> date("HUMAN_DATE") }}
4+
</time>
125

13-
<h1>
6+
<header class="news-header">
7+
<h1 class="news-title">
148
<a href="{{ news.url }}">{{ news.title }}</a>
159
</h1>
10+
11+
<nav class="news-tags ly-tags">
12+
{{ for tag of news.tags }}
13+
<a class="filter is-small" href="/tags/{{ tag }}">{{ tag }}</a>
14+
{{ /for }}
15+
</nav>
1616
</header>
1717
</article>

0 commit comments

Comments
 (0)