dpc-sdp / ripple

Ripple is the frontend framework for Single Digital Presence, delivered using Nuxt and Vue.js
Apache License 2.0
61 stars 37 forks source link

[SDPAP-5916] Updated robots.txt generation so it's part of ripple-nuxt-tide, updated list of excludedPaths. #1230

Closed lambry closed 1 year ago

lambry commented 1 year ago

Motivation and Context

As a content editor I don’t want my CMS preview pages indexed by search engines so the public can’t access non published pages.

JIRA issue: https://digital-vic.atlassian.net/browse/SDPAP-5916

Changed

  1. Updated robots.txt generation so it's part of ripple-nuxt-tide, this is opt in so existing sites can still manage their own robots.txt generation.
  2. Updated list of excludedPaths to include preview urls, oauth urls and the share url.

Screenshots

Here's three screenshots showing robots.txt working with the three config options, i.e. boolean, object and array. They all have Disallow: '/' because it's not production.

robots-array robots-object robots-true

How Has This Been Tested?

This has been tested in browser locally, still needs testing on 'staging'. Does this change need tests written?

Types of changes

Checklist

dylankelly commented 1 year ago

@lambry Ideally this is something I would like to unit test - however the current Ripple 1 setup doesn't have great tooling for this at the moment.