1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
---
import { getCollection } from "astro:content";
import Layout from "./Layout.astro";
const blogCollection = (await getCollection("blog")).sort((a, b) => {
return b.data.publishedAt.getTime() - a.data.publishedAt.getTime();
});
const schema = {
"@context": "http://schema.org",
"@type": "WebSite",
id: "https://www.costas.dev/",
url: "https://www.costas.dev/",
headline: "Ariel Costas - Desarrollador web",
};
---
<Layout title="Inicio" description="Página de inicio de mi web">
<script
is:inline
type="application/ld+json"
slot="head-jsonld"
set:html={JSON.stringify(schema)}
/>
<h1>Inicio</h1>
<div class="intro">
<p>
Te doy la bienvenida a mi web. Me llamo Ariel, y aquí encontrarás
información sobre mí y mis proyectos.
</p>
<p>
En mi blog comparto mis reflexiones, aprendizajes y experiencias sobre los
temas que me interesan, además de hablar ocasionalmente sobre tecnología y
desarrollo. Disfruto escribiendo sobre lo que aprendo y reflexiono, pudiendo
plasmar mis ideas de forma clara y ordenada, y compartiéndolas con el mundo.
</p>
</div>
<hr class="section-divider" />
<ul class="blog-list">
{
blogCollection.slice(0, 5).map((p) => {
const date = Intl.DateTimeFormat(Astro.currentLocale, {
day: "2-digit",
month: "short",
year: "numeric",
}).format(p.data.publishedAt);
return (
<li class="blog-item">
<time datetime={p.data.publishedAt.toISOString()}>{date}</time>
<a href={`/blog/${p.id}/`}>{p.data.title}</a>
</li>
);
})
}
</ul>
<a href="/blog" class="cta-button">Ver todas las entradas</a>
</Layout>
<style lang="scss">
@use "../../styles/variables" as *;
h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
}
.intro {
line-height: 1.7;
}
.section-divider {
border: none;
border-top: 1px solid rgba(0, 0, 0, 0.1);
margin: 2rem 0;
}
.blog-list {
list-style: none;
padding: 0;
margin: 0 0 2rem 0;
display: flex;
flex-direction: column;
gap: 1rem;
}
.blog-item {
background: $lightAlt;
padding: 1rem 1.25rem;
border-radius: 0.5rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
transition: box-shadow 0.2s ease;
&:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}
time {
display: block;
font-size: 0.875rem;
color: hsl(209, 20%, 50%);
margin-bottom: 0.25rem;
font-weight: 500;
}
a {
font-size: 1.125rem;
font-weight: 600;
text-decoration: none;
color: $accentDark;
box-shadow: none !important;
&:hover {
color: $accent;
box-shadow: none !important;
}
}
}
.cta-button {
display: inline-block;
padding: 0.75rem 1.5rem;
background: $accent;
color: white !important;
text-decoration: none;
border-radius: 0.5rem;
font-weight: 600;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
transition: all 0.2s ease;
&:hover {
background: $accentDark;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}
&:focus {
outline: 3px solid $secondary;
outline-offset: 2px;
background: $accentDark !important;
}
}
</style>
|