[a8435cf] | 1 | ;;; Emacs configuration for building a project
|
---|
| 2 |
|
---|
| 3 | (require 'org)
|
---|
| 4 | (require 'ox-publish)
|
---|
| 5 | (require 's)
|
---|
| 6 | (require 'simple-httpd)
|
---|
| 7 |
|
---|
[545c76e] | 8 | (setq current-folder (file-truename "./"))
|
---|
| 9 |
|
---|
[a8435cf] | 10 | ;; Use in:<invidio-id> syntax to include embed invidio video
|
---|
| 11 | (defvar in-iframe-format
|
---|
| 12 | ;; You may want to change your width and height.
|
---|
| 13 | (concat "<iframe id=\"ivplayer\" type=\"text/html\""
|
---|
| 14 | "src=\"https://www.invidio.us/embed/%s\""
|
---|
| 15 | " frameborder=\"0\""
|
---|
| 16 | " allowfullscreen>%s</iframe>"))
|
---|
| 17 |
|
---|
[1891a16] | 18 | (org-add-link-type
|
---|
[a8435cf] | 19 | "in"
|
---|
| 20 | (lambda (handle)
|
---|
| 21 | (browse-url
|
---|
| 22 | (concat "https://www.invidio.us/embed/"
|
---|
| 23 | handle)))
|
---|
| 24 | (lambda (path desc backend)
|
---|
| 25 | (cl-case backend
|
---|
| 26 | (html (format in-iframe-format
|
---|
| 27 | path (or desc "")))
|
---|
| 28 | (latex (format "\href{%s}{%s}"
|
---|
| 29 | path (or desc "video"))))))
|
---|
| 30 |
|
---|
| 31 | (setq org-publish-project-alist
|
---|
| 32 | `(("blog"
|
---|
| 33 | :components ("blog-content" "blog-styles")
|
---|
[545c76e] | 34 | :base-directory current-folder)
|
---|
[a8435cf] | 35 | ("blog-styles"
|
---|
[545c76e] | 36 | :base-directory ,(concat current-folder "public")
|
---|
[61a051b] | 37 | :base-extension "jpg\\|gif\\|png\\|ico\\|css\\|txt"
|
---|
[545c76e] | 38 | :publishing-directory ,(concat current-folder "dist/public")
|
---|
[a8435cf] | 39 | :recursive t
|
---|
| 40 | :publishing-function org-publish-attachment
|
---|
| 41 | )
|
---|
| 42 | ("blog-content"
|
---|
[545c76e] | 43 | :base-directory ,(concat current-folder "content")
|
---|
| 44 | :publishing-directory ,(concat current-folder "dist")
|
---|
[a8435cf] | 45 | :recursive t
|
---|
| 46 | :publishing-function org-html-publish-to-html
|
---|
| 47 |
|
---|
| 48 | :html-doctype "xhtml5"
|
---|
| 49 |
|
---|
| 50 | :with-title nil
|
---|
| 51 | :with-author t
|
---|
| 52 | :with-creator nil
|
---|
| 53 | :with-date t
|
---|
| 54 | :with-email t
|
---|
| 55 | :with-footnotes t
|
---|
| 56 | :html-html5-fancy t
|
---|
| 57 | :html-preamble "
|
---|
| 58 | <header class=\"navbar\">
|
---|
| 59 | <a href=\"/\" class=\"logo\">@w96k</a>
|
---|
| 60 | <a class=\"button\" href=\"/about.html\">Обо мне</a>
|
---|
| 61 | <a class=\"button\" href=\"/cv.html\">CV</a>
|
---|
| 62 | </header>"
|
---|
| 63 |
|
---|
| 64 | :html-head "
|
---|
| 65 | <link rel=\"shortcut icon\" href=\"/public/favicon.ico\">
|
---|
| 66 | <link rel=\"stylesheet\" href=\"/public/css/mini.css\" type=\"text/css\"/>
|
---|
| 67 | <link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
|
---|
| 68 | "
|
---|
| 69 |
|
---|
| 70 | :html-container "article"
|
---|
| 71 | :html-postamble "
|
---|
| 72 | <div class=\"row\">
|
---|
| 73 | <div class=\"col-sm-12 col-md-4\">
|
---|
| 74 | <p class=\"licenses\">
|
---|
| 75 | <a href=\"https://creativecommons.org/licenses/by/4.0/\">
|
---|
| 76 | <img alt=\"Лицензия Creative Commons\" src=\"/public/images/cc.png\" />
|
---|
| 77 | </a>
|
---|
| 78 | <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">
|
---|
| 79 | <img src=\"/public/images/gpl.png\">
|
---|
| 80 | </a>
|
---|
| 81 | </p>
|
---|
| 82 | </div>
|
---|
| 83 |
|
---|
| 84 | <div id=\"copyright\" class=\"col-sm-12 col-md-4\">
|
---|
| 85 | <p>© 2019-2020 <i>Mikhail Kirillov</i></p>
|
---|
| 86 | <p>
|
---|
| 87 | Сайт работает в <a href=\"https://anybrowser.org/campaign/\">любом браузере</a>
|
---|
| 88 | </p>
|
---|
| 89 | </div>
|
---|
| 90 |
|
---|
| 91 | <div class=\"col-sm-12 col-md-4\" id=\"meta\">
|
---|
| 92 | <p><span class=\"icon-settings\"></span> %c</p>
|
---|
[545c76e] | 93 | <p><span class=\"icon-calendar\"></span> %C</p>
|
---|
[a8435cf] | 94 | </div>
|
---|
| 95 | </div>
|
---|
| 96 |
|
---|
| 97 | <br>
|
---|
| 98 | <div align=\"center\">
|
---|
| 99 | <small>
|
---|
[515fd9a] | 100 | <p>Содержимое доступно по лицензии
|
---|
[91524a7] | 101 | <a href=\"https://creativecommons.org/licenses/by-sa/4.0/deed.ru\">
|
---|
[515fd9a] | 102 | Creative Commons «Attribution-ShareAlike» («Атрибуция — На тех же условиях») 4.0 Всемирная (CC BY-SA 4.0)
|
---|
[a8435cf] | 103 | </a>
|
---|
| 104 | </p>
|
---|
[515fd9a] | 105 | <p>Исходный код доступен по лицензии GNU General Public License Version 3</p>
|
---|
[91524a7] | 106 | <p><a href=\"/legal.html\">Подробнее о правах</a></p>
|
---|
[a8435cf] | 107 | </small>
|
---|
| 108 | </div>"
|
---|
| 109 |
|
---|
| 110 | :section-numbers nil
|
---|
| 111 | :with-sub-superscript nil
|
---|
| 112 |
|
---|
| 113 | ;; sitemap - list of blog articles
|
---|
| 114 | :auto-sitemap t
|
---|
| 115 | :sitemap-filename "sitemap.org"
|
---|
| 116 | :sitemap-title "@w96k"
|
---|
| 117 | :sitemap-sort-files anti-chronologically)))
|
---|
| 118 |
|
---|
| 119 | ;; Don't ask for block evaluation
|
---|
| 120 | (setq org-confirm-babel-evaluate nil)
|
---|
| 121 |
|
---|
| 122 | ;; Set output folder
|
---|
[545c76e] | 123 | (setq httpd-root (concat current-folder "/dist/"))
|
---|