Skip to content

Commit

Permalink
Add inherited tags to the front matter too #awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Jul 12, 2017
1 parent ae757b8 commit d895958
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions example-site/content-org/all-posts.org
Expand Up @@ -130,6 +130,17 @@ This post must not be exported as it is commented.
:PROPERTIES:
:EXPORT_FILE_NAME: test-tags
:END:
* Section :emacs:
** Emacs Post 1 :foo:
:PROPERTIES:
:EXPORT_FILE_NAME: emacs-post-1
:END:
Here is the first post on Emacs.
** Emacs Post 2 :bar:
:PROPERTIES:
:EXPORT_FILE_NAME: emacs-post-2
:END:
Here is the second post on Emacs.
* TODO Pre-Draft State
:PROPERTIES:
:EXPORT_FILE_NAME: draft-state-todo
Expand Down
8 changes: 8 additions & 0 deletions example-site/content/posts/emacs-post-1.md
@@ -0,0 +1,8 @@
+++
title = "Emacs Post 1"
date = 2017-07-12T17:31:56-04:00
tags = ["emacs", "foo"]
draft = false
+++

Here is the first post on Emacs.
8 changes: 8 additions & 0 deletions example-site/content/posts/emacs-post-2.md
@@ -0,0 +1,8 @@
+++
title = "Emacs Post 2"
date = 2017-07-12T17:31:56-04:00
tags = ["emacs", "bar"]
draft = false
+++

Here is the second post on Emacs.
4 changes: 3 additions & 1 deletion ox-hugo.el
Expand Up @@ -625,7 +625,9 @@ file."
(if entry
(progn
(setq is-commented (org-element-property :commentedp entry))
(setq tags (org-get-tags))
;; (setq tags (org-get-tags)) ;Return a list of tags *only* at the current heading
(setq tags (org-get-tags-at)) ;Return a list of tags at current heading
;+ inherited ones! Needs `org-use-tag-inheritance' to be t.
(dolist (exclude-tag org-export-exclude-tags)
(when (member exclude-tag tags)
(setq is-excluded t)))
Expand Down

0 comments on commit d895958

Please sign in to comment.