diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-10-25 12:16:46 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-10-25 12:16:46 -0400 |
commit | bfdac52a1bc4ed16efcbdbc4953ff769726b86eb (patch) | |
tree | af90cab3fcff754037b5e34e1308e44cdd9f10b3 | |
parent | d3a178bda7d74a2cdc10c9091d26f2a4ce75ca37 (diff) | |
download | emacsconf-el-bfdac52a1bc4ed16efcbdbc4953ff769726b86eb.tar.xz emacsconf-el-bfdac52a1bc4ed16efcbdbc4953ff769726b86eb.zip |
Use backstage list of files
Diffstat (limited to '')
-rw-r--r-- | emacsconf-publish.el | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/emacsconf-publish.el b/emacsconf-publish.el index d254468..531a94b 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -163,10 +163,10 @@ (and video-file (let ((tracks (emacsconf-video-subtitle-tracks - (expand-file-name - (concat video-base ".vtt") emacsconf-cache-dir) + (concat video-base ".vtt") (or (plist-get talk :track-base-url) - (plist-get talk :base-url))))) + (plist-get talk :base-url)) + (plist-get talk :files)))) (cond ((zerop (length tracks)) "") ((eq (plist-get talk :format) 'wiki) (format "captions=\"\"\"%s\"\"\"" tracks)) @@ -497,6 +497,17 @@ Back to the [[talks]] \n" (emacsconf-generate-after-page o talks)) talks)))) +(defun emacsconf-publish-before-pages (&optional info) + "Populate -before files." + (interactive) + (setq info (or info (emacsconf-get-talk-info))) + (setq info (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED")) + (sort (emacsconf-filter-talks info) #'emacsconf-sort-by-scheduled))) + (emacsconf-publish-with-wiki-change + (mapc (lambda (o) + (emacsconf-generate-before-page o info)) + info))) + (defun emacsconf-generate-talks-page (emacsconf-info) (interactive "p") (let ((info emacsconf-info)) @@ -813,7 +824,9 @@ Entries are sorted chronologically, with different tracks interleaved." (plist-get f :url) (plist-get f :title) (plist-get f :speakers) - (emacsconf-index-card (append f (list :extra (concat "Captioned by " (plist-get f :captioner)))) emacsconf-main-extensions))) + (emacsconf-index-card (append f (list :extra (concat "Captioned by " (plist-get f :captioner)) + :files (emacsconf-publish-talk-files f files))) + emacsconf-main-extensions))) (assoc-default "TO_STREAM" by-status) "\n")) (if (file-exists-p (expand-file-name "include-in-index.html" emacsconf-captions-directory)) (with-temp-buffer (insert-file-contents (expand-file-name "include-in-index.html" emacsconf-captions-directory)) (buffer-string)) @@ -922,21 +935,22 @@ Entries are sorted chronologically, with different tracks interleaved." chapters "\n")))))) -(defun emacsconf-video-subtitle-tracks (filename track-base-url) +(defun emacsconf-video-subtitle-tracks (filename track-base-url &optional files) + (setq files (or files (directory-files emacsconf-cache-dir))) (concat - (if (file-exists-p filename) + (if (member filename files) (format "<track label=\"English\" kind=\"captions\" srclang=\"en\" src=\"%s\" default />" (concat (or track-base-url "") (file-name-nondirectory filename))) "") (mapconcat (lambda (lang) (let ((lang-file (concat (file-name-sans-extension filename) "_" (car lang) "." (file-name-extension filename)))) - (if (file-exists-p lang-file) + (if (member lang-file files) (format "<track label=\"%s\" kind=\"captions\" srclang=\"%s\" src=\"%s\" />" (cdr lang) (car lang) - (concat (or track-base-url "") (file-name-nondirectory lang-file))) - ""))) + (concat (or track-base-url "") (file-name-nondirectory lang-file)))) + "")) '(("fr" . "French") ("ja" . "Japanese")) ""))) |