PHPackages                             omz13/kirby3-htmlsitemap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. omz13/kirby3-htmlsitemap

AbandonedArchivedKirby-plugin

omz13/kirby3-htmlsitemap
========================

kirby3 plugin to generate a html-based (user-facing) sitemap

0.2.0(7y ago)27511MITPHPPHP &gt;=7.1

Since Aug 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/omz13/kirby3-htmlsitemap)[ Packagist](https://packagist.org/packages/omz13/kirby3-htmlsitemap)[ RSS](/packages/omz13-kirby3-htmlsitemap/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (10)Versions (4)Used By (1)

Kirby3 htmlsitemap
==================

[](#kirby3-htmlsitemap)

[![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667) [![Kirby Version](https://camo.githubusercontent.com/c2f0818e24321b0d1cbbf44990fc94c472912ec8f23f64030272c2e2ee66324a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b697262792d332532422d626c61636b2e737667)](https://camo.githubusercontent.com/c2f0818e24321b0d1cbbf44990fc94c472912ec8f23f64030272c2e2ee66324a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b697262792d332532422d626c61636b2e737667) [![Issues](https://camo.githubusercontent.com/0d9f5e221f3fe961d5d53cdafae158bf12624ca5e876f04f4d8c8da48d1c51e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f6d7a31332f6b69726279332d68746d6c736974656d61702e737667)](https://github.com/omz13/kirby3-htmlsitemap/issues)

**Requirement:** Kirby 3

Documentation
-------------

[](#documentation)

### Purpose

[](#purpose)

For a kirby3 site, this plugin (*omz13/htmlsitemap*) generates a human-facing html-based sitemap at '/sitemap'.

- Generates an html-based sitemap as a structured unordered list (``).
- Pages or their children can be excluded based in the following criteria, and in the following priority:
    - The homepage is always included.
    - The error page is always excluded; who wants to see the error page?
    - Only pages that have a status of "published" are included, i.e. those with "draft" or "unpublished" are excluded.
    - Unpublished pages can be explicitly included based on their slugname; c.f. `includeUnlistedWhenSlugIs` in *Configuration*.
    - Pages made using certain templates can be excluded; c.f. `excludePageWhenTemplateIs` in *Configuration*.
    - Pages with certain slugnames can be excluded; c.f. `excludePageWhenSlugIs` in *Configuration*.
    - Pages with a content field `excludefromhtmlsitemap` that is `true` are excluded.
    - Pages with a method `issunset` that returns `true` are excluded.
    - Pages with a method `isunderembargo` that returns `true` are excluded.
    - The children of pages made using certain templates can be excluded; c.f. `excludeChildrenWhenTemplateIs` in *Configuration*.
    - The children of pages made using certain templates can be included as anchored links to their parent; c.f. `linkyChildrenWhenTemplateIs` in *Configuration*.
- For debugging purposes, the generated html sitemap can include additional information as html comments; c.f. `debugqueryvalue` in *Configuration*.

*In the current proof-of-concept, the sitemap is a presented as a simple unordered list: it is envisioned that this will be transformed into something with more aesthetics through css.*

#### Related

[](#related)

For a computer-oriented xml-based sitemp, kindly see [omz13/kirby3-xmlsitemap](https://github.com/omz13/kirby3-xmlsitemap).

For a plugin that provides the methods `issunset` and `isunderembargo`, kindly see [omz13/kirby3-suncyclepages](https://github.com/omz13/kirby3-suncyclepages).

#### Caveat

[](#caveat)

Kirby3 is under beta, therefore this plugin, and indeed kirby3 itself, may or may not play nicely with each other, or indeed work at all: use it for testing purposes only; if you use it in production then you should be aware of the risks and know what you are doing.

#### Roadmap

[](#roadmap)

For 1.0, the non-binding list of planned features and implementation notes are:

- MVP
- Debugging option
- Respect page status
- Allow specific unlisted pages to be included c.f. `includeUnlistedWhenSlugIs`
- Exclusion of pages by template – c.f. `excludePageWhenTemplateIs`
- Exclusion of individual pages – c.f. `excludePageWhenSlugIs`
- Exclude embargoed pages
- Exclude sunset pages
- One-pager support c.f. `excludeChildrenWhenTemplateIs` and `linkyChildrenWhenTemplateIs`
- If the site has content at '/sitemap', do not hijack
- Provide tags/snippets to include a html sitemap
- Allow configuration of sitemap `` and `class` attributes.
- Consider style using [slickmap](https://github.com/astuteo/slickmap)
- Consider style using [Pure CSS Tree Menu](https://codepen.io/bisserof/pen/fdtBm)
- Consider style using [CSS to create a simple tree structure with connecting lines](https://gist.github.com/dylancwood/7368914)
- Consider style using [Nested Folders](https://codepen.io/achudars/pen/cAsEJ)
- Cache (DoS mitigation)
- Automate GitHub release – [gothub](https://github.com/itchio/gothub)? [github-release-notes](https://github.com/github-tools/github-release-notes)?

### Installation

[](#installation)

Pick one of the following per your epistemological model:

- `composer require --no-dev omz13/kirby3-htmlsitemap`; the plugin will automagically appear in `site/plugins`.
- Download a zip of the latest release - [master.zip](https://github.com/omz13/kirby3-htmlsitemap/archive/master.zip) - and copy the contents to your `site/plugins/kirby3-htmlsitemap`.
- `git submodule add https://github.com/omz13/kirby3-htmlsitemap.git site/plugins/kirby3-htmlsitemap`.

For the record: installation by composer is cool; supporting installation by zip and submodule was an absolute pain, especially as I am an installation by composer person, so do feel guilted into getting me Coffee, Beer, etc., because this is for *your* benefit and *not mine* (and yes, I would have have preferred to spend my time somewhere warm and sunny instead of being hunched over a keyboard while the snow falls outside and the thermometer shows no inclination to get above 0C).

### Configuration

[](#configuration)

The following mechanisms can be used to modify the plugin's behaviour.

#### via `config.php`

[](#via-configphp)

In your site's `site/config/config.php` the following entries under the key `omz13.xmlsitemap` can be used:

- `disable` : a boolean which, if true, to disable the xmlsitemap functionality (c.f. `xmlsitemap` in *via `site.txt`*).
- `debugqueryvalue` : a string to be as the value for the query parameter `debug` to return the sitemap page with debugging information (embedded as html comments). The global kirby `debug` configuration must also be true for this to work. The url must be to `/sitemap.xml?debug=debugqueryvalue` and not `/sitemap?debug=_debugqueryvalue_` (i.e. the `.xls` part is important). Be aware that the debugging information will show, if applicable, details of any pages that have been excluded (so if you are using this in production and you don't want things to leak, set `debugqueryvalue` to something random). Furthermore, the site debug flag needs to be set too (i.e. the `debug` flag in `site/config.php`).
- !!! `includeUnlistedWhenSlugIs` : an array of slugnames whose pages are to be included if their status is unlisted.
- `excludePageWhenTemplateIs` : an array of templates names whose pages are to be excluded from the xml-sitemap.
- `excludePageWhenSlugIs` : an array of slug names whose pages are to be excluded from the xml-sitemap.
- `excludeChildrenWhenTemplateIs` : an array of templates names whose children are to be ignored (but pages associated with the template is to be included); this is used for one-pagers (where the principal page will be included and all the 'virtual' children ignored).
- `linkyChildrenWhenTemplateIs` : an array of templates names whose children are to be included as anchored links to their parent; this is used for one-pagers (where the principal page will be included and all the 'virtual' children need their own entry in the sitemap). Note that it is your responsibility to ensure that the anchor names are generated by the templates for the child pages.

For example, for the [Kirby Starter Kit](https://github.com/k-next/starterkit), the following would be applicable:

```
