Apply the org-todo span tag to TODO headings demoted to lists too

Ref: https://github.com/kaushalmodi/ox-hugo/issues/250
master
Kaushal Modi 7 years ago
parent 43557daaea
commit 47d8dd1ac4
  1. 2
      .gitignore
  2. 10
      ox-hugo.el
  3. 6
      test/site/content/posts/deeply-nested-org-todo-headings--default-h.md
  4. 12
      test/site/content/posts/deeply-nested-org-todo-headings--h1.md
  5. 10
      test/site/content/posts/deeply-nested-org-todo-headings--h2.md
  6. 4
      test/site/content/posts/deeply-nested-org-todo-headings--h5.md
  7. 2
      test/site/content/posts/deeply-nested-org-todo-headings--h6--offset0.md
  8. 4
      test/site/content/posts/deeply-nested-org-todo-headings--h6.md

2
.gitignore vendored

@ -1,3 +1,5 @@
doc/content doc/content
doc/public doc/public
ox-hugo-autoloads.el ox-hugo-autoloads.el
*.elc
test/site/resources/

@ -1746,6 +1746,8 @@ a communication channel."
(title (org-export-data (org-element-property :title headline) info)) ;`org-export-data' required (title (org-export-data (org-element-property :title headline) info)) ;`org-export-data' required
(todo (and (org-hugo--plist-get-true-p info :with-todo-keywords) (todo (and (org-hugo--plist-get-true-p info :with-todo-keywords)
(org-element-property :todo-keyword headline))) (org-element-property :todo-keyword headline)))
(todo-fmtd (when todo
(concat (org-hugo--todo todo info) " ")))
(tags (and (org-hugo--plist-get-true-p info :with-tags) (tags (and (org-hugo--plist-get-true-p info :with-tags)
(let ((tag-list (org-export-get-tags headline info))) (let ((tag-list (org-export-get-tags headline info)))
(and tag-list (and tag-list
@ -1769,16 +1771,14 @@ a communication channel."
(car (last (org-export-get-headline-number (car (last (org-export-get-headline-number
headline info)))) headline info))))
"."))) ".")))
(heading (concat todo " " priority title))) ;Headline text without tags (heading (concat todo-fmtd " " priority title))) ;Headline text without tags
(concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags "\n\n" (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags "\n\n"
(and contents (replace-regexp-in-string "^" " " contents))))) (and contents (replace-regexp-in-string "^" " " contents)))))
(t (t
(let ((anchor (format "{#%s}" ;https://gohugo.io/extras/crossreferences/ (let ((anchor (format "{#%s}" ;https://gohugo.io/extras/crossreferences/
(or (org-element-property :CUSTOM_ID headline) (or (org-element-property :CUSTOM_ID headline)
(org-hugo-slug title)))) (org-hugo-slug title)))))
(todo (when todo (concat (org-hugo--headline-title style level loffset title todo-fmtd anchor numbers)
(concat (org-hugo--todo todo info) " "))))
(concat (org-hugo--headline-title style level loffset title todo anchor numbers)
contents))))))) contents)))))))
;;;;; Headline Helpers ;;;;; Headline Helpers

@ -18,8 +18,8 @@ draft = false
##### <span class="org-todo todo TODO">TODO</span> Level 4 {#level-4} ##### <span class="org-todo todo TODO">TODO</span> Level 4 {#level-4}
- TODO Level 5 - <span class="org-todo todo TODO">TODO</span> Level 5
- TODO Level 6 - <span class="org-todo todo TODO">TODO</span> Level 6
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

@ -9,14 +9,14 @@ draft = false
## <span class="org-todo todo TODO">TODO</span> Level 1 {#level-1} ## <span class="org-todo todo TODO">TODO</span> Level 1 {#level-1}
- TODO Level 2 - <span class="org-todo todo TODO">TODO</span> Level 2
- TODO Level 3 - <span class="org-todo todo TODO">TODO</span> Level 3
- TODO Level 4 - <span class="org-todo todo TODO">TODO</span> Level 4
- TODO Level 5 - <span class="org-todo todo TODO">TODO</span> Level 5
- TODO Level 6 - <span class="org-todo todo TODO">TODO</span> Level 6
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

@ -12,12 +12,12 @@ draft = false
### <span class="org-todo todo TODO">TODO</span> Level 2 {#level-2} ### <span class="org-todo todo TODO">TODO</span> Level 2 {#level-2}
- TODO Level 3 - <span class="org-todo todo TODO">TODO</span> Level 3
- TODO Level 4 - <span class="org-todo todo TODO">TODO</span> Level 4
- TODO Level 5 - <span class="org-todo todo TODO">TODO</span> Level 5
- TODO Level 6 - <span class="org-todo todo TODO">TODO</span> Level 6
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

@ -21,6 +21,6 @@ draft = false
###### <span class="org-todo todo TODO">TODO</span> Level 5 {#level-5} ###### <span class="org-todo todo TODO">TODO</span> Level 5 {#level-5}
- TODO Level 6 - <span class="org-todo todo TODO">TODO</span> Level 6
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

@ -24,4 +24,4 @@ draft = false
###### <span class="org-todo todo TODO">TODO</span> Level 6 {#level-6} ###### <span class="org-todo todo TODO">TODO</span> Level 6 {#level-6}
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

@ -21,6 +21,6 @@ draft = false
###### <span class="org-todo todo TODO">TODO</span> Level 5 {#level-5} ###### <span class="org-todo todo TODO">TODO</span> Level 5 {#level-5}
- TODO Level 6 - <span class="org-todo todo TODO">TODO</span> Level 6
- TODO Level 7 - <span class="org-todo todo TODO">TODO</span> Level 7

Loading…
Cancel
Save