Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entries which are links to external sites are listed #12

Closed
wturrell opened this issue May 5, 2023 · 3 comments
Closed

Entries which are links to external sites are listed #12

wturrell opened this issue May 5, 2023 · 3 comments

Comments

@wturrell
Copy link

wturrell commented May 5, 2023

Bug description

In my "news" collection, as well as standard entries, I use entries that redirects to other content.

These should be excluded from the sitemap, because they're on an external site, but currently they are listed with everything else, which causes Google Searchconsole to complain about them.

Steps to reproduce

  • Pick a collection.
  • Go to the collection settings.
  • In the "Content model" section, find "Links" and set "Entries in this collection may contain links (redirects) to other entries or URLs" to yes.
  • Create an entry (link) in this collection with the URL of a third party site.
  • Look at the sitemap and you will see it's been added.

Environment and versions

Environment
Application Name: redacted
Laravel Version: 9.52.4
PHP Version: 8.1.10
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.4.8 Solo

Statamic Addons
jacksleight/statamic-bard-texstyle: 2.1.1
mitydigital/feedamic: 2.2.4
mitydigital/iconamic: 1.1.4
mitydigital/sitemapamic: 2.3.6

Additional details

No response

@martyf
Copy link
Contributor

martyf commented May 5, 2023

Thanks for this... I've release 2.3.7 which addresses this, on the condition of:

  • blueprint called "link" (which Statamic expects)
  • property called "redirect"
  • that value is an external URL

This trio of checks needs to happen because relying on the blueprint name alone isn't enough - Statamic expects a "link" blueprint and a "redirect" property.

Let me know how you go!

@martyf martyf closed this as completed May 5, 2023
@wturrell
Copy link
Author

wturrell commented May 6, 2023

@martyf this works brilliantly, thank you!

@martyf
Copy link
Contributor

martyf commented May 7, 2023

You're welcome 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants