diff --git a/sass/parts/_pagination.scss b/sass/parts/_pagination.scss new file mode 100644 index 0000000..a6e51d6 --- /dev/null +++ b/sass/parts/_pagination.scss @@ -0,0 +1,30 @@ +.pagination { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 2rem; + font-size: 1em; + list-style: none; + padding: 0; + + li { + margin-right: 1rem; + } + + .page-link { + background: transparent; + border: none; + cursor: pointer; + padding: 0; + + &.disabled { + opacity: 0.5; + pointer-events: none; + } + } + + .page-numbers { + font-size: 0.9rem; + color: var(--meta-color); + } +} diff --git a/templates/base.html b/templates/base.html index 4e9c324..dee73e3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,9 +4,8 @@ {% import "macros/page_desc.html" as macros_page_desc %} {% import "macros/content.html" as macros_content %} {% import "macros/cards_posts.html" as macros_cards_posts %} -{% import "macros/list_title.html" as macros_list_title %} {% import "macros/set_title.html" as macros_set_title %} - +{% import "macros/paginate.html" as macros_paginate %} diff --git a/templates/cards.html b/templates/cards.html index 8698001..4f02fa5 100644 --- a/templates/cards.html +++ b/templates/cards.html @@ -18,18 +18,6 @@ {% if paginator %} -
+ {{ macros_paginate::paginate() }} {% endif %} {% endblock main_content %} diff --git a/templates/section.html b/templates/section.html index a2cc00c..a96ace0 100644 --- a/templates/section.html +++ b/templates/section.html @@ -2,39 +2,29 @@ {% block main_content %} {% if section.extra.section_path -%} -{% set section = get_section(path=section.extra.section_path) %} + {% set extra_section = get_section(path=section.extra.section_path) %} {% endif -%} {%- if section.extra.header %} - {{ macros_page_desc::page_desc(desc=section.extra.header, page=section) }} + {{ macros_page_desc::page_desc(desc=section.extra.header, page=section) }} {% endif -%}