Skip to content
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

not hidden automatically page with draft = true #1792

Closed
gebv opened this issue Jan 24, 2016 · 5 comments
Closed

not hidden automatically page with draft = true #1792

gebv opened this issue Jan 24, 2016 · 5 comments
Labels

Comments

@gebv
Copy link

gebv commented Jan 24, 2016

If you change page draft = false on draft = true then the page still available. After restarting hugo, page becomes is not available

hugo v0.15 running, follow command
hugo server --source=$(PATH) --port=$(PORT) --appendPort=false --baseURL=$(BASEURL)
Config

builddraft=false
@gebv
Copy link
Author

gebv commented Jan 24, 2016

The bug is reproduced in version v 0.16-DEV

@bep
Copy link
Member

bep commented Jan 24, 2016

builddraft=false

It is draft not builddraft.

It feels like this is a question that would be better suited to the Hugo Discussion Forum. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

@bep bep closed this as completed Jan 24, 2016
@gebv
Copy link
Author

gebv commented Jan 25, 2016

@bep documentation says

# include content marked as draft
buildDrafts:                false

I expect to get in a case 3 page 404. Not right?

$ hugo new site testdraft 
$ cd testdraft

[case 1]
$ echo '+++
draft = true
+++' > content/page1.md
$ nohup hugo server > hugo_server.log 2>&1 & echo $$! > hugo_server.pid
[1] 51329
$ curl -I http://127.0.0.1:1313/page1/
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Mon, 25 Jan 2016 04:18:03 GMT
Content-Length: 19

[case 2]
$ echo '+++
draft = false
+++' > content/page1.md
$ curl -I http://127.0.0.1:1313/page1/
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 0
Content-Type: text/html; charset=utf-8
Last-Modified: Mon, 25 Jan 2016 04:18:33 GMT
Date: Mon, 25 Jan 2016 04:18:35 GMT

[case 3]
$ echo '+++
draft = true
+++' > content/page1.md
$ curl -I http://127.0.0.1:1313/page1/
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 0
Content-Type: text/html; charset=utf-8
Last-Modified: Mon, 25 Jan 2016 04:18:33 GMT
Date: Mon, 25 Jan 2016 04:19:07 GMT
$

hugo_server.log

$ cat hugo_server.log
0 of 1 draft rendered
0 future content
0 pages created
0 paginator pages created
0 tags created
0 categories created
in 5 ms
Watching for changes in /Users/egorbachurin/_tmp/testdraft/{data,content,layouts,static}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Change detected, rebuilding site
2016-01-25 10:18 +0600
0 draft content
0 future content
1 pages created
0 paginator pages created
0 tags created
0 categories created
in 5 ms

Change detected, rebuilding site
2016-01-25 10:19 +0600
0 of 1 draft rendered
0 future content
0 pages created
0 paginator pages created
0 tags created
0 categories created
in 4 ms

@mariushop
Copy link

This is still a bug in v0.95.0, should not be closed.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants