diff --git a/config.toml b/config.toml index b80a5fc4..c2300d5e 100644 --- a/config.toml +++ b/config.toml @@ -98,6 +98,8 @@ series = true series_items = 9 # Max number of items to display in series list, use 0 to disable #Series_parts = "$NUMBER_OF_PARTS part Series" +#arrow_pagination = true # If set to true then the pagination will use the old arrows mode, be sure to also enable the icons. + meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, updated=false, categories_tags=true, divider="" } meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, updated=true, categories_tags=true, divider="" } diff --git a/sass/abridge.scss b/sass/abridge.scss index 7bc93381..3c6cc8fc 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -68,10 +68,10 @@ $icon-researchgate: false !default; $icon-x: true !default;// x symbol, used to close search results page. $icon-search: true !default;//search, spyglass search button in search box. $icon-adjust: true !default;//theme switcher dark/light toggle button. -$icon-angll: true !default;//pagination, goto first page -$icon-angl: true !default;//pagination, goto previous page -$icon-angr: true !default;//pagination, goto next page -$icon-angrr: true !default;//pagination, goto last page +$icon-angll: false !default;//pagination, goto first page +$icon-angl: false !default;//pagination, goto previous page +$icon-angr: false !default;//pagination, goto next page +$icon-angrr: false !default;//pagination, goto last page $icon-angu: true !default;//back to top button, appears after scrolling down. $icon-world: true !default;//language select menu $icon-copy: true !default;//copy to clipboard, for code blocks. @@ -778,6 +778,10 @@ $syntax: true !default;//syntax highlighting for code blocks .outp { padding: 0 .26rem .2rem; } + .dis { + color: var(--c4); + font-weight: var(--fh); + } .off { color: var(--c4); font-weight: var(--fh); @@ -794,7 +798,8 @@ $syntax: true !default;//syntax highlighting for code blocks border-radius: var(--br); } .mode:hover, .cnav { - color: var(--a1);//pagination color current page + //pagination color current page + background-color: var(--c2); } // breakpoint makes header responsive for desktop layouts diff --git a/templates/index.html b/templates/index.html index c2ced137..0b1e83f2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -59,7 +59,11 @@ {%- endif %} {%- endfor %} + {%- if config.extra.arrow_pagination %} {{- macros::pagination(paginator=paginator, config=config) }} + {%- else %} + {{- macros::numpagination(paginator=paginator, config=config) }} + {%- endif %} {%- if config.extra.recent | default(value=true) %} {#- The following line is checking if the template is being used for the root or a section #} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 9794e5d6..dd3fcffa 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -299,3 +299,80 @@

{% if config.extra.title_size_index %} + {%- if paginator.current_index > 6 and paginator.number_pagers > 7 %} + 1 + 2 + ... + {%- elif paginator.current_index > 5 and paginator.number_pagers > 7 %} + 1 + 2 + 3 + {%- elif paginator.current_index > 4 and paginator.number_pagers > 6 %} + 1 + 2 + {%- elif paginator.current_index > 3 and paginator.number_pagers > 5 -%} + 1 + {%- endif -%} + + {%- for i in range(start=start, end=end+1) -%} + {%- if i == paginator.current_index -%} + {{i}} + {%- elif i > 1 -%} + {{i}} + {%- else -%} + {{ i }} + {%- endif -%} + {%- endfor -%} + + {%- if paginator.number_pagers > paginator.current_index+5 and paginator.number_pagers > 7 %} + ... + {{paginator.number_pagers-1}} + {{paginator.number_pagers}} + {%- elif paginator.number_pagers > paginator.current_index+4 and paginator.number_pagers > 7 %} + {{paginator.number_pagers-2}} + {{paginator.number_pagers-1}} + {{paginator.number_pagers}} + {%- elif paginator.number_pagers > paginator.current_index+3 and paginator.number_pagers > 6 %} + {{paginator.number_pagers-1}} + {{paginator.number_pagers}} + {%- elif paginator.number_pagers > paginator.current_index+2 and paginator.number_pagers > 5 %} + {{paginator.number_pagers}} + {%- endif -%} + + {%- endif %} +{%- endmacro %}