Support of subtitle in the automatic title template.

This commit is contained in:
Yujie Wen 2019-07-07 23:05:22 +08:00
parent 83b8d9f231
commit 12b2610f00
2 changed files with 4 additions and 1 deletions

View File

@ -241,6 +241,7 @@
The following escaping characters can be used to retrieve document
information:
| ~%t~ | Title |
| ~%s~ | Subtitle |
| ~%a~ | Author |
| ~%e~ | Email |
| ~%d~ | Date |

View File

@ -1129,13 +1129,15 @@ contextual information."
"Generate the automatic title slide template."
(let* ((spec (org-html-format-spec info))
(title (org-export-data (plist-get info :title) info))
(subtitle (plist-get info :subtitle))
(author (cdr (assq ?a spec)))
(email (cdr (assq ?e spec)))
(date (cdr (assq ?d spec))))
(concat
(when (and (plist-get info :with-title)
(org-string-nw-p title))
(concat "<h1 class=\"title\">" title "</h1>"))
(concat "<h1 class=\"title\">" title "</h1>"
(if-format "<p class=\"subtitle\">%s</p>\n" subtitle)))
(when (and (plist-get info :with-author)
(org-string-nw-p author))
(concat "<h2 class=\"author\">" author "</h2>"))