Log in Sign up

How do you generate a sitemap.xml?

How do you generate a sitemap.xml to add to Google Search Console?


7 months ago, 6 replies   developers   sitemap.xml   Edit question

One already exists at your site at the following URL:

/sitemap.xml

You can see the source code for this page on GitHub

Answered 2 years ago · Edit answer

Hmm, for some reason it says "This site can't be reached" when I go to where the sitemap should be — http://joyceling.net/sitemap.xml

Answered 2 years ago · Edit answer

Your site is configured on the 'www' subdomain, so the URL is:

https://www.joyceling.net/sitemap.xml

Which is loading for me - please let me know if you have any questions about this or anything else

Answered 2 years ago · Edit answer

Does this suggest that we can create a sitemap.xml template under "Source code" and play with how xml is getting generated similar to rss?

nb: source code sitemap for blog

I wish to be able to use "noindex" in meta to exclude a page from sitemap.xml and add "robots noindex meta" to the same page. It was standard for Jekyll as I remember, maybe it's a good idea to introduce it as a standard metadata in Blot?

Answered a year ago · Edit answer

Yes, you can modify the sitemap.xml template view and integrate your own custom noindex metadata as you like!

Answered a year ago · Edit answer

For anyone looking for a similar solution (and for David to check if there is a possible mistake), I just edited the sitemap template for my "@lev.lc notes" site, so that any page or post with a custom metadata "noindex: " will be ignored for the sitemap purpose. I don't use the "index: no" syntax because I found it harder to get around with all the "logic-less" of the "mustache" plus I keep the field for an optional comment on a reason why I want the page not to be indexed. I'm using Obsidian, and I can easily locate all the "noindex" pages with the same reason for unindexing and "change my mind".

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 

  {{#allEntries}}
  {{^metadata.noindex}}
    <url>
      <loc>{{blogURL}}{{url}}</loc>
    </url>
  {{/metadata.noindex}}
  {{/allEntries}}

</urlset>

Together with a newly introduced "search: no" meta this setup allows me create the hidden (private) pages on your website, accessible only with the link.

Answered 7 months ago · Edit answer