Giter Club home page Giter Club logo

Comments (3)

flaviocopes avatar flaviocopes commented on August 27, 2024

Strange, I tried and when I set published: false an a translation of the page, the alternate disappears.

from grav-plugin-sitemap.

redrohX avatar redrohX commented on August 27, 2024

That's odd. What I get back from $page->translatedLanguages() in sitemap.php are all the local pages if they exist. There doesn't seem to be a check for published: true.

So just to be clear. My default language is en. Then I have nl-nl, fr-fr and en-gb.
This is the structure:

/page-title
   blog-post.de-de.md <-- published: false
   blog-post.en.md <-- published: true
   blog-post.nl-nl.md <-- published: false

What I see in my sitemap.xml for the default language on md.dev/sitemap.xml:

<url>
    <loc>http://www.md.dev/blog/page-title</loc>
    <xhtml:link rel="alternate" hreflang="en" href="http://www.md.dev/blog/page-title" />
    <xhtml:link rel="alternate" hreflang="nl-nl" href="http://www.md.dev/nl-nl/blog/page-title" />
    <xhtml:link rel="alternate" hreflang="de-de" href="http://www.md.dev/de-de/blog/page-title" />
    <lastmod>2017-05-16</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>

Yes the page is not available in the sitemap for nl-nl, but it already shouldn't be visible as alternate for the default language either.

Is there something I'm missing here?

from grav-plugin-sitemap.

flaviocopes avatar flaviocopes commented on August 27, 2024

I tested it again, but I cannot replicate the problem. Maybe send me your user/ folder on Slack so I can replicate on your same page structure and config.

from grav-plugin-sitemap.

Related Issues (20)

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.