Untitled

 avatar
tommydalton
plain_text
21 days ago
905 B
2
Indexable
Never
{% 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 ??? '' }}" #}
Leave a Comment