Coder Social home page Coder Social logo

statamic-sitemapamic's People

Contributors

jacksleight avatar konafets avatar martyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

statamic-sitemapamic's Issues

Call to a member function queryEntries() on null

Bug description

When opening the sitemap.xml path I get the following error:

Call to a member function queryEntries() on null

Screenshot 2023-07-28 at 16 27 54

Steps to reproduce

In my config file, I added the following:

'blog' => [
    'include' => true,
    'frequency' => 'weekly',
    'priority' => '0.7',
    'includeTaxonomies' => false,
],

That is essentially the default. As soon as this is active, I'm getting the error, when I remove it, the error is gone.

Environment and versions

Environment
Laravel Version: 10.16.1
PHP Version: 8.2.8
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single, bugsnag
Mail: postmark
Queue: sync
Session: file

Statamic
Addons: 1
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.13.2 Solo

Statamic Addons
mitydigital/sitemapamic: 2.3.8

Additional details

This is my posts collection yaml:

title: Posts
template: blog/show
layout: layouts/statamic/layout
revisions: false
route: '/blog/{slug}'
date: true
sort_dir: asc
date_behavior:
  past: public
  future: private
preview_targets:
  -
    label: Entry
    url: '{permalink}'
    refresh: true

Global sitemap, linking to each multi-site site

Bug description

Currently, each site has a sitemap, e.g /sitemap.xml, /fr/sitemap.xml etc.

It would be great if it could generate a global file, such as /sitemap-index.xml at the main root, which links to each sites main sitemap. A sitemap of sitemaps if you like.

Steps to reproduce

See above

Environment and versions

Maintenance Mode: OFF

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

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

Statamic
Addons: 2
Antlers: runtime
Sites: 25 (UK / English, Belgium / English, Belgium / French, and 22 more)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.49.0 PRO

Statamic Addons
mitydigital/sitemapamic: 2.3.9
statamic/ssg: 2.2.0


### Additional details

_No response_

Submap URLs when using in single mode

Bug description

Hello. I am not sure whether this is intented or a bug, but when using the addon in single mode, all submap URLs like sitemap_index.xml, sitemap_abc.xml, sitemap_foobar.xml all display global sitemap. I believe the submap links should return 404 instead?

Thank you for the great addon!

Steps to reproduce

  1. Set mode configuration to single.
  2. Go to /sitemap_abc.xml

Environment and versions

Environment
Laravel Version: 10.35.0
PHP Version: 8.1.11
Composer Version: 2.5.3
Environment: local
Debug Mode: ENABLED
URL: 127.0.0.1:8000
Maintenance Mode: OFF

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

Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.38.0 PRO

Statamic Addons
mitydigital/sitemapamic: 2.3.8
statamic/eloquent-driver: 2.10.0

Additional details

No response

How can I generate sitemap for my other locale?

I have a statamic 4.0 project. I have a page collection that has tr and en locales. tr is my default one and its route is site-url.com/ and sitemapamic can automatically generate sitemap for tr locale. But for en locale that has site-url.com/en route, sitemapamic can't generate automatically becaue of that I needed to add en routes to SitemapamicServiceProvider manually but this approach is not viable. Is there any way to make this process automatically?

Entries which are links to external sites are listed

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

Feature: Support global taxonomy routes

Currently collection specific taxonomy routes are supported, eg. /blog/topics/design, but global taxonomy routes aren't, eg. /topics/design. Be great if these could be added.

If you'd consider a PR I'd be happy to give it a go? I guess the defaults config would need to be expanded somehow to cover taxonomies as well as collections.

Add PHP version constraint to composer.json

Bug description

I tried to install this the other day in a project using Statamic 3.3 and PHP 7.4 (because we've not got round to updating yet).

After 'composer requiring', I was greeted by some errors because I'm using an older version of PHP than what this addon supports (fair enough - it's my bad for using an older PHP version).

Just a suggestion but it might be worth adding a PHP version constraint to the composer.json file so even if you try to install on an older PHP version, it won't actually let you install.

Steps to reproduce

Install this addon on a Statamic site running PHP 7.4

Environment and versions

n/a

Additional details

No response

Addon is shows as unlisted in Statamic

Not sure if you were aware but Sitemapamic is appearing as unlisted in the Statamic addons list:

Screenshot 2022-06-09 at 15 43 14

I had the same thing with one of my addons and it was because I hadn't set a "MINIMUM GIT VERSION" in the Marketplace settings. Might be the same issue?

Installed, working for pages, but not for blogs

Bug description

I am not sure what the problem is. I can not getting working to list blog posts in the XML.

I edited config/sitemapamic.php and tried blog and blogs as handle, both don't work. Where can I see the actual handle?

$ ls resources/blueprints/collections/blogs/
blog  blog.yaml

I tried clearing statamic cache and also sitemapamic cache. Both without result. I have the feeling I am loading a different sitemap.xml somehow?

Steps to reproduce

  • Install extension
  • Add blogs collection
  • edit config
  • clear caches
  • go to sitemap.xml

Environment and versions

- Statamic 3.4.9
- PHP 8.1

Additional details

No response

Future Entries get listed (maybe intended)

Bug description

I have a collection with the following configuration:

date_behavior:
  past: public
  future: unlisted

The future entries get listed in the sitemap but that is not what I expected. I get what I want by using private instead of unlisted but then the urls are no longer accessible for people who know them.

Maybe this behavior is intended but feels a little counter intuitive to me. Alternatively a config option would be nice.

Steps to reproduce

Create a collection with the following config:

date_behavior:
  past: public
  future: unlisted

Create an entry in the future and open the generated sitemap.

Environment and versions

Environment
Application Name: Battery Quick Check
Laravel Version: 9.46.0
PHP Version: 8.1.13
Composer Version: 2.4.4
Environment: local
Debug Mode: ENABLED
URL: statamic-bqc.test
Maintenance Mode: OFF

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

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

Statamic
Addons: 4
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.3.63 PRO

Statamic Addons
jacksleight/statamic-miniset: 0.3.1
jonassiewertsen/statamic-livewire: 2.9.0
marcorieser/statamic-vitals: 0.0.5
mitydigital/sitemapamic: 2.3.4

Additional details

No response

sitemap.xml won't be created

  1. I've installed Sitemapamic via composer require mitydigital/sitemapamic, after that step there was no sitemap.xml in the public folder.
  2. Then I published the configuration file to add my collections via php artisan vendor:publish --tag=sitemapamic-config -> No sitemap.xml gets created:
        'defaults' => [
            /*'blog' => [
                'include'   => true,
                'frequency' => 'weekly',
                'priority'  => '0.7'
            ],*/
    
            'seiten' => [
                'include'           => true,
                'frequency'         => 'yearly',
                'priority'          => '0.5',
                'includeTaxonomies' => false,
            ],
    
            'blog' => [
                'include'           => true,
                'frequency'         => 'yearly',
                'priority'          => '0.5',
                'includeTaxonomies' => false,
            ],
    
            'case_studies' => [
                'include'           => true,
                'frequency'         => 'yearly',
                'priority'          => '0.5',
                'includeTaxonomies' => false,
            ],
    
            'tools' => [
                'include'           => true,
                'frequency'         => 'yearly',
                'priority'          => '0.5',
                'includeTaxonomies' => false,
            ]
        ],
    
  3. And after that I cleared caches via: php please sitemapamic:clear -> No sitemap.xml gets created

Additionally I'm wondering why the addon doesn't get listed correctly:
Bildschirmfoto 2022-05-30 um 12 18 27

Am I missing something? Thankful for any hint! ๐Ÿ™‚

Syntax Error in Production Environment

Locally the sitemap gets displayed as expected.

But after deployment I get a 500 error on example.com/sitemap.xml and the laravel.log contains:

[2022-05-31 13:13:11] local.ERROR: syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) {"userId":"f711e3e3-c370-426d-8aa1-a11717e0eb41","exception":"[object] (ParseError(code: 0): syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) at /var/www/virtual/michels/coachingspace/vendor/mitydigital/sitemapamic/src/Models/SitemapamicUrl.php:10)
[stacktrace]

I'm not aware if this concerns the plugin itself or any of my or the servers configurations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.