~w96k/at-w96k

at-w96k/.emacs -rw-r--r-- 4.4 KiB View raw
97a375aaMikhail Kirillov Add emacs page 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
;;; Emacs configuration for building a project

(require 'org)
(require 'ox-publish)
(require 'ox-latex)
(require 's)
(require 'simple-httpd)

(setq current-folder (file-truename "./"))

;; Use in:<invidio-id> syntax to include embed invidio video
(defvar in-iframe-format
  ;; You may want to change your width and height.
  (concat "<iframe id=\"ivplayer\" type=\"text/html\""
          "src=\"https://www.invidio.us/embed/%s\""
          " frameborder=\"0\""
          " allowfullscreen>%s</iframe>"))

(org-add-link-type
 "in"
 (lambda (handle)
   (browse-url
    (concat "https://www.invidio.us/embed/"
            handle)))
 (lambda (path desc backend)
   (cl-case backend
     (html (format in-iframe-format
                   path (or desc "")))
     (latex (format "\href{%s}{%s}"
                    path (or desc "video"))))))

(setq org-publish-project-alist
      `(("blog"
         :components ("blog-content" "blog-styles")
         :base-directory current-folder)
        ("blog-styles"
         :base-directory ,(concat current-folder "public")
         :base-extension "jpg\\|gif\\|png\\|ico\\|css\\|txt\\|pdf"
         :publishing-directory ,(concat current-folder "dist/public")
         :recursive t
         :publishing-function org-publish-attachment
         )
        ("blog-content"
         :base-directory ,(concat current-folder "content")
         :publishing-directory ,(concat current-folder "dist")
         :recursive t
         :publishing-function org-html-publish-to-html

         :html-doctype "xhtml5"

         :with-title nil
         :with-author t
         :with-creator nil
         :with-date t
         :with-email t
         :with-footnotes t
         :html-html5-fancy t
         :html-preamble "
<header class=\"navbar\">
<a href=\"/\" class=\"logo\">@w96k</a>
<a class=\"button\" href=\"/about.html\">Обо мне</a>
<a class=\"button\" href=\"/cv.html\">CV</a>
</header>"

         :html-head "
<link rel=\"shortcut icon\" href=\"/public/favicon.png\">
<link rel=\"stylesheet\" href=\"/public/css/mini.css\" type=\"text/css\"/>
<link rel=\"stylesheet\" href=\"/public/css/custom.css\" type=\"text/css\"/>
"

         :html-container "article"
         :html-postamble "
  <div class=\"row\">
    <div class=\"col-sm-12 col-md-4\">
      <p class=\"licenses\">
        <a href=\"https://creativecommons.org/licenses/by/4.0/\">
          <img alt=\"Лицензия Creative Commons\" src=\"/public/images/cc.png\" />
</a>
        <a href=\"https://www.gnu.org/licenses/gpl-3.0.txt\">
          <img src=\"/public/images/gpl.png\">
        </a>
     </p>
    </div>

    <div id=\"copyright\" class=\"col-sm-12 col-md-4\">
      <p>© 2019-2020 <i>Mikhail Kirillov</i></p>
      <p>
       Сайт работает в <a href=\"https://anybrowser.org/campaign/\">любом браузере</a>
      </p>
    </div>

    <div class=\"col-sm-12 col-md-4\" id=\"meta\">
      <p><span class=\"icon-settings\"></span> %c</p>
      <p><span class=\"icon-calendar\"></span> %C</p>
    </div>
  </div>

  <br>
  <div align=\"center\">
    <small>
      <p>Содержимое доступно по лицензии
        <a href=\"https://creativecommons.org/licenses/by-sa/4.0/deed.ru\">
          Creative Commons «Attribution-ShareAlike» («Атрибуция — На тех же условиях») 4.0 Всемирная (CC BY-SA 4.0) 
        </a>
      </p>
      <p>Исходный код доступен по лицензии GNU General Public License Version 3</p>
      <p><a href=\"/legal.html\">Подробнее о правах</a></p>
    </small>
  </div>"

         :section-numbers nil
         :with-sub-superscript nil

         ;; sitemap - list of blog articles
         :auto-sitemap t
         :sitemap-filename "sitemap.org"
         :sitemap-title "@w96k"
         :sitemap-sort-files anti-chronologically)))

;; Don't ask for block evaluation
(setq org-confirm-babel-evaluate nil)

;; Set output folder
(setq httpd-root (concat current-folder "/dist/"))

;; Fix image width
(setq org-image-actual-width nil)

;; PDF output settings
(setq org-latex-listings 'minted)
(setq org-latex-tables-centered nil)
(add-to-list 'org-latex-packages-alist '("russian" "babel"))
(add-to-list 'org-latex-packages-alist '("" "minted"))
(add-to-list 'org-latex-packages-alist '("" "nopageno"))
(add-to-list 'org-latex-packages-alist '("utf8x" "inputenc"))
(add-to-list 'org-latex-packages-alist '("a4paper, margin=0.75in" "geometry"))