diff --git a/assets/sass/_theme/blocks/posts.sass b/assets/sass/_theme/blocks/posts.sass index b59c42ddb81591f6918062afbc1f1b590b70a0a7..5bbc3b2c3beeec4221305b7f43a9ddd7ab037c73 100644 --- a/assets/sass/_theme/blocks/posts.sass +++ b/assets/sass/_theme/blocks/posts.sass @@ -9,6 +9,7 @@ @include grid(1) @include grid($block-posts-grid-columns, desktop) article + @include author-and-time-side-to-side [itemprop=headline] a @include stretched-link @@ -18,7 +19,6 @@ margin-top: $spacing-2 .media margin-top: 0 - @include author-and-time-side-to-side &--grid @include media-breakpoint-down(desktop) diff --git a/assets/sass/_theme/blocks/projects.sass b/assets/sass/_theme/blocks/projects.sass new file mode 100644 index 0000000000000000000000000000000000000000..0b74eec0c4b8352bcdb41bb5518a8ee0aab45a77 --- /dev/null +++ b/assets/sass/_theme/blocks/projects.sass @@ -0,0 +1,3 @@ +.block-projects + .grid + @include grid(2, md) \ No newline at end of file diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass index 91859f1a5b8df26461273cea8cfeef70b1c342de..b2956dd57043f41c5b23592089a26ab786aa0a2f 100644 --- a/assets/sass/_theme/hugo-osuny.sass +++ b/assets/sass/_theme/hugo-osuny.sass @@ -56,6 +56,7 @@ @import blocks/pages @import blocks/persons @import blocks/posts +@import blocks/projects @import blocks/programs @import blocks/sitemap @import blocks/sound diff --git a/assets/sass/_theme/utils/shame.sass b/assets/sass/_theme/utils/shame.sass index 06d55f98cdcbaa9b87ee490f14194d6cf5a658a1..1be170d21d897d77612726d2666090c4d977098b 100644 --- a/assets/sass/_theme/utils/shame.sass +++ b/assets/sass/_theme/utils/shame.sass @@ -30,8 +30,8 @@ img display: block object-fit: cover - @if $article-media-aspect-ratio - aspect-ratio: $article-media-aspect-ratio + @if $aspect-ratio + aspect-ratio: $aspect-ratio h2, h3, [itemprop=headline], [itemprop=name] @include h3 a diff --git a/config.yaml b/config.yaml index e0e28f7530e8c3b8e85f3f2130471f233f352828..38b0724b3c95306793197b12e432efd4ef850d36 100644 --- a/config.yaml +++ b/config.yaml @@ -83,10 +83,11 @@ params: whatsapp: false projects: default_image: false - date_format: ":date_long" + date_format: "2006" index: show_categories: true show_description: true + show_year: false truncate_description: 200 # Set to 0 to disable truncate layout: list # grid | list share_links: diff --git a/i18n/en.yml b/i18n/en.yml index 431275af953a92926f34a239cf9d3f20800d284a..16a2bf4d9eaf02f9aa7310fa3f04e1c3fa570fb9 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -223,7 +223,7 @@ posts: next: Next article next_aria: Next article “{{ .Title }}†previous: Previous article - previous_aria: revious article “{{ .Title }}†+ previous_aria: Previous article “{{ .Title }}†reading_time: Reading time see_all: See all posts see_all_in_program: See all program's news @@ -231,6 +231,24 @@ posts: share: Please, share share_aria: Share on “{{ .Title }}†- extern link title: News +projects: + author: Author + category: + one: Category + other: Categories + informations: Informations + next: Next project + next_aria: Next project “{{ .Title }}†+ previous: Previous project + previous_aria: Previous project “{{ .Title }}†+ reading_time: Reading time + see_all: See all posts + see_all_in_program: See all program's projects + see_all_in_category: See all projects in “{{ .Title }}†+ share: Please, share + share_aria: Share on “{{ .Title }}†- extern link + title: Projects + year: Year programs: accessibility: Accessibility administrative_information: Administrative information diff --git a/i18n/fr.yml b/i18n/fr.yml index 50a84f11eab8a769f344086166e89f4b28ab96df..cfc4cd02c44ea65690469b99ce44e38d55cc24a2 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -232,13 +232,11 @@ posts: share: Partager sur share_aria: Partager sur “{{ .Title }}†- lien externe title: Actualités - projects: author: Auteur·rice category: one: Catégorie other: Catégories - date: Date informations: Informations next: Projet suivant next_aria: Projet suivant “{{ .Title }}†@@ -251,6 +249,7 @@ projects: share: Partager sur share_aria: Partager sur “{{ .Title }}†- lien externe title: Projets + year: Année programs: accessibility: Accessibilité administrative_information: Informations administratives diff --git a/layouts/partials/blocks/templates/projects.html b/layouts/partials/blocks/templates/projects.html new file mode 100644 index 0000000000000000000000000000000000000000..126f09b24cd66b91c59e46592744c996b09f954e --- /dev/null +++ b/layouts/partials/blocks/templates/projects.html @@ -0,0 +1,22 @@ +{{- $block := .block -}} +{{- $block_title := .block.title -}} +{{- $block_class := partial "GetBlockClass" .block -}} +{{- $layout := "grid" -}} + +{{- with .block.data -}} + <div class="{{ $block_class }}"> + <div class="container"> + <div class="block-content"> + {{ partial "blocks/top.html" (dict + "title" $block_title + "heading_level" $block.ranks.self + ) }} + + {{- partial (printf "blocks/templates/projects/%s.html" $layout) (dict + "projects" .projects + "heading_level" $block.ranks.children + ) }} + </div> + </div> + </div> +{{- end -}} diff --git a/layouts/partials/blocks/templates/projects/grid.html b/layouts/partials/blocks/templates/projects/grid.html new file mode 100644 index 0000000000000000000000000000000000000000..23ccf769a376c88b7d98e41a92aed02d1e75887f --- /dev/null +++ b/layouts/partials/blocks/templates/projects/grid.html @@ -0,0 +1,12 @@ +{{ $heading_level := .heading_level | default 3 }} +{{ $heading := printf "h%d" $heading_level }} +<div class="grid"> + {{ range $project := .projects -}} + {{ with site.GetPage .file }} + {{ partial "projects/project.html" (dict + "project" . + "heading" $heading + ) }} + {{ end }} + {{ end }} +</div> diff --git a/layouts/partials/blocks/templates/projects/list.html b/layouts/partials/blocks/templates/projects/list.html new file mode 100644 index 0000000000000000000000000000000000000000..70667caeaa211375bdcdfc771353dbe57f2bbaf9 --- /dev/null +++ b/layouts/partials/blocks/templates/projects/list.html @@ -0,0 +1,12 @@ +{{ $heading_level := .heading_level | default 3 }} +{{ $heading := printf "h%d" $heading_level }} +<div class="list"> + {{ range $project := .projects -}} + {{ with site.GetPage .file }} + {{ partial "projects/project.html" (dict + "project" . + "heading" $heading + ) }} + {{ end }} + {{ end }} +</div> diff --git a/layouts/partials/projects/project-infos.html b/layouts/partials/projects/project-infos.html index 14f26f1ba16f63b93cc96c5c45d2a1cb8c81a046..e33502c59b879e6ca8e207d9a43fea21e81410ed 100644 --- a/layouts/partials/projects/project-infos.html +++ b/layouts/partials/projects/project-infos.html @@ -5,10 +5,12 @@ {{ partial "projects/categories.html" . }} </li> {{ end }} - <li> - <span>{{ i18n "projects.date" }}</span> - <time datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.projects.date_format }}</time> - </li> + {{ with .Params.year }} + <li> + <span>{{ i18n "projects.year" }}</span> + <time datetime="{{ . }}">{{ . }}</time> + </li> + {{ end }} <li class="social-share"> <span>{{ i18n "projects.share" }}</span> {{ partial "commons/share.html" . }} diff --git a/layouts/partials/projects/project.html b/layouts/partials/projects/project.html index de3995903122380a53382f5520efade68934ce48..c7ec5b2829b8440a7bacdaf57a5554e731d6bb09 100644 --- a/layouts/partials/projects/project.html +++ b/layouts/partials/projects/project.html @@ -26,10 +26,12 @@ {{ if site.Params.projects.index.show_categories }} {{- partial "projects/categories" . -}} {{ end }} - - <div class="project-meta"> - <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format site.Params.projects.date_format }}</time> - </div> + + {{ if and site.Params.projects.index.show_year .Params.year }} + <div class="project-meta"> + <time itemprop="datePublished" datetime="{{ .Params.year }}">{{ .Params.year }}</time> + </div> + {{ end }} </div> <div class="media">