Remove obsolete generated assets and dead code
All checks were successful
Build Org Website / build (push) Successful in 43s
All checks were successful
Build Org Website / build (push) Successful in 43s
This commit is contained in:
@@ -103,85 +103,6 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
|
||||
(add-to-list 'org-export-filter-body-functions
|
||||
#'z/org-html-insert-comments-into-body)
|
||||
|
||||
(defconst z/rpg-standalone-start "<!-- RPG-STANDALONE-START -->")
|
||||
(defconst z/rpg-standalone-end "<!-- RPG-STANDALONE-END -->")
|
||||
|
||||
(defun z/rpg-standalone-file-p (info)
|
||||
"Return non-nil when INFO describes the dedicated RPG page."
|
||||
(let ((input-file (plist-get info :input-file)))
|
||||
(and input-file
|
||||
(string= (file-truename input-file)
|
||||
(file-truename (site-path "play/rpg.org"))))))
|
||||
|
||||
(defun z/render-rpg-standalone (output backend info)
|
||||
"Replace normal site chrome with a dedicated game document for the RPG."
|
||||
(if (and (org-export-derived-backend-p backend 'html)
|
||||
(z/rpg-standalone-file-p info))
|
||||
(let* ((start (string-match (regexp-quote z/rpg-standalone-start) output))
|
||||
(end (and start (string-match (regexp-quote z/rpg-standalone-end) output start))))
|
||||
(if (and start end)
|
||||
(let* ((body-start (+ start (length z/rpg-standalone-start)))
|
||||
(body (substring output body-start end))
|
||||
(body (replace-regexp-in-string
|
||||
"<link rel=\"stylesheet\" href=\"/assets/styles/pages/princess-lima-rpg.css[^\"]*\" />"
|
||||
""
|
||||
body)))
|
||||
(concat
|
||||
"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n"
|
||||
"<meta charset=\"utf-8\" />\n"
|
||||
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n"
|
||||
"<meta name=\"theme-color\" content=\"#080a12\" />\n"
|
||||
"<meta name=\"description\" content=\"A storybook pixel fantasy RPG about helping a wounded kingdom and rescuing Princess Lima.\" />\n"
|
||||
"<title>Rescue Princess Lima</title>\n"
|
||||
"<link rel=\"icon\" href=\"/assets/icons/icons8-film-tape-100.png\" />\n"
|
||||
"<link rel=\"stylesheet\" href=\"/assets/styles/pages/princess-lima-rpg.css?v=princess-lima-2.0.0\" />\n"
|
||||
"</head>\n<body class=\"princess-lima-page\">\n"
|
||||
body
|
||||
"\n</body>\n</html>\n"))
|
||||
output))
|
||||
output))
|
||||
|
||||
(add-to-list 'org-export-filter-final-output-functions
|
||||
#'z/render-rpg-standalone)
|
||||
|
||||
(defconst z/two-rivers-standalone-start "<!-- TWO-RIVERS-STANDALONE-START -->")
|
||||
(defconst z/two-rivers-standalone-end "<!-- TWO-RIVERS-STANDALONE-END -->")
|
||||
|
||||
(defun z/two-rivers-standalone-file-p (info)
|
||||
"Return non-nil when INFO describes the Two Rivers game page."
|
||||
(let ((input-file (plist-get info :input-file)))
|
||||
(and input-file
|
||||
(string= (file-truename input-file)
|
||||
(file-truename (site-path "play/two-rivers.org"))))))
|
||||
|
||||
(defun z/render-two-rivers-standalone (output backend info)
|
||||
"Replace normal site chrome with a dedicated Two Rivers game document."
|
||||
(if (and (org-export-derived-backend-p backend 'html)
|
||||
(z/two-rivers-standalone-file-p info))
|
||||
(let* ((start (string-match (regexp-quote z/two-rivers-standalone-start) output))
|
||||
(end (and start (string-match (regexp-quote z/two-rivers-standalone-end) output start))))
|
||||
(if (and start end)
|
||||
(let ((body (substring
|
||||
output
|
||||
(+ start (length z/two-rivers-standalone-start))
|
||||
end)))
|
||||
(concat
|
||||
"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n"
|
||||
"<meta charset=\"utf-8\" />\n"
|
||||
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n"
|
||||
"<meta name=\"theme-color\" content=\"#07131b\" />\n"
|
||||
"<meta name=\"description\" content=\"Two Rivers at Moonrise, a painterly browser romance adventure starring Z and Princess Lima.\" />\n"
|
||||
"<title>Two Rivers at Moonrise</title>\n"
|
||||
"<link rel=\"icon\" href=\"/assets/icons/icons8-film-tape-100.png\" />\n"
|
||||
"</head>\n<body class=\"two-rivers-page\">\n"
|
||||
body
|
||||
"\n</body>\n</html>\n"))
|
||||
output))
|
||||
output))
|
||||
|
||||
(add-to-list 'org-export-filter-final-output-functions
|
||||
#'z/render-two-rivers-standalone)
|
||||
|
||||
(org-export-define-derived-backend 'z-html 'html
|
||||
:filters-alist '((:filter-final-output . z/insert-filetags-after-title)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user