Untitled

 avatar
tommydalton
plain_text
a year ago
905 B
5
Indexable
{% header "Content-Type: application/json; charset=utf-8" %}
{% cache %}
[
{% for entry in craft.entries
    .section('pages')
    .type('not playground')
    .orderBy('postDate asc').all ??? [] %}
    {
        "id": {{ entry.id }},
        "title": "{{ entry.title }}",
        "slug": "{{ entry.slug ??? '' }}",
        "url": "{{ entry.url ??? '' }}",
        "seoTitle": "{{ entry.seo.metaGlobalVars.parsedValue('seoTitle') ??? entry.title ??? '' }}",
        "seoDescription": "{{ entry.seo.metaGlobalVars.parsedValue('seoDescription') ??? '' }}",
        "created_at": "{{ entry.postDate.format('Y/m/d') ??? '' }}",
        "updated_at": "{{ entry.dateUpdated.format('Y/m/d') ??? '' }}"
    }{{ not loop.last ? ',' }}
{% endfor %}
]
{% endcache %}
{#  "ext": "page",
    "year": "{{ entry.postDate|date('Y') ??? '' }}",
    "category": "Page",
    "language": "{{ currentSite.language ??? '' }}" #}
Editor is loading...
Leave a Comment