Skip to content

Commit bb46805

Browse files
committed
Eleventy uses 'collections.all' instead of 'site.pages'
1 parent 7ff8fdd commit bb46805

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/_layouts/default.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
To prevent malicious users from abusing this feature, we build a list of acceptable redirects.
4545
{%- endcomment -%}
4646
var PAGES_ALLOWED = {};
47-
{%- for p in site.pages -%}
48-
{%- if p.title -%}
49-
{% assign collection_name = p.collection_name %}
47+
{%- for p in collections.all -%}
48+
{%- if p.data.title -%}
49+
{% assign collection_name = p.data.collection_name %}
5050
{% unless collection_name %}{% assign collection_name = 'pages' %}{% endunless %}
5151
{%- capture edit_url -%}
52-
{{-'/admin/#/collections/' | relative_url -}}{{- collection_name }}/entries/{{- p.path | split: '/' | last | replace: '.md' -}}
52+
{{-'/admin/#/collections/' | relative_url -}}{{- collection_name }}/entries/{{- p.inputPath | split: '/' | last | replace: '.md' | remove_last: ',' -}}
5353
{%- endcapture -%}
54-
PAGES_ALLOWED['{{ p.title | strip | escape }}'] = '{{ edit_url }}';
54+
PAGES_ALLOWED['{{ p.data.title | strip | escape }}'] = '{{ edit_url }}';
5555
{%- endif -%}
5656
{%- endfor -%}
5757
</script>

docs/_layouts/variation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="o-editor" id="edit-page">
2222
<a
2323
class="a-btn"
24-
href="/design-system/updating-this-website?page={{ title | url_encode }}"
24+
href="/design-system/updating-this-website/?page={{ title | url_encode }}"
2525
title="Edit this page in Decap CMS"
2626
>
2727
<span>Edit page</span>

0 commit comments

Comments
 (0)