diff --git a/layouts/index.html b/layouts/index.html index 1c7b0e34b339b63c08514e5912ad63ba69e31b97..ee48d39ae32f4e591c01bf3ca6f59fe9412d35de 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -32,6 +32,4 @@ </section> {{ end }} </div> - {{ end }} -{{/* TODO: refacto avec pages/list.html */}} \ No newline at end of file diff --git a/layouts/partials/blocks/templates/pages/cards.html b/layouts/partials/blocks/templates/pages/cards.html index 7ca088c4851bc35834a4e5ad34a32161d3408d1d..30ee5e70794a3149523e0e88c1cff9b91a469a55 100644 --- a/layouts/partials/blocks/templates/pages/cards.html +++ b/layouts/partials/blocks/templates/pages/cards.html @@ -4,10 +4,6 @@ <div class="cards"> {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} - {{- if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{- end -}} {{ with $page }} <article class="card"> <h3> diff --git a/layouts/partials/blocks/templates/pages/grid.html b/layouts/partials/blocks/templates/pages/grid.html index a8ff4128d3d9de87d1481ad499a1c46c232c2982..54c096d8c0fc39f816de0ef79d91589aa05a4c3a 100644 --- a/layouts/partials/blocks/templates/pages/grid.html +++ b/layouts/partials/blocks/templates/pages/grid.html @@ -4,15 +4,9 @@ <div class="grid"> {{ range .pages }} {{- $page := false -}} - - {{/* Check if . is a map or page url */}} + {{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}} {{ if reflect.IsMap . }} - {{- if .page -}} - {{- $page = partial "GetPageByUrl" .page -}} - {{- else if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{ end }} + {{- $page = partial "GetPageByUrl" .page -}} {{ else }} {{- $page = partial "GetPageByUrl" . -}} {{ end }} diff --git a/layouts/partials/blocks/templates/pages/list.html b/layouts/partials/blocks/templates/pages/list.html index f30cb416d2672df18b51fb0562d2d89c035478ed..7f1d103b3fedf403763491f425289418622a9ddc 100644 --- a/layouts/partials/blocks/templates/pages/list.html +++ b/layouts/partials/blocks/templates/pages/list.html @@ -1,10 +1,6 @@ <ul> {{ range .pages }} {{- $page := partial "GetPageByUrl" .page -}} - {{- if .slug -}} - {{/* LEGACY */}} - {{- $page = partial "GetPageByUrl" .slug -}} - {{- end -}} {{ with $page }} <li> <a href="{{- .Permalink -}}">