5 | {# Render the next/prev buttons, unless suppressed. #}
6 | {% if not page.parent.root() and page.parent.header.content.sibling_links|default(false) %}
7 |
15 | {% endif %}
16 |
--------------------------------------------------------------------------------
/templates/partials/item/grid.html.twig:
--------------------------------------------------------------------------------
1 | {% if page.header.show_header_image|default('default') == 'default' %}
2 | {% set show_image = parent.header.render.children.image ?? true %}
3 | {% else %}
4 | {% set show_image = page.header.show_header_image == 'enabled' %}
5 | {% endif %}
6 |
7 | {% set header_image = page.media.images[page.header.header_image_file] ?? page.media.images|first %}
8 | {% set use_image_crop = style.image_cropping|default(false) %}
9 | {% set image_width = use_image_crop ? (style.width == 'default' ? 1024 : style.width) / 7 : header_image.width %}
10 | {% set image_height = use_image_crop ? (style.width == 'default' ? 1024 : style.width) / 7 : header_image.height %}
11 | {% set header_image_url = header_image.cropZoom(image_width, image_height).url : header_image.url %}
12 |
13 | {% set show_subtitle = parent.header.render.children.subtitle ?? true %}
14 | {% set show_cat = parent.header.render.children.category ?? true %}
15 | {% set show_date = parent.header.render.children.date ?? false %}
16 | {% set show_children = parent.header.render.children.nested_children ?? true %}
17 | {% set inner_children = page.collection()|length > 0 ? page.collection() : page.children.visible %}
18 |
19 | {# ------------------------------------------------------------------------ #}
20 |
21 |
22 |
23 | {# Image #}
24 |
25 | {% if show_image and header_image %}
26 |
27 |
28 |
29 | {% endif %}
30 | |
31 |
32 |
33 | {# Title #}
34 |
35 |
36 | {{ page.title }}
37 |
38 | |
39 |
40 |
41 | {# Subtitle #}
42 |
43 |
44 | {% if show_subtitle and page.header.subtitle %}
45 | {{ page.header.subtitle }}
46 | {% endif %}
47 | |
48 |
49 |
50 |
51 |
52 | {# Date #}
53 |
54 | {% if show_date %}
55 | {% if html5 %}
56 | {{ 'THEME_HYPERTEXT.DATES.PUBLISHED'|t|raw }}:
57 | {% else %}
58 | {{ 'THEME_HYPERTEXT.DATES.PUBLISHED'|t|raw }}: {{ page.date|date(system.pages.dateformat.short) }}
59 | {% endif %}
60 | {% endif %}
61 | |
62 |
63 | {# Categories #}
64 |
65 | {% if page.taxonomy.category and show_cat %}
66 | {{ 'THEME_HYPERTEXT.CATEGORIES.CATEGORIES'|t|raw }}:
67 | {% for category in page.taxonomy.category %}
68 | {{ structure.use_decorators ? '[' : '' }}{{ category }}{{ structure.use_decorators ? ']' : '' }}{{ not loop.last ? ',' : '' }}
69 | {% endfor %}
70 | {% endif %}
71 | |
72 |
73 | {# Children
74 | # Not sure how to implement this just yet...
75 | {% if show_children and inner_children|length > 0 %}
76 | {% set inner_children = inner_children.order(page.header.content.order.by|default('default'), page.header.content.order.dir|default('default')) %}
77 | {# The next set of items should be somewhat close together. #}
53 |
54 | {# Image #}
55 | {% if show_image and header_image %}
56 |
57 |
58 |
59 |
60 | {% endif %}
61 |
62 | {# Date #}
63 | {% set isHome = page.home() %}
64 | {% if (show_date != 0) and (show_date != default) and page.header.show_date != 'disabled' %}
65 | {% if (show_date == 'everywhere' or show_date == 1) or
66 | (show_date == 'not-home' and not isHome) or
67 | (show_date == 'children' and page.template() in ['default', 'blog_item', 'item', 'modular'] and not isHome) or
68 | page.header.show_date == 'enabled'
69 | %}
70 | Date:
71 | {% if html5 %}
72 | {{ structure.use_decorators ? '[' : '' }}{{ structure.use_decorators ? ']' : '' }}
73 | {% else %}
74 | {{ structure.use_decorators ? '[' : '' }}{{ date|date(system.pages.dateformat.short) }}{{ structure.use_decorators ? ']' : '' }}
75 | {% endif %}
76 |
77 | {% endif %}
78 | {% endif %}
79 |
80 | {# Categories #}
81 | {% if page.taxonomy.category %}
82 | {{ 'THEME_HYPERTEXT.CATEGORIES.CATEGORIES'|t }}:
83 | {% for category in page.taxonomy.category %}
84 | {{ structure.use_decorators ? '[' : '' }}{{ category }}{{ structure.use_decorators ? ']' : '' }}{{ not loop.last ? ',' : '' }}
85 | {% endfor %}
86 | {{ page.taxonomy.tag ? '
' : '' }}
87 | {% endif %}
88 |
89 | {% if page.taxonomy.tag %}
90 | Tags:
91 | {% for tag in page.taxonomy.tag %}
92 | {{ structure.use_decorators ? '[' : '' }}{{ tag }}{{ structure.use_decorators ? ']' : '' }}{{ not loop.last ? ',' : '' }}
93 | {% endfor %}
94 | {% endif %}
95 |
96 |
97 |
--------------------------------------------------------------------------------
/templates/partials/item/list.html.twig:
--------------------------------------------------------------------------------
1 | {% set show_subtitle = parent.header.render.children.subtitle ?? true %}
2 | {% set show_cat = parent.header.render.children.category ?? true %}
3 | {% set show_children = parent.header.render.children.nested_children ?? true %}
4 | {% set inner_children = page.collection()|length > 0 ? page.collection() : page.children.visible %}
5 |
6 | {% set show_date = parent.header.render.children.date ?? false %}
7 | {% switch parent.header.render.children.which_date|default('date') %}
8 | {% case 'modified' %}
9 | {% set date = page.modified %}
10 | {% case 'published' %}
11 | {% set date = page.publishDate %}
12 | {% case 'unpublished' %}
13 | {% set date = page.unpublishDate %}
14 | {% case 'date' %}
15 | {% set date = page.date %}
16 | {% default %}
17 | {% set date = page.date %}
18 | {% endswitch %}
19 |
20 | {# ------------------------------------------------------------------------ #}
21 |
22 | {% if page.isDir() %}
23 |
6 | {% for message in grav.messages.fetch %}
7 |
8 | {% set scope = message.scope|e %}
9 | {% set type = type_mapping[scope] %}
10 | {% set icon = icon_mapping[scope] %}
11 |
12 |
13 | {{word_mapping[scope]}} {{ message.message|raw }}
14 |
15 | {% endfor %}
16 |
--------------------------------------------------------------------------------
/templates/partials/page/navigation.html.twig:
--------------------------------------------------------------------------------
1 | {% set hasNav = pages.children.visible|length >= 1 or
2 | config.themes.hypertext.menu.menuItems|length >= 1 or
3 | (config.plugins.login.enabled and grav.user.username) %}
4 |
5 | {% if hasNav %}
6 |
7 | {{ html5 ? '