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

Bad date error reporting for frontmatters is inscrutable. #782

Open
artemislena opened this issue Jul 24, 2020 · 6 comments
Open

Bad date error reporting for frontmatters is inscrutable. #782

artemislena opened this issue Jul 24, 2020 · 6 comments
Labels
bug Not as expected

Comments

@artemislena
Copy link

artemislena commented Jul 24, 2020

Given the following file as a post or page:

---
layout: default.liquid

title: Test
permalink: /2020/07
published_date: 2020-07-24
---
#Test!

This is a test. Lorem Ipsum Dolor Sit Amet.

cobalt build returns
Error: build command failed Info: caused by Failed to parse posts/2020/07/testpost.md Info: caused by premature end of input at line 1 column 7. Strangely, when copying the default post-1.md into said file and changing it so it is basically the same, it doesn't show this behaviour.

@artemislena
Copy link
Author

artemislena commented Jul 24, 2020

With --log-level=debug, I get this:

[debug] Using config file "/home/fantasycookie17/fantasycookie17.onederfultech.com/_cobalt.yml"
[info] Building from "/home/fantasycookie17/fantasycookie17.onederfultech.com/" into "/home/fantasycookie17/fantasycookie17.onederfultech.com/_site"
[debug] glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)\\.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) }
[debug] built glob set; 2 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 2 regexes
[debug] glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)\\.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "posts/**/*", re: "(?-u)^posts(?:/|/.*/)[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([Literal('p'), Literal('o'), Literal('s'), Literal('t'), Literal('s'), RecursiveZeroOrMore, ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "posts/**/_*", re: "(?-u)^posts(?:/|/.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([Literal('p'), Literal('o'), Literal('s'), Literal('t'), Literal('s'), RecursiveZeroOrMore, Literal('_'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "posts/**/_*/**/*", re: "(?-u)^posts(?:/|/.*/)_[^/]*(?:/|/.*/)[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([Literal('p'), Literal('o'), Literal('s'), Literal('t'), Literal('s'), RecursiveZeroOrMore, Literal('_'), ZeroOrMore, RecursiveZeroOrMore, ZeroOrMore]) }
[debug] built glob set; 2 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 5 regexes
[debug] Loading data from "/home/fantasycookie17/fantasycookie17.onederfultech.com/_data"
[debug] glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)\\.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) }
[debug] built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 2 regexes
[debug] Loading snippets from "/home/fantasycookie17/fantasycookie17.onederfultech.com/_includes"
[debug] glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)\\.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) }
[debug] glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) }
[debug] built glob set; 1 literals, 0 basenames, 2 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 2 regexes
Error: build command failed
Info: caused by Failed to parse posts/2020/07/testpost.md
Info: caused by premature end of input at line 1 column 7

@epage
Copy link
Member

epage commented Jul 25, 2020

I think the debug output's newlines got lost.
(granted, I don't think there is something in there to help)

@epage
Copy link
Member

epage commented Jul 25, 2020

What version of cobalt

@artemislena
Copy link
Author

--version shows Cobalt 0.16.0. The latest version from Github Releases. I think the newlines got lost due to how (Github) Markdown works… Anyway, running with --trace shows that the file is opened only after all the debug output, so it is indeed not too helpful here.

@epage
Copy link
Member

epage commented Jul 25, 2020

Wow, this is some terrible error reporting.

Cobalt expects full date/times to be passed in for published_date.

For example

published_date: "2020-07-24 07:05:20 +0100"

An easy way of working with this is to use cobalt new to create documents and then cobalt publish to get them out of draft-state.

@epage epage changed the title Premature end of input Bad date error repotting for frontmatter's is inscrutable. Jul 25, 2020
@epage epage added the bug Not as expected label Jul 25, 2020
@artemislena
Copy link
Author

Seems like it indeed is. Thanks for the hint, that fix seems to work.

@artemislena artemislena changed the title Bad date error repotting for frontmatter's is inscrutable. Bad date error reporting for frontmatter's is inscrutable. Jul 25, 2020
@artemislena artemislena changed the title Bad date error reporting for frontmatter's is inscrutable. Bad date error reporting for frontmatters is inscrutable. Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

No branches or pull requests

2 participants