mitydigital / statamic-feedamic

An Atom and RSS feed for Statamic 3, 4 and 5
https://docs.mity.com.au/feedamic
8 stars 9 forks source link

Blogs Not Filtered Properly on Google News #13

Closed Omerko96 closed 1 year ago

Omerko96 commented 1 year ago

Bug description

Hello, I have a website on Statamic which supports 2 languages. English, and Italian. The languages are split by locale, and the website uses a standard multi-site architecture that Statamic suggests.

Below, you can find the links to blog for both languages, as well as the feed for those. There you will see that languages are properly filtered.

https://ungeracademy.com/blog https://ungeracademy.com/it/blog

https://ungeracademy.com/feed https://ungeracademy.com/it/feed

Still, on the Google News, all blogs are together, and not filtered by the language, even though the configuration is the right one.

https://news.google.com/u/1/publications/CAAqBwgKMOOstQsw8MfMAw?hl=en-US&gl=US&ceid=US:en https://news.google.com/u/1/publications/CAAqBwgKMMWttQsw0sjMAw?hl=it&gl=IT&ceid=IT:it&pageId=none

Can I get a bit more info? Is there anything additional that I should do, or is this some kind of a bug?

Thank You!

Steps to reproduce

There are no specific steps to reproduce this, but I will share the configuration for Feedamic, so you can see.

`<?php

return [

/*
|--------------------------------------------------------------------------
| Feeds
|--------------------------------------------------------------------------
|
| Ability to define Atom and RSS feed routes.
|
| You can create as many feeds as you like in the key:value setup, and even
| override some defaults (or use defaults) to make your config simpler.
|
| The key is used as a reference to your feed, and is used as part of the
| cache key for the feed.
|
*/

'feeds' => [
    'blog' => [
        /*
        | The title for the feed
        */
        'title' => '',

        /*
        | The description (RSS) or subtitle (Atom) for the feed
        */
        'description' => '',

        /*
        | Define the Atom and RSS routes for the feed.
        | By default, an atom and RSS 2.0 feed will be generated.
        | Remove from the array to disable a specific feed type.
        */
        'routes' => [
            'atom' => '/feed/atom',
            'rss' => '/feed',
        ],

        /*
        | The alternative link used. If omitted, will be the app.url value - which is fine too
        */
        'alt_url' => '',

        /*
        | An array of collections to include in the feed
        | Remove from the array to disable a specific feed type.
        */
        'collections' => [
            'blog'
        ],

        'locales' => 'current',

        /*
        | You can also override the following configuration for feed-specific
        | values:
        |   - author
        |   - copyright
        |   - image
        |   - language
        |   - limit
        |   - summary
        */
        /*
        For example, this summary would only apply to this feed:
        'summary' => [
            'short_intro',
            'introduction'
        ],
        Or, only allowing 10 entries to be returned for a specific feed
        'limit' => 10
         */

    ],
    'blogit' => [
        /*
        | The title for the feed
        */
        'title' => '',

        /*
        | The description (RSS) or subtitle (Atom) for the feed
        */
        'description' => '',

        /*
        | Define the Atom and RSS routes for the feed.
        | By default, an atom and RSS 2.0 feed will be generated.
        | Remove from the array to disable a specific feed type.
        */
        'routes' => [
            'atom' => '/it/feed/atom',
            'rss' => '/it/feed',
        ],

        /*
        | The alternative link used. If omitted, will be the app.url value - which is fine too
        */
        'alt_url' => '',

        /*
        | An array of collections to include in the feed
        | Remove from the array to disable a specific feed type.
        */
        'collections' => [
            'blog'
        ],

        'locales' => 'current',

        /*
        | You can also override the following configuration for feed-specific
        | values:
        |   - author
        |   - copyright
        |   - image
        |   - language
        |   - limit
        |   - summary
        */
        /*
        For example, this summary would only apply to this feed:
        'summary' => [
            'short_intro',
            'introduction'
        ],
        Or, only allowing 10 entries to be returned for a specific feed
        'limit' => 10
         */

    ],
],

/*
|--------------------------------------------------------------------------
| Cache Key
|--------------------------------------------------------------------------
|
| The base cache key for output.
|
| Will be cached forever until EventSaved is fired, or you manually clear the cache.
|
*/

'cache' => 'feedamic',

/*
|--------------------------------------------------------------------------
| DEFAULTS: Summary
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| A list of blueprint fields to look at to try to build the "summary" for the feed.
|
| This is ordered - the first field will be looked first, then the second, etc.
|
| When content is found, it will be used, and other fields will be ignored.
|
*/

'summary' => [
    'introduction',
    'meta_description'
],

/*
|--------------------------------------------------------------------------
| DEFAULTS: Image
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| Configuration options for the image to be injected in to the "summary" for the entry.
|
| This only applies when Summary is being used.
|
| The Fields behave like summary - a cascading list of image fields to look at. You can specify the width
| and height too to use for the image generation. If omitted, will be 1280 x 720.
|
| Disable this by setting to false.
|
*/

'image' => [
    'fields' => [
        'hero',
        'meta_og_image'
    ],
    'width' => 1280,
    'height' => 720
],

/*
|--------------------------------------------------------------------------
| DEFAULTS: Author
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| Sets the lookup of an author field.
|
| Set to "false" to disable looking for author details.
|
| If used,
|   "handle" defines the blueprint reference to the author, a Statamic user
|   "email", when true, will output the <email> for atom feeds
|   "name", a pattern to use to build the name output
|
| For "name", each handle is in square brackets, and is used to concatenate fields if you are using
| or want to customise the name output. For example, "[name_first] [name_last]" would pick "name_first"
| and "name_last" from the User.
|
*/

'author' => [
    'handle' => 'author',

    // true to include the email in the feed, false to exclude - atom only
    'email' => false,

    // the name pattern to use for the author name
    'name' => '[name]',
],

/*
|--------------------------------------------------------------------------
| DEFAULTS: Copyright
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| A string to output to the <copyright> (RSS) or <rights> (Atom) feed.
|
| False will exclude this element.
|
*/

'copyright' => false,

/*
|--------------------------------------------------------------------------
| DEFAULTS: Language
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| Marks the feed as being in a specific language.
|
| As Atom, using xml:lang, can use more language definitions than the RSS specification, refer to the
| RSS specification for suitable codes:
|   https://www.rssboard.org/rss-language-codes
|
*/

'language' => 'en',

/*
|--------------------------------------------------------------------------
| DEFAULTS: Limit
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| Limits the number of entries returned in a feed.
|
*/

'limit' => null,

/*
|--------------------------------------------------------------------------
| DEFAULTS: Locales
|--------------------------------------------------------------------------
|
| This is the default that applies to all configured 'feeds', unless overwritten
| for a specific feed configuration.
|
| Limits the entries local to a list of locales, e. g.
| 'locales' => ['com', 'uk']
|
| To include only the current locale, provide the special 'current' string:
| 'locales' => 'current'
|
| When not set or null, all locales will be included.
|
*/

'locales' => null,

];`

Environment and versions

Statamic 3.3.62 Pro
Laravel 8.83.27
PHP 8.1.2
Stache Watcher Enabled
Static Caching Disabled
withcandour/aardvark-seo 2.0.30

Additional details

No response

martyf commented 1 year ago

Not too sure to be honest, sorry. It appears to be something with Google News.

If you look at the output of each feed, you'll see that the "feed" and "it/feed" routes are correctly outputting each site's posts.

Do you know how Google News is meant to be handling multiple languages? The Feedamic feeds themselves are correct.

Omerko96 commented 1 year ago

Just an update... I still didn't fix the issue.

It seems that multi-site for Statamic, it runs on the same site, just uses different locale. I guess that Google News can read posts by different language, as long as those are separated, but this will require me to build almost, maybe even fully separate site for different language. This is not sustainable if more languages will be added in the future.

With this info, do you have any suggestions on handling multi-site structure of Statamic with using your Feedamic addon?

Thanks!

martyf commented 1 year ago

I'm still not really sure on what the issue is... Feedamic is handling multi-site feeds - there's one for each site you define, so in your case a default feed (English) and an "it" feed.

Each feed links to the appropriate site's entry - so default links to the base version, and "it" links to the "it" site version.

Sorry, just a bit confused with what the issue is?

martyf commented 1 year ago

Closed due to inactivity

Omerko96 commented 1 year ago

Hi Marty,

Yes, and it does work as it suppose to, but on the news.google it is not filtering posts for both languages.

In the examples below, you will see one US and one IT page, but on both pages, there are mixed posts if you scroll down a bit.

And that is the main issue here.

Thanks!

martyf commented 1 year ago

This is not a Feedamic issue though. Your two feeds are correct - if Google is not displaying something correctly, that's a Google issue. You'll need to raise this with them, as your two feeds (US and IT) are showing the correct items.