Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 1.68 KB

Sitemap.md

File metadata and controls

58 lines (43 loc) · 1.68 KB

Sitemap

CleanDeck automatically generates a sitemap for your application.

By default, the sitemap is available through the endpoint GET /sitemap.xml. The default sitemap endpoint is specified also by file Application/public/robots.txt.

The sitemap is built using two types of sources:

  1. entries generated by CMD-Auth which covers articles and FAQs
  2. any GET endpoints having sitemap instructions (see below section 2. Custom Sitemap)

1. CMD-Auth Sitemap (articles and FAQs)

When adding or editing articles and FAQs, CMD-Auth requires valid sitemap data.

No further action required from your side.

2. Custom Sitemap

When defining GET routes in files GETRoutes.php, you can provide sitemap instruction through the $sitemap_settings parameter of method $routes->add(...).

When using $sitemap_settings the following standard sitemap instructions can be provided for each GET route:

  • changefreq (mandatory)
  • priority (mandatory)
  • other standard sitemap instructions

For example:

// file Application/Instance/Routes/GETRoutes.php
$routes->add(
    '/',
    HomeController::class,
    'index',
    [
        AAAInit::class,
        ApplicationStatusJWT::class,
        UserDetails::class,
        HttpCaching::class => ['interval' => 3600],
        CSP::class,
        SEO::class,
    ],
    [
        'changefreq' => 'daily',
        'priority' => 0.9,
    ]
);

3. Sitemap and SEO optimizations

The Sitemap and SEO optimizations are decoupled. An endpoint can be added to sitemap without being SEO optimized.

SEO optimizations can be enabled by adding SEO::class to the list of middleware for each GET endpoint.