Skip to content

Collection Examples

Johan Janssens edited this page Jun 10, 2019 · 14 revisions

RSS feed

Joomlatools Pages has a built-in template for RSS feeds. To create your own feed, all you need to do is import the built-in template and define the collection for the pages you want to have included in the feed.

---
title: My Site Blog 
summary: There's lots happening on my site, our blog will keep you up-to-date.
collection:
   state:
        path: blog
        recurse: false
        limit: 20
        sort: date
        order: desc
        collection: false
visible: false
---

<?= import('com:pages.pages.newsfeed.rss'); ?>

Sitemap

Joomlatools Pages has a built-in template for sitemaps. To create your own sitemap, all you need to do is import the built-in template.

---
title: Sitemap
collection:
    state:
        path: .
        limit: 0
        sort: date
        order: desc
        recurse: false
visible: false
---

<?= import('com:pages.pages.sitemap.xml'); ?>

Adding pages to the sitemap

By default, all pages will be added to the sitemap. To exclude a certain page from the sitemap, simply add robots: noindex to the page's frontmatter.

---
title: My Page
robots: noindex
---

If you wish to define robots in your metadata you need to define it as an array

metadata:
    robots: [noindex, nofollow]
Clone this wiki locally