diff --git a/authors/pablo-lira.md b/authors/pablo-lira.md new file mode 100644 index 0000000..7084227 --- /dev/null +++ b/authors/pablo-lira.md @@ -0,0 +1,10 @@ +--- +nombre: pablo lira +github: pablolirag +linkedin: pablolirag +image: coordinacion_pablo_lira.jpg +x: pablolirag +website: https://pablolira.cl +--- + +Pablo Lira es ingeniero de software y analista superior, con experiencia en el desarrollo de aplicaciones orientadas a crear soluciones eficientes y funcionales. Apasionado por la electrónica, combina el mundo del software y el hardware para diseñar proyectos innovadores, siempre enfocado en el aprendizaje continuo y la mejora tecnológica. \ No newline at end of file diff --git a/pelicanconf.py b/pelicanconf.py index e9f4272..2dbc4db 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -129,6 +129,43 @@ } DEFAULT_PAGINATION = 6 +PAGINATED_DIRECT_TEMPLATES = ["index", "archives"] + +# Implement author metadata loading +from pelican import signals + +def load_author_metadata(generator): + for author, articles in generator.authors: + author_slug = author.slug + author_file = os.path.join("authors", f"{author_slug}.md") + + if os.path.exists(author_file): + with open(author_file, "r", encoding="utf-8") as f: + content = f.read() + + # Manual frontmatter parsing to avoid PyYAML dependency + if content.startswith("---"): + parts = content.split("---", 2) + if len(parts) >= 3: + frontmatter = parts[1] + author.bio = parts[2].strip() + + # Parse key-value pairs + metadata = {} + for line in frontmatter.splitlines(): + if ":" in line: + key, value = line.split(":", 1) + metadata[key.strip()] = value.strip() + + author.image = metadata.get("image") + author.github = metadata.get("github") + author.linkedin = metadata.get("linkedin") + author.twitter = metadata.get("x") or metadata.get("twitter") + author.website = metadata.get("website") + author.name = metadata.get("nombre") or author.name + +# Connect signal directly +signals.article_generator_finalized.connect(load_author_metadata) # Uncomment following line if you want document-relative URLs when developing # RELATIVE_URLS = True diff --git a/pycltheme/templates/archives.html b/pycltheme/templates/archives.html index 56c3016..80eec04 100644 --- a/pycltheme/templates/archives.html +++ b/pycltheme/templates/archives.html @@ -5,10 +5,13 @@ {% block content %}

Entradas del Blog

-
- {% for article in dates%} - {% include 'card-page.html' %} - {% endfor %} -
+
+ {% for article in articles_page.object_list %} + {% include 'card-page.html' %} + {% endfor %} +
+{% if articles_page.has_other_pages() %} +{% include 'pagination.html' %} +{% endif %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/pycltheme/templates/author.html b/pycltheme/templates/author.html index 6b38ba7..5dd95c0 100644 --- a/pycltheme/templates/author.html +++ b/pycltheme/templates/author.html @@ -4,13 +4,41 @@ {% block content %}

Artículos por {{ author }}

-
- {% for article in articles_page.object_list %} - {% include 'card.html' %} - {% endfor %} +
+ {% if author.image %} +
+ {{ author }} +
+ {% endif %} +
+ {% if author.bio %} +

{{ author.bio }}

+ {% endif %} + +
+
+
+ {% for article in articles_page.object_list %} + {% include 'card.html' %} + {% endfor %} +
{% if articles_page.has_other_pages() %} - {% include 'pagination.html' %} -{% endif %} -{% endblock %} +{% include 'pagination.html' %} +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/pycltheme/templates/index.html b/pycltheme/templates/index.html index 9626208..9692bd6 100644 --- a/pycltheme/templates/index.html +++ b/pycltheme/templates/index.html @@ -4,22 +4,27 @@
-
-
- {% block content_title %} - {% endblock %} -
-
-

ÚLTIMAS ENTRADAS

-
- {% for article in dates[:6] %} - {% include 'card.html' %} - {% endfor %} +
+
+ {% block content_title %} + {% endblock %} +
+
+

ÚLTIMAS ENTRADAS

+
+ {% for article in dates[:6] %} + {% include 'card.html' %} + {% endfor %} +
+ {% if dates|length > 6 %} + + {% endif %}
-
@@ -37,7 +42,7 @@

Nuestros Patrocinantes

¿Te gustaría patrocinar las actividades de la comunidad Python Chile?

Contáctanos y te contamos como: contacto@pythonchile.cl

-