Skip to content

Commit

Permalink
Merge pull request #1164 from Thaodan/org_reader_enhance_propertys
Browse files Browse the repository at this point in the history
[org_reader] Support pelican status property
  • Loading branch information
justinmayer committed Sep 9, 2019
2 parents aed6c59 + 977e1ac commit 5c5f965
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion org_reader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Publish Emacs Org files alongside the rest of your website or blog.
- `ORG_READER_EMACS_SETTINGS`: Optional. An absolute path to an Elisp file, to
run per invocation. Useful for initializing the `package` Emacs library if
that's where your Org mode comes from, or any modifications to Org Export-
related variables. If you want to use your standard emacs init file, you
related variables. If you want to use your standard emacs init file, you
can ignore this variable.

- `ORG_READER_BACKEND`: Optional. A custom backend to provide to Org. Defaults
Expand All @@ -25,11 +25,13 @@ the org file's header:
#+AUTHOR: My Name
#+PROPERTY: LANGUAGE en
#+PROPERTY: SUMMARY hello, this is the description
#+PROPERTY: STATUS disable or enable document
#+PROPERTY: SLUG test_slug
#+PROPERTY: MODIFIED [2015-12-29 Di]
#+PROPERTY: TAGS my, first, tags
#+PROPERTY: SAVE_AS alternative_filename.html


- The `TITLE` is the only mandatory header property
- Timestamps (`DATE` and `MODIFIED`) are optional and can be either a string
of `%Y-%m-%d` or an org timestamp
Expand Down
1 change: 1 addition & 0 deletions org_reader/org_reader.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
:save_as (cdr (assoc-string "SAVE_AS" org-file-properties t))
:tags (cdr (assoc-string "TAGS" org-file-properties t))
:summary (cdr (assoc-string "SUMMARY" org-file-properties t))
:status (cdr (assoc-string "STATUS" org-file-properties t))
:slug (cdr (assoc-string "SLUG" org-file-properties t))
:modified (if (stringp modifiedstr)
(org-read-date nil nil modifiedstr nil)
Expand Down
4 changes: 2 additions & 2 deletions org_reader/org_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def read(self, filename):
'modified': json_output['modified'] or '',
'tags': json_output['tags'] or '',
'save_as': json_output['save_as'] or '',
'summary': json_output['summary'] or ''}

'summary': json_output['summary'] or '',
'status': json_output['status'] or ''}
# remove empty strings when necessary
for key in ['save_as', 'modified', 'lang', 'summary']:
if not metadata[key]:
Expand Down

0 comments on commit 5c5f965

Please sign in to comment.