Skip to content
Snippets Groups Projects
Unverified Commit 425bdb2e authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Merge pull request #219 from noesya/categories

Categories
parents 1a727403 eb968721
No related branches found
Tags v5.1.5
No related merge requests found
Showing
with 109 additions and 69 deletions
......@@ -14,6 +14,6 @@ ul.categories
@include grid(3, md)
@include grid(4, xxl)
.categories__term
.posts_categories__term, .events_categories__term
main
padding-bottom: $spacing3
......@@ -6,14 +6,9 @@
.lead
@include h3
@include media-breakpoint-down(desktop)
.document-content
display: flex
flex-direction: column
aside
order: 2
padding: 0 half($grid-gutter-sm)
.block-pagination
order: 3
.event-sidebar
padding: 0 half($grid-gutter-sm)
margin-bottom: $spacing3
@include media-breakpoint-up(desktop)
.event-sidebar
@include container-margin-left
......@@ -33,6 +28,10 @@
// Safe spacing if post is empty
.document-content
min-height: 350px
&::after
content: ''
display: block
height: 1px
.events__section
.archive-link
......@@ -56,30 +55,28 @@
font-size: $table-body-size-desktop
.event-date
text-transform: capitalize
ul
@include list-reset
> li
@include meta
padding-top: $spacing0
padding-bottom: $spacing0
padding: 1rem 0
font-family: $body-font-family
&:not(:first-child)
align-items: center
> span
@include meta
color: $color-text-alt
padding-left: 0
display: block
white-space: nowrap
vertical-align: top
> ul
text-align: right
flex: 1
time + time
@include icon(arrow)
&::before
padding-right: 0.3rem
a
@include link($color-accent)
.events-categories
display: flex
gap: space(2)
.share
a
color: inherit
......
......@@ -23,7 +23,7 @@
.posts__section,
.authors__term,
.categories__term,
.posts_categories__term,
.persons__page
.posts--list
article
......@@ -77,15 +77,12 @@
margin-top: $spacing0
.posts__page
.lead
@include h3
@include media-breakpoint-down(desktop)
.document-content
display: flex
flex-direction: column
aside
order: 2
padding: 0 half($grid-gutter-sm)
.block-pagination
order: 3
.post-sidebar
padding: 0 half($grid-gutter-sm)
margin-bottom: $spacing3
@include media-breakpoint-up(desktop)
.post-sidebar
@include container-margin-left
......@@ -105,8 +102,6 @@
// Safe spacing if post is empty
.document-content
min-height: 350px
.lead
@include h3
.post-categories
@include list-reset
......@@ -114,7 +109,7 @@
li
display: inline-block
vertical-align: middle
margin-left: 10px
margin-left: space(2)
&:last-child
&::after
content: none
......@@ -133,10 +128,8 @@
padding-top: $spacing0
padding-bottom: $spacing0
border-color: $color-border
padding: 1rem 0
&:not(:first-child)
align-items: center
border-top: 1px solid $color-border
> span
@include meta
......@@ -148,7 +141,6 @@
text-align: right
flex: 1
a
// @include meta
@include link($color-accent)
.share
justify-content: flex-end
......@@ -165,7 +157,6 @@
.link
@extend .link-more
.authors__term,
.categories__term
.authors__term
.blocks + .container
margin-top: $spacing3
......@@ -24,6 +24,8 @@ let pagefindExclude = `
.administrators__term,
.authors__term,
.categories__taxonomy, .categories__term,
.posts-categories__taxonomy, .posts-categories__term,
.events-categories__taxonomy, .events-categories__term,
.diplomas__taxonomy, .block-diplomas,
.events__section, .block-agenda,
.organizations__section, .block-organizations,
......
......@@ -147,6 +147,9 @@ diplomas:
type: Type de diplôme
events:
archives: Previous events archive
category:
one: Category
other: Categories
none: No event
next: Next event
next_aria: Next event “{{ .Title }}”
......@@ -201,8 +204,9 @@ persons:
publications: Latest publications
posts:
author: Author
categories: Categories
category: Category
category:
one: Category
other: Categories
date: Date
informations: Informations
next: Next article
......
......@@ -149,6 +149,9 @@ diplomas:
type: Type de diplôme
events:
archives: Accéder aux archives des événements passés
category:
one: Catégorie
other: Catégories
date: Date
hour: Heure
none: Aucun événement
......@@ -206,8 +209,9 @@ persons:
papers: Papiers publiés récemment
posts:
author: Auteur·rice
categories: Catégories
category: Catégorie
category:
one: Catégorie
other: Catégories
date: Date
informations: Informations
next: Article suivant
......
......@@ -3,10 +3,8 @@
{{ partial "hooks/after-page-hero.html" . }}
<div class="document-content">
{{- $category := site.GetPage (printf "/categories%s" .Params.category) -}}
{{ partial "toc/container.html"
(dict
"category" $category
"toc" "pages/toc.html"
"context" .
)
......
......@@ -3,9 +3,7 @@
{{ partial "hooks/after-page-hero.html" . }}
<div class="document-content">
{{- $category := site.GetPage (printf "/categories%s" .Params.category) -}}
{{ partial "toc/container.html" (dict
"category" $category
"toc" "pages/toc.html"
"context" .
) }}
......
......@@ -2,17 +2,15 @@
{{ partial "categories/hero-term.html" . }}
<div class="document-content">
{{ partial "toc/container.html"
(dict
"toc" "toc/default.html"
"context" .
)
}}
{{ partial "toc/container.html" (dict
"toc" "toc/default.html"
"context" .
) }}
{{ partial "categories/summary.html" (dict
"context" .
"block_wrapped" true
) }}
) }}
{{ partial "contents/list.html" . }}
......
......@@ -18,7 +18,9 @@
{{ partial "commons/siblings-navigation.html" (dict
"context" .
) }}
"previous_label" (i18n "events.previous")
"next_label" (i18n "events.next")
) }}
{{ partial "hooks/before-document-content-end.html" . }}
</div>
......
{{ define "main" }}
{{ partial "categories/hero-list.html" . }}
<div class="document-content">
<div class="container">
{{ partial "categories/categories.html" . }}
{{ partial "commons/pagination.html" . }}
</div>
</div>
{{ end }}
{{ define "main" }}
{{ partial "categories/hero-term.html" . }}
<div class="document-content">
{{ partial "toc/container.html" (dict
"toc" "toc/default.html"
"context" .
) }}
{{ partial "categories/summary.html" (dict
"context" .
"block_wrapped" true
) }}
{{ partial "contents/list.html" . }}
<div class="container">
{{ partial "events/events.html" . }}
{{ partial "commons/pagination.html" . }}
</div>
</div>
{{ end }}
......@@ -3,14 +3,10 @@
{{ partial "hooks/after-page-hero.html" . }}
<div class="document-content">
{{- $category := site.GetPage (printf "/categories%s" .Params.category) -}}
{{ partial "toc/container.html"
(dict
"category" $category
"toc" "pages/toc.html"
"context" .
)
}}
{{ partial "toc/container.html" (dict
"toc" "pages/toc.html"
"context" .
) }}
{{ partial "pages/summary.html" (dict
"context" .
......
......@@ -10,7 +10,7 @@
{{ $bodyclass = printf "%s offcanvas-toc" $bodyclass }}
{{ end }}
{{ range .Params.categories }}
{{ range .Params.posts_categories }}
{{ $bodyclass = printf "%s category--%s" $bodyclass . }}
{{ end }}
......
......@@ -5,7 +5,7 @@
{{- $layout := .block.data.layout | default "grid" -}}
{{- with .block.data }}
{{ if .category }}
{{- $term = site.GetPage (printf "/categories%s" .category) -}}
{{- $term = site.GetPage (printf "/posts_categories%s" .category) -}}
{{ end }}
<div itemscope itemtype="http://schema.org/Blog" class="{{ $block_class }} {{ if $term }} term-{{ replace $term.Slug "/" "" }} {{- end -}}">
<div class="container">
......@@ -28,9 +28,9 @@
{{ if eq .mode "categories" }}
<ul class="categories categories--grid">
{{ range site.Taxonomies.categories }}
{{ range site.Taxonomies.posts_categories }}
<li data-title="{{ .Page.Title }}">
{{ partial "categories/category.html" .Page }}
<a href="{{ .Permalink }}" class="title" aria-label="{{ i18n "commons.more_aria" (dict "Title" .Title) }}">{{ partial "PrepareHTML" .Title }}</a>
<p>{{ i18n "blocks.categories.items.count" (dict "Count" (len .)) }}</p>
</li>
{{ end }}
......
{{- $title := or .Params.header_text .Title -}}
{{- partial "header/hero.html"
(dict
"title" $title
"sizes" site.Params.image_sizes.sections.categories.hero
"context" .
) -}}
(dict
"title" $title
"sizes" site.Params.image_sizes.sections.categories.hero
"context" .
) -}}
......@@ -3,6 +3,6 @@
(dict
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.categories.hero_term
"context" .
"sizes" site.Params.image_sizes.sections.categories.hero_term
"context" .
) -}}
......@@ -3,6 +3,6 @@
(dict
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.diplomas.hero
"sizes" site.Params.image_sizes.sections.diplomas.hero
"context" .
) -}}
{{ $categories := .GetTerms "events_categories" }}
{{- if $categories -}}
<ul class="events-categories">
{{- range $categories -}}
<li>
<a href="{{ .Permalink }}">
{{- safeHTML .Title -}}
</a>
</li>
{{- end }}
</ul>
{{- end -}}
......@@ -19,6 +19,12 @@
</li>
{{ end }}
{{ end }}
{{ if .Params.events_categories }}
<li>
<span>{{ i18n "events.category" (dict "Count" ( len .Params.events_categories )) }}</span>
{{ partial "events/categories.html" . }}
</li>
{{ end }}
<li>
<span>{{ i18n "posts.share" }}</span>
{{ partial "commons/share.html" . }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment