New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitemap.xml includes not published posts #3180

crohas opened this Issue Oct 24, 2018 · 6 comments


None yet
3 participants

crohas commented Oct 24, 2018

Environment (if reporting a bug)

Python Version: 3.6.5

Nikola Version: 8.0.1

Operating System: Mac


It seems Nikola's sitemap includes not published posts,
but I don't want it to publish private posts.

Is this supposed to be this way?
Or is there a method that I avoid the result?


@Kwpolska Kwpolska self-assigned this Oct 24, 2018

@Kwpolska Kwpolska added this to the v8.0.2 milestone Oct 24, 2018


This comment has been minimized.


Kwpolska commented Oct 24, 2018

Can’t reproduce with .. status: private. Please show the metadata of a post that appears in the sitemap but shouldn’t.


This comment has been minimized.

crohas commented Oct 25, 2018

Sorry for making you confused, I should have told the status properly.
To be honest I do not understand the difference between draft and private well, but even I specified private, got the same result.

For now I'm specifying draft to the post(reST) like the following.

.. title: something
.. tags: React, JavaScript
.. date: 2099-12-31
.. slug: .
.. previewimage: /media/react.png
.. status: draft

And the values (might be relavant it) in are as below:

# DEPLOY_DRAFTS = True # even if I specified anything (also `False`), got same result.

Also the other posts that specified the status as well are not displayed on index.html and also atom.xml.

You might think it weird to specify . to slug. Actually I'm placing posts on not just under posts/, but nesting directories on it.
It means the permalink getting the same with the directory path.

e.g. 2018/post-title/index.rst => posts-prefix/2018/post-title/

I just realized though, it seems that a private post specified a slug expressly on just under posts/ does not appear in a sitemap.
Is this placement of posts unrecommended?


This comment has been minimized.


ralsina commented Oct 25, 2018

Honestly, I don't think we ever considered using "." as a slug and I have no idea what it does :-)


This comment has been minimized.


Kwpolska commented Oct 25, 2018

It sounds as if it would be similar to index.

@crohas, could you try making the post input path /2018/post-title.rst and then making the slug post-title?


This comment has been minimized.

crohas commented Oct 26, 2018

I tried the way you said, and it worked.
But I want to make a directory per post. (some posts require files relating itself in my case)

I'll give up if you decided don't deal with a rare case like this. it's not so hard to make a task to generate a sitemap by myself :)

But honestly I hope you fix it, because it looks an extraction method of sitemap.xml is different from the others. (e.g. index.html, atom.xml)

I know this may cause a problem, but I would be glad if you could consider it.

btw, '.' means current directory path, I think you know that though.
It seems Nikola makes a permalink using relative path from 'posts/' that the post puts and its slug.
e.g. posts/spam/ham.rst and the slug is egg, the permalink is [posts-prefix]/spam/egg/,
Specifying '.' makes a permalink the same with the directory path the post puts on, this is my own way.



This comment has been minimized.


Kwpolska commented Oct 26, 2018

Use index as the slug — that is (a) supported and (b) apparently disables sitemap generation successfully.

@Kwpolska Kwpolska closed this Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment