Skip to content

[Bug]: Can't generate XML - syntax issue #14

@Perzonallica

Description

@Perzonallica

What happened?

I installed the package and wanted to try it out, however due to the following issue I couldn't:

syntax error, unexpected identifier "version" (View: ...../vendor/the-3labs-team/laravel-googlenews-sitemap/resources/views/sitemap.blade.php)

When I modified the mentioned file to the following, it started to work.

@php echo '<?xml version="1.0" encoding="UTF-8"?>'; @endphp
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
    @foreach ($tags as $tag)
        <url>
            <loc>{{ $tag->url }}</loc>
            <news:news>
                <news:publication>
                    <news:name>{{ $tag->authorName }}</news:name>
                    <news:language>{{ $tag->language }}</news:language>
                </news:publication>
                <news:publication_date>{{ $tag->lastModificationDate }}</news:publication_date>
                <news:title>{{ $tag->title }}</news:title>
            </news:news>
        </url>
    @endforeach
</urlset>

So, I wanted to publish the view file, but I got:

INFO No publishable resources for tag [laravel-googlenews-sitemap-views].

I wanted to manually override it by creating the file manually in resources/views/vendor/laravel-googlenews-sitemap/sitemap.blade.php, but it doesn't seems to be working either.

How to reproduce the bug

Install the package on Laravel 11 and try to generate a Google News Sitemap.

Package Version

1.0.1

PHP Version

8.3

Laravel Version

11.41.0

Which operating systems does with happen with?

macOS

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions