Skip to content

Commit 8c336cf

Browse files
committedJan 14, 2017
Document NEW_POST_DATE_PATH
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 2423c64 commit 8c336cf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎docs/manual.txt

+16
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,27 @@ The ``new_post`` command supports some options:
563563
-F, --available-formats List all available input formats
564564
-s Schedule the post based on recurrence rule
565565
-i ARG, --import=ARG Import an existing file instead of creating a placeholder
566+
-d, --date-path Create post with date path (eg. year/month/day, see NEW_POST_DATE_PATH_FORMAT in config)
567+
566568

567569
The optional ``path`` parameter tells Nikola exactly where to put it instead of guessing from your config.
568570
So, if you do ``nikola new_post posts/random/foo.txt`` you will have a post in that path, with
569571
"foo" as its slug.
570572

573+
The ``-d, --date-path`` option automates creation of ``year/month/day`` or
574+
similar directory structures. It can be enabled on a per-post basis, or you can
575+
use it for every post if you set ``NEW_POST_DATE_PATH = True`` in conf.py.
576+
577+
.. code:: python
578+
579+
# Use date-based path when creating posts?
580+
# Can be enabled on a per-post basis with `nikola new_post -d`.
581+
# NEW_POST_DATE_PATH = False
582+
583+
# What format to use when creating posts with date paths?
584+
# Default is '%Y/%m/%d', other possibilities include '%Y' or '%Y/%m'.
585+
# NEW_POST_DATE_PATH_FORMAT = '%Y/%m/%d'
586+
571587
Teasers
572588
~~~~~~~
573589

0 commit comments

Comments
 (0)
Please sign in to comment.