Skip to content

Commit 35c7803

Browse files
committed
feat: contributors view
1 parent dcc148f commit 35c7803

File tree

7 files changed

+165
-9
lines changed

7 files changed

+165
-9
lines changed

content/extra/contributors.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"id": 1234567,
4+
"username": "octocat",
5+
"profileUrl": "https://github.com/octocat",
6+
"avatarUrl": "https://avatars.githubusercontent.com/u/1234567?v=4"
7+
},
8+
{
9+
"id": 7654321,
10+
"username": "pythonista",
11+
"profileUrl": "https://github.com/pythonista",
12+
"avatarUrl": "https://avatars.githubusercontent.com/u/7654321?v=4"
13+
},
14+
{
15+
"id": 1234567,
16+
"username": "octocat",
17+
"profileUrl": "https://github.com/octocat",
18+
"avatarUrl": "https://avatars.githubusercontent.com/u/1234567?v=4"
19+
},
20+
{
21+
"id": 7654321,
22+
"username": "pythonista",
23+
"profileUrl": "https://github.com/pythonista",
24+
"avatarUrl": "https://avatars.githubusercontent.com/u/7654321?v=4"
25+
},
26+
{
27+
"id": 1234567,
28+
"username": "octocat",
29+
"profileUrl": "https://github.com/octocat",
30+
"avatarUrl": "https://avatars.githubusercontent.com/u/1234567?v=4"
31+
},
32+
{
33+
"id": 7654321,
34+
"username": "pythonista",
35+
"profileUrl": "https://github.com/pythonista",
36+
"avatarUrl": "https://avatars.githubusercontent.com/u/7654321?v=4"
37+
},
38+
{
39+
"id": 1234567,
40+
"username": "octocat",
41+
"profileUrl": "https://github.com/octocat",
42+
"avatarUrl": "https://avatars.githubusercontent.com/u/1234567?v=4"
43+
},
44+
{
45+
"id": 7654321,
46+
"username": "pythonista",
47+
"profileUrl": "https://github.com/pythonista",
48+
"avatarUrl": "https://avatars.githubusercontent.com/u/7654321?v=4"
49+
}
50+
]

pelicanconf.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@
2121
'img_path': '{static}/img'
2222
}
2323

24-
STATIC_PATHS = ['img', 'css']
24+
# Todos las carpetas con archivos estáticos dentro de content/
25+
STATIC_PATHS = [
26+
'img',
27+
'extra/contributors.json'
28+
]
2529

30+
# Carpeta donde se alojan los archivos para crear post. Pelican por defecto tiene basepath content/
2631
ARTICLE_PATHS = ['post']
2732

28-
# Configuración para paginación
33+
# Configuración para paginación dentro de theme/
2934
DEFAULT_PAGINATION = 9
3035
INDEX_SAVE_AS = 'index.html'
3136
PAGINATED_DIRECT_TEMPLATES = ['index']
3237

33-
# Configuración para resaltado de bloque de código
38+
# Configuración para resaltado de bloque de código dentro de archivos markdown
3439
MARKDOWN = {
3540
"extension_configs": {
3641
"markdown.extensions.fenced_code": {},
@@ -45,6 +50,15 @@
4550
"output_format": "html5",
4651
}
4752

53+
# Archivos que debe considerar JINJA2/Pelican para crear sitio estático dentro de theme/templates
54+
# Los cuales no son los por defectos
4855
TEMPLATE_PAGES = {
4956
"search.json": "search.json",
57+
"contributors.html": "contributors.html",
58+
"contact.html": "contact.html",
59+
}
60+
61+
# Map de paths archivos estáticos dentro de content/
62+
EXTRA_PATH_METADATA = {
63+
"extra/contributors.json": {"path": "contributors.json"}
5064
}

theme/static/css/style.css

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ body, html, root {
9292

9393
/* Mensaje de bienvenida */
9494

95-
.welcome-msg {
95+
.main-msg {
9696
text-align: center;
9797
align-items: center;
9898
margin: 3rem auto;
@@ -257,6 +257,9 @@ body, html, root {
257257

258258
/* footer */
259259
.footer-container {
260+
bottom: 0;
261+
left: 0;
262+
right: 0;
260263
background-color: #3674B5;
261264
padding: 1rem;
262265
border-top: 4px solid #000;
@@ -371,6 +374,50 @@ iframe {
371374
height: 35rem !important;
372375
}
373376

377+
/* perfiles github contribuidores*/
378+
.contribution-text {
379+
text-align: center;
380+
}
381+
382+
.contributors-container {
383+
display: flex;
384+
flex-wrap: wrap;
385+
gap: 1rem;
386+
justify-content: center;
387+
padding-bottom: 30%;
388+
margin: 2rem 0;
389+
}
390+
391+
.contributor {
392+
text-align: center;
393+
width: 120px;
394+
}
395+
396+
.contributor a {
397+
text-decoration: none;
398+
color: inherit;
399+
}
400+
401+
.contributor-avatar {
402+
width: 100px;
403+
height: 100px;
404+
border-radius: 50%;
405+
border: 3px solid #000;
406+
transition: all 0.2s ease-in-out;
407+
box-shadow: 0 0 0 #000;
408+
}
409+
410+
.contributor-avatar:hover {
411+
transform: translateY(-10px);
412+
box-shadow: 5px 5px 0 #000;
413+
z-index: 1;
414+
}
415+
416+
.contributor-name {
417+
margin-top: 0.5rem;
418+
font-weight: bold;
419+
}
420+
374421

375422
@media (max-width: 1300px) {
376423

@@ -414,7 +461,7 @@ iframe {
414461
font-size: 1rem;
415462
}
416463

417-
.welcome-msg-body {
464+
.main-body-msg {
418465
font-size: 0;
419466
}
420467

theme/templates/contact.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "base.html" %}
2+
{% block title %}Contacto — {{ SITENAME }}{% endblock %}
3+
4+
{% block content %}
5+
<h1>Contactos</h1>
6+
{% endblock %}

theme/templates/contributors.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}Contributors - {{ SITENAME }}{% endblock %}
4+
5+
{% block content %}
6+
<div class="main-msg">
7+
<h1>Contribuidores 🐍</h1>
8+
<div class="main-body-msg">
9+
Agradecimientos a cada Pythonista que ha contribuido al blog ❤️ <br>
10+
¡Cada aporte es una gran ayuda para que crezca la comunidad Python Chile!
11+
</div>
12+
</div>
13+
14+
<div class="contributors-container"></div>
15+
16+
<script>
17+
document.addEventListener("DOMContentLoaded", () => {
18+
fetch("{{ SITEURL }}/contributors.json")
19+
.then(response => response.json())
20+
.then(users => {
21+
const container = document.querySelector(".contributors-container");
22+
23+
users.forEach(user => {
24+
const div = document.createElement("div");
25+
div.className = "contributor";
26+
27+
div.innerHTML = `
28+
<a href="${user.profileUrl}" target="_blank">
29+
<img src="${user.avatarUrl}" alt="${user.username}" class="contributor-avatar">
30+
<div class="contributor-name">@${user.username}</div>
31+
</a>
32+
`;
33+
34+
container.appendChild(div);
35+
});
36+
});
37+
});
38+
</script>
39+
{% endblock %}

theme/templates/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
{% block content %}
66

7-
<div class="welcome-msg">
8-
<h1 class="welcome-msg-title">¡Hola Pythonista!</h1>
9-
<div class="welcome-msg-body">
7+
<div class="main-msg">
8+
<h1 class="main-title-msg">¡Hola Pythonista!</h1>
9+
<div class="main-body-msg">
1010
<p>¿Tienes un proyecto personal, una herramienta que descubriste, una librería que te llamó la atención o simplemente algo que quieras compartir? ¡Este es tu espacio!</p>
1111
<p>Temas como ciencia de datos, desarrollo web, automatización, videojuegos, inteligencia artificial, seguridad informática o cualquier otro que tenga relación con Python son totalmente bienvenidos 🚀</p>
1212
</div>

theme/templates/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ul class="navbar-menu">
1212
<li><a href="{{ PYTHON_CHILE_URL }}">Comunidad Python Chile</a></li>
13-
<li><a href="{{ SITEURL }}/contributions.html">Contribuidores</a></li>
13+
<li><a href="{{ SITEURL }}/contributors.html">Contribuidores</a></li>
1414
<li><a href="{{ SITEURL }}/contact.html">Contacto</a></li>
1515
</ul>
1616
</nav>

0 commit comments

Comments
 (0)