From f35a7b0e70032de2feec9f3bda09da44cf0e1073 Mon Sep 17 00:00:00 2001 From: srv Date: Mon, 28 Apr 2025 17:11:28 -0500 Subject: first commit --- libretube-theme/templates/archives.html | 99 ++++++++ libretube-theme/templates/article.html | 270 ++++++++++++++++++++++ libretube-theme/templates/article_info.html | 68 ++++++ libretube-theme/templates/article_info_aside.html | 54 +++++ libretube-theme/templates/author.html | 34 +++ libretube-theme/templates/authors.html | 72 ++++++ libretube-theme/templates/base.html | 203 ++++++++++++++++ libretube-theme/templates/categories.html | 40 ++++ libretube-theme/templates/category.html | 17 ++ libretube-theme/templates/index.html | 37 +++ libretube-theme/templates/page.html | 49 ++++ libretube-theme/templates/pagination.html | 78 +++++++ libretube-theme/templates/period_archives.html | 55 +++++ libretube-theme/templates/tag.html | 14 ++ libretube-theme/templates/tags.html | 35 +++ libretube-theme/templates/translations.html | 16 ++ 16 files changed, 1141 insertions(+) create mode 100644 libretube-theme/templates/archives.html create mode 100644 libretube-theme/templates/article.html create mode 100644 libretube-theme/templates/article_info.html create mode 100644 libretube-theme/templates/article_info_aside.html create mode 100644 libretube-theme/templates/author.html create mode 100644 libretube-theme/templates/authors.html create mode 100644 libretube-theme/templates/base.html create mode 100644 libretube-theme/templates/categories.html create mode 100644 libretube-theme/templates/category.html create mode 100644 libretube-theme/templates/index.html create mode 100644 libretube-theme/templates/page.html create mode 100644 libretube-theme/templates/pagination.html create mode 100644 libretube-theme/templates/period_archives.html create mode 100644 libretube-theme/templates/tag.html create mode 100644 libretube-theme/templates/tags.html create mode 100644 libretube-theme/templates/translations.html (limited to 'libretube-theme/templates') diff --git a/libretube-theme/templates/archives.html b/libretube-theme/templates/archives.html new file mode 100644 index 0000000..8374a58 --- /dev/null +++ b/libretube-theme/templates/archives.html @@ -0,0 +1,99 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ _('Archivos de %(sitename)s', sitename=SITENAME) }} + {% endblock %} + {{ super() }} + {% block seo %} + + + + {% endblock %} +{% endblock %} + +{% block content %} + +
+
+ +
+

{{ ngettext('%(num)d artículo', '%(num)d artículos', dates|length) }}

+
    + {% for article in dates %} + {% set current_year = article.date|strftime('%Y') %} + {% set current_month = article.date|strftime('%m') %} + {% if loop.previtem %} + {% set previous_year = loop.previtem.date|strftime('%Y') %} + {% set previous_month = loop.previtem.date|strftime('%m') %} + {% endif %} + {% if current_year != previous_year %} + {% if loop.previtem %} +
+ + + + {% endif %} +
  • {{ current_year }} + +
  • + {% endif %} + {% endfor %} + +
    + +
    +
    + +{% endblock %} diff --git a/libretube-theme/templates/article.html b/libretube-theme/templates/article.html new file mode 100644 index 0000000..a29c95a --- /dev/null +++ b/libretube-theme/templates/article.html @@ -0,0 +1,270 @@ +{% extends "base.html" %} +{% block html_lang %}{{ article.lang }}{% endblock %} + +{% block head %} + {% block title %} + {{ article.title }} - {{SITENAME}} + {% endblock %} + {{ super() }} + {% import 'translations.html' as translations with context %} + {% if translations.entry_hreflang(article) %} + {{ translations.entry_hreflang(article) }} + {% endif %} + + + + {% if article.styles %} + {% for style in article.styles %} + {{ style }} + {% endfor %} + {% endif %} + {% block seo %} + {% set seo_description = article.summary|striptags %} + {% set SEO_DESC_LENGTH = 160 %} + {% if seo_description|length >= SEO_DESC_LENGTH %} + {# Quita la última palabra para no dejarla incompleta #} + {% set seo_description = seo_description[:SEO_DESC_LENGTH].split(' ')[:-1]|join(' ') %} + {% if not seo_description[-1] in ['.', '?', ':', '!'] %} + {% set seo_more = seo_description + '…' %} + {% set seo_description = seo_more|replace('"','') %} + {% endif %} + {% endif %} + + {% set article_image = "%s/%s/../wp-content/uploads/article/thumbnail/%s" % (SITEURL, THEME_STATIC_DIR, article.image) %} + + + + + + + + + + + + + {% if article.modified %} + + {% endif %} + + + + + + {% for tag in article.tags %} + + {% endfor %} + {% if article.og_video %} + + + + + + + + {% endif %} + + + + + + + {% endblock %} +{% endblock %} + +{% block menu_header %} {% endblock menu_header %} + +{%- block content -%} + +
    +
    +
    +
    + + +
    + {{ article.content }} +
    + + + +
    +
    {{ _('Licencia') }}
    + {% if article.license == LICENSE['allrights']['name'] %} + + {{ article.license }} + + {% elif article.license == LICENSE['ccby4']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbysa4']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbynd4']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbync4']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbyncsa4']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbyncnd4']['name']%} + + {{ article.license }} + + {% elif article.license == LICENSE['ccby3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbysa3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbynd3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbync3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbyncsa3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['ccbyncnd3']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['cc01']['name']%} + + {{ article.license }} + {% elif article.license == LICENSE['publicdomain']['name']%} + + {{ article.license }} + {% else %} + CC BY-SA 4.0 + {% endif %} +
    + + + +
    +
    + +

    + {% if not HIDE_AUTHORS and article.authors %} + + + + + + {% for author in article.authors %} + {{ author }} + + + + + + + + {% endfor %} + {% endif %} +

    + + + {% set año = article.date|strftime('%Y') %} + {% set mes = article.date|strftime('%m') %} + {% set nombre_mes = article.date|strftime('%B') %} + + + +
    +
    + + + +
    + + +
    + + +
    + + {% if SHOW_RECENT_POSTS %} + +
    + + + {% for article in articles[:SHOW_RECENT_POSTS] %} + + {% endfor %} + +
    + {% endif %} + +
    +
    +
    + +{%- endblock -%} + +{% block extend_js %} + + + + +{% endblock %} diff --git a/libretube-theme/templates/article_info.html b/libretube-theme/templates/article_info.html new file mode 100644 index 0000000..cd6e949 --- /dev/null +++ b/libretube-theme/templates/article_info.html @@ -0,0 +1,68 @@ + + + + diff --git a/libretube-theme/templates/article_info_aside.html b/libretube-theme/templates/article_info_aside.html new file mode 100644 index 0000000..f0b7e14 --- /dev/null +++ b/libretube-theme/templates/article_info_aside.html @@ -0,0 +1,54 @@ + + + + diff --git a/libretube-theme/templates/author.html b/libretube-theme/templates/author.html new file mode 100644 index 0000000..ba1b2d9 --- /dev/null +++ b/libretube-theme/templates/author.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ _('Artículos escritos por %(author)s en %(sitename)s', author=author, sitename=SITENAME) }} + {% endblock %} + {{ super() }} + {% block seo %} + + + + + + {% endblock %} +{% endblock %} + +{% block menu_header %}{% endblock menu_header %} + +{% block content %} + +
    +
    +
    +

    {% trans %}Autor: {{ author }}{% endtrans %}

    +
    +
    +
    + + {{ super() }} +{% endblock %} diff --git a/libretube-theme/templates/authors.html b/libretube-theme/templates/authors.html new file mode 100644 index 0000000..f7428b6 --- /dev/null +++ b/libretube-theme/templates/authors.html @@ -0,0 +1,72 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ _('Créditos de %(sitename)s', sitename=SITENAME) }} + {% endblock %} + {{ super() }} + {% block seo %} + + + + + + + + + + + + + + {% endblock %} +{% endblock %} + +{% block content %} + +
    +
    + +
    +

    {{ _('Artículos de vídeo') }}

    +
      + {%- for author, articles in authors|sort %} +
    • + {{ author }} + ({{ articles|count }}) +
    • + {% endfor %} +
    + +

    {{ _('Programación') }}

    + + +

    {{ _('Traducción') }}

    + + +

    {{ _('Software que usa la página') }}

    + {% set software = (('https://nginx.org/', 'Nginx'), + ('http://babel.pocoo.org/', 'Babel'), + ('https://pypi.org/project/beautifulsoup4/', 'BeautifulSoup4'), + ('https://www.python.org/', 'Python'), + ('https://blog.getpelican.com/', 'Pelican'), + ('https://pypi.org/project/Markdown/', 'Markdown'), + ('https://lablibre.tuxfamily.org/pages/librejs.html', _('Algunos programas de JavaScript'),)) %} + +
    + +
    +
    + +{% endblock %} diff --git a/libretube-theme/templates/base.html b/libretube-theme/templates/base.html new file mode 100644 index 0000000..51c3cef --- /dev/null +++ b/libretube-theme/templates/base.html @@ -0,0 +1,203 @@ + + + + {% block head %} + + + + + + {% block extra_head %} + {% endblock %} + + + + + + + + + + {% endblock head %} + + + + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    + +
    + + {% block menu_header %} + {% if DISPLAY_PAGES_ON_MENU %} +
    + +
    + {% endif %} + {% endblock menu_header %} + + {%- block content -%} + + +
    + + +
    + + + + {% include "pagination.html" %} + + + {%- endblock -%} + +
    +
    +
    + + +
    + {% block extend_js %} + {% endblock %} + + {% if article %} + {% if article.js %} + {% for script in article.js %} + {{ script }} + {% endfor %} + {% endif %} + {% endif %} + + {% if page %} + {% if page.js %} + {% for script in page.js %} + {{ script }} + {% endfor %} + {% endif %} + {% endif %} + + diff --git a/libretube-theme/templates/categories.html b/libretube-theme/templates/categories.html new file mode 100644 index 0000000..f945364 --- /dev/null +++ b/libretube-theme/templates/categories.html @@ -0,0 +1,40 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ _('Lista de categorías de %(sitename)s', sitename=SITENAME)}} + {% endblock %} + {{ super() }} + + + +{% endblock %} + +{% block content %} +
    +
    +
    +

    {{ _('Lista de categorías') }}

    +
    +
    +
    +
    + +
    +
    +
      + {% for category, articles in categories %} +
    • {{ category }}
    • + {% endfor %} +
    +
    +
    + +
    +
    +
    +{% endblock %} diff --git a/libretube-theme/templates/category.html b/libretube-theme/templates/category.html new file mode 100644 index 0000000..b6fc9d5 --- /dev/null +++ b/libretube-theme/templates/category.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ category.name }} - {{SITENAME}} + {% endblock %} + {{ super() }} +{% endblock %} + +{% block content %} +
    + +

    {{ category }}

    + +
    + {{ super() }} +{% endblock %} diff --git a/libretube-theme/templates/index.html b/libretube-theme/templates/index.html new file mode 100644 index 0000000..e8746c7 --- /dev/null +++ b/libretube-theme/templates/index.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {% if articles_page.number != 1 %}{{ _('Página') }} {{ articles_page.number }} | {% endif %}{{ SITENAME }} + {% endblock %} + {{ super() }} + {% if lang_siteurls and articles_page.number == 1 %} + {% for lang, url in lang_siteurls.items() %} + + {% endfor %} + {% endif %} + + {% block seo %} + {% set SITE_DESCRIPTION = _('Videoteca de software libre brindando avance tecnológico') %} + + + + + + + + + + + + + + + + {% endblock %} +{% endblock %} + +{% block sitename %} +

    {{ SITENAME }}

    +

    {{ SITESUBTITLE }}

    +{% endblock %} diff --git a/libretube-theme/templates/page.html b/libretube-theme/templates/page.html new file mode 100644 index 0000000..47db027 --- /dev/null +++ b/libretube-theme/templates/page.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} + +{% block html_lang %}{{ page.lang }}{% endblock%} + +{% block head %} + {% block title %} + {{ page.title }} - {{SITENAME}} + {% endblock %} + {% import 'translations.html' as translations with context %} + {% if translations.entry_hreflang(page) %} + {{ translations.entry_hreflang(page) }} + {% endif %} + {{ super() }} + {% if page.styles %} + {% for style in page.styles %} + {{ style }} + {% endfor %} + {% endif %} + {% block seo %} + + + + + + + + + + + + + + + {% endblock %} +{% endblock head %} + +{%- block content -%} + +
    +
    + +
    + {{ page.content }} +
    + +
    +
    + +{%- endblock -%} diff --git a/libretube-theme/templates/pagination.html b/libretube-theme/templates/pagination.html new file mode 100644 index 0000000..ec99498 --- /dev/null +++ b/libretube-theme/templates/pagination.html @@ -0,0 +1,78 @@ +{% if DEFAULT_PAGINATION %} + +{% endif %} diff --git a/libretube-theme/templates/period_archives.html b/libretube-theme/templates/period_archives.html new file mode 100644 index 0000000..3ff1ca2 --- /dev/null +++ b/libretube-theme/templates/period_archives.html @@ -0,0 +1,55 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {% set len_period = period|length %} + {%- if len_period == 1 -%} + {{ _('Archivos de %(año)d', año=period[0]) }} - {{SITENAME}} + {%- elif len_period == 2 -%} + {{ _('Archivos de %(mes)s de %(año)d', año=period[0], mes=period[1]) }} - {{SITENAME}} + {%- elif len_period == 3 -%} + {{ _('Archivos del %(dia)d de %(mes)s de %(año)d', año=period[0], mes=period[1], dia=period[2]) }} - {{SITENAME}} + {%- endif -%} + {% endblock %} + {{ super() }} +{% endblock %} + +{% block menu_header %}{% endblock menu_header %} + +{% block content %} + +
    +
    +
    +

    + {% set len_period = period|length %} + {%- if len_period == 1 -%} + {{ _('Archivos de %(año)d', año=period[0]) }} + {%- elif len_period == 2 -%} + {{ _('Archivos de %(mes)s de %(año)d', año=period[0], mes=period[1]) }} + {%- elif len_period == 3 -%} + {{ _('Archivos del %(dia)d de %(mes)s de %(año)d', año=period[0], mes=period[1], dia=period[2]) }} + {%- endif -%} +

    +
    +
    +
    + + + +
    +
    + +
    +
    + {% for article in dates %} +
    {{ article.date|strftime('%A %-d de %B de %Y a las %H:%M %z') }}
    +
    {{ article.title }}
    + {% endfor %} +
    +
    + +
    +
    + +{% endblock %} diff --git a/libretube-theme/templates/tag.html b/libretube-theme/templates/tag.html new file mode 100644 index 0000000..a6e0f47 --- /dev/null +++ b/libretube-theme/templates/tag.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block head %} + {% block title %}#{{ tag.name }} - {{SITENAME}}{% endblock title %} + {{ super() }} + +{% endblock %} +{% block content %} +
    + +

    #{{ tag }}

    + +
    + {{ super() }} +{% endblock %} diff --git a/libretube-theme/templates/tags.html b/libretube-theme/templates/tags.html new file mode 100644 index 0000000..9357565 --- /dev/null +++ b/libretube-theme/templates/tags.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block head %} + {% block title %} + {{ _('Lista de etiquetas de %(sitename)s', sitename=SITENAME) }} + {% endblock %} + {{ super() }} + + +{% endblock %} + +{% block content %} +
    +
    +
    +

    {{ _('Lista de etiquetas') }}

    +
    +
    +
    +
    + +
    +
    +
      + {%- for tag, articles in tags|sort %} +
    • {{ tag }} ({{ articles|count }})
    • + {% endfor %} +
    +
    +
    + +
    +
    +
    +{% endblock %} diff --git a/libretube-theme/templates/translations.html b/libretube-theme/templates/translations.html new file mode 100644 index 0000000..e8d2665 --- /dev/null +++ b/libretube-theme/templates/translations.html @@ -0,0 +1,16 @@ +{% macro translations_for(article) %} + {% if article.translations %} + {{ _('Traducciones:') }} + {% for translation in article.translations %} + {{ LANGUAGE_CODES[translation.lang] }}{% if not loop.last %},{% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro entry_hreflang(entry) %} + {% if entry.translations %} + {% for translation in entry.translations %} + + {% endfor %} + {% endif %} +{% endmacro %} -- cgit v1.2.3