Skip to content

Commit a101d70

Browse files
committed
feat: contact view
1 parent 0b7de69 commit a101d70

File tree

9 files changed

+112
-43
lines changed

9 files changed

+112
-43
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Considerar los siguientes puntos para la revisión:
216216
Si es el primer aporte por favor considerar agregar algunos datos del perfil de github para poder mostrarlo junto al resto
217217
de contribuidores
218218

219-
En archivo `content/extra/contributors.json` agregar los siguientes valores llave-valor siguiendo formato **json**:
219+
En archivo `contributors.py` agregar los siguientes valores llave-valor siguiendo formato **json**:
220220

221221
- **id**: número positivo incremental (tipo **int**)
222222
- **username**: nombre usuario de github (tipo **string**)
@@ -240,7 +240,7 @@ Por ejemplo
240240
# 8. ✅ Buenas Prácticas
241241

242242
- Texto con coherencia, buena ortografía y ordenada.
243-
- Usar ejemplos, códigos u diagramas para complementar.
243+
- Usar ejemplos, códigos o diagramas para complementar.
244244
- Revisa cómo se muestra tu post en el sitio de forma local antes de la PR.
245245

246246

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
CONTRIBUTORS = [
22
{
33
"id": 8,
44
"username": "ocho",

pelicanconf.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import os
2+
import sys
3+
sys.path.append(os.path.dirname(__file__))
4+
5+
from social_networks import SOCIAL_NETWORKS
6+
from contributors import CONTRIBUTORS
7+
18
SITENAME = 'Python Chile ¡El Blog!'
29
SITEURL = ""
310
PYTHON_CHILE_URL = "https://pythonchile.cl/"
411
PATH = "content"
5-
612
TIMEZONE = 'America/Santiago'
7-
813
DEFAULT_LANG = 'es'
9-
1014
THEME = "theme"
1115

1216

@@ -16,15 +20,16 @@
1620
AUTHOR_FEED_ATOM = None
1721
AUTHOR_FEED_RSS = None
1822

19-
# Variables para rutas
23+
# Variables custom para JINJA
2024
JINJA_GLOBALS = {
21-
'img_path': '{static}/img'
25+
'img_path': '{static}/img',
26+
'social_networks': SOCIAL_NETWORKS,
27+
'contributors': CONTRIBUTORS,
2228
}
2329

2430
# Todos las carpetas con archivos estáticos dentro de content/
2531
STATIC_PATHS = [
2632
'img',
27-
'extra/contributors.json'
2833
]
2934

3035
# Carpeta donde se alojan los archivos para crear post. Pelican por defecto tiene basepath content/
@@ -56,9 +61,4 @@
5661
"search.json": "search.json",
5762
"contributors.html": "contributors.html",
5863
"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"}
6464
}

social_networks.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
SOCIAL_NETWORKS = {
2+
"twitter": {
3+
"alt": "X",
4+
"icon": "fa-brands fa-x-twitter",
5+
"url": "https://x.com/pythonchiledev",
6+
},
7+
"instagram": {
8+
"alt": "Instagram",
9+
"icon": "fab fa-instagram",
10+
"url": "https://instagram.com/pythonchiledev",
11+
},
12+
"linkedin": {
13+
"alt": "LinkedIn",
14+
"icon": "fab fa-linkedin",
15+
"url": "https://www.linkedin.com/groups/4929519/",
16+
},
17+
"youtube": {
18+
"alt": "YouTube",
19+
"icon": "fab fa-youtube",
20+
"url": "https://www.youtube.com/c/PythonChile",
21+
},
22+
"meetup": {
23+
"alt": "Meetup",
24+
"icon": "fab fa-meetup",
25+
"url": "https://meetup.com/es/pythonchile",
26+
},
27+
"discord": {
28+
"alt": "Discord",
29+
"icon": "fab fa-discord",
30+
"url": "https://discord.gg/dTHMfJvauS"
31+
},
32+
"telegram": {
33+
"alt": "Telegram",
34+
"icon": "fab fa-telegram",
35+
"url": "https://t.me/pythonchile"
36+
}
37+
}

theme/static/css/style.css

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ body, html, root {
88
}
99

1010
/* navbar */
11-
1211
.navbar {
1312
display: flex;
1413
justify-content: space-between;
@@ -83,6 +82,7 @@ body, html, root {
8382
border-radius: 15px;
8483
border: 3px solid #000;
8584
background-color: #EF4444;
85+
transition: all 0.2s ease-in-out;
8686
}
8787

8888
.navbar-menu a:hover {
@@ -418,6 +418,32 @@ iframe {
418418
font-weight: bold;
419419
}
420420

421+
/* contacto de la comunidad */
422+
.contact-container {
423+
margin: 1rem auto;
424+
padding-bottom: 30%;
425+
}
426+
427+
.social-media-container {
428+
justify-content: center;
429+
display: flex;
430+
}
431+
432+
.social-media-list {
433+
list-style: none;
434+
display: flex;
435+
gap: 1rem;
436+
}
437+
438+
.social-media-list a {
439+
color: #000000;
440+
font-size: 1.5rem;
441+
transition: all 0.2s ease-in-out;
442+
}
443+
444+
.social-media-list a:hover {
445+
color: #E22914;
446+
}
421447

422448
@media (max-width: 1300px) {
423449

@@ -441,7 +467,7 @@ iframe {
441467

442468
.navbar-menu a {
443469
display: block;
444-
max-width: 100%;
470+
max-width: 60%;
445471
text-align: center;
446472
font-size: 80%;
447473
}

theme/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<title>{% block title %}{{ SITENAME }}{% endblock %}</title>
77
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/pygments.css">
88
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css">
9+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
910
<script>
1011

1112
document.addEventListener("DOMContentLoaded", function() {

theme/templates/contact.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,25 @@
22
{% block title %}Contacto — {{ SITENAME }}{% endblock %}
33

44
{% block content %}
5-
<h1>Contactos</h1>
5+
<div class="main-msg">
6+
<h1>Contáctanos 🤗</h1>
7+
<div class="main-body-msg">
8+
Si tienes cualquier duda respecto a la comunidad ¡nos alegrará poder ayudarte ✨¡
9+
10+
<div class="contact-container">
11+
12+
<div>✉️ [email protected]</div>
13+
<div class="social-media-container">
14+
<ul class="social-media-list">
15+
{% for social_network, data in social_networks.items() %}
16+
<li>
17+
<a href="{{ data['url'] }}"><i class="{{ data['icon'] }}"></i></a>
18+
</li>
19+
{% endfor %}
20+
</ul>
21+
</div>
22+
23+
</div>
24+
</div>
25+
</div>
626
{% endblock %}

theme/templates/contributors.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,14 @@ <h1>Contribuidores 🐍</h1>
1111
</div>
1212
</div>
1313

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>
14+
<div class="contributors-container">
15+
{% for user in contributors %}
16+
<div class="contributor">
17+
<a href="{{ user['profileUrl'] }}" target="_blank">
18+
<img src="{{ user['avatarUrl'] }}" alt="{{ user['username'] }}" class="contributor-avatar">
19+
<div class="contributor-name">@{{ user['username'] }}</div>
20+
</a>
21+
</div>
22+
{% endfor %}
23+
</div>
3924
{% endblock %}

theme/templates/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</a>
1010

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

0 commit comments

Comments
 (0)