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

Merge pull request #91 from noesya/fix/block-page-legacy

Fix/block page legacy
parents 5366d4a8 08eb3d3e
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,4 @@
</section>
{{ end }}
</div>
{{ end }}
{{/* TODO: refacto avec pages/list.html */}}
\ No newline at end of file
......@@ -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>
......
......@@ -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 }}
......
<ul>
{{ range .pages }}
{{- $page := partial "GetPageByUrl" .page -}}
{{- if .slug -}}
{{/* LEGACY */}}
{{- $page = partial "GetPageByUrl" .slug -}}
{{- end -}}
{{ with $page }}
<li>
<a href="{{- .Permalink -}}">
......
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