Hi there, I'm trying to create new posts with nikola but it's not working. When I create my post file and run `nikola new post`, I get several python errors saying it couldn't find a date or failed to parse an empty string as a date. I'm probably doing something wrong but I dont't know what. Does anyone know what the problem might be? I tried entering the date in several different formats but it always gives me the same errors/stack trace.
date strings I tried:
2017-08-23
2017-08-23T19:41:13+00:00
2017-08-23 19:41:13 UTC
2017-08-23T15:41:42-04:00
2017-08-23 15:41:42 America/New_York
system setup:
I'm running this in a python3 virtual environment on a Fedora 26 system (my home computer)
After setting up the virtualenv I ran these commands:
pip install --upgrade setuptools pip wheel
pip install --upgrade Nikola[extras]
nikola init --demo my_first site
cd my_first site && nikola build
my post file (2.md):
title: My First Blog Post with markdown
slug: my-first-blog-post-wit-markdown
date: 2017-08-23
tags: blog,website,test
category: test
Testing testing, is this working?
command and stack trace:
(venv) [skyler@new-host-2 posts]$ nikola new_post -f markdown 2.md
Creating New Post
-----------------
Title: My First Blog Post With Markdown
Scanning posts..[2017-08-23T19:32:44Z] ERROR: Nikola: Missing date in file posts/2.md
[2017-08-23T19:32:44Z] ERROR: scan_posts: Error reading post posts/2.md
[2017-08-23T19:32:44Z] ERROR: Nikola: Error reading timeline
Traceback (most recent call last):
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/utils.py", line 926, in to_datetime
value = dateutil.parser.parse(value)
File "/home/skyler/venv/lib64/python3.6/site-packages/dateutil/parser.py", line 1182, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File "/home/skyler/venv/lib64/python3.6/site-packages/dateutil/parser.py", line 562, in parse
raise ValueError("String does not contain a date.")
ValueError: String does not contain a date.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/post.py", line 210, in __init__
self.date = to_datetime(self.meta[self.default_lang]['date'], tzinfo)
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/utils.py", line 931, in to_datetime
raise ValueError('Unrecognized date/time: {0!r}'.format(value))
ValueError: Unrecognized date/time: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/skyler/venv/lib64/python3.6/site-packages/doit/doit_cmd.py", line 167, in run
return command.parse_execute(args)
File "/home/skyler/venv/lib64/python3.6/site-packages/doit/cmd_base.py", line 120, in parse_execute
return self.execute(params, args)
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/plugin_categories.py", line 134, in execute
return self._execute(options, args)
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/plugins/command/new_post.py", line 349, in _execute
self.site.scan_posts()
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/nikola.py", line 2178, in scan_posts
timeline = p.plugin_object.scan()
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/plugins/misc/scan_posts.py", line 101, in scan
destination_base=destination_translatable
File "/home/skyler/venv/lib64/python3.6/site-packages/nikola/post.py", line 217, in __init__
raise ValueError(msg)
ValueError: Missing date in file posts/2.md