如何讓 emacs 使用其他 css 進行 orgmode 發布

如何讓 emacs 使用其他 css 進行 orgmode 發布

在 Emacs 中使用 orgmode 時,當我發佈到 HTML 時,它使用預設的 CSS,這看起來不太好。

發布後,我手動將舊 CSS 刪除為自訂 CSS。

Emacs 有沒有辦法讓它預設使用我的其他 CSS 檔案?

答案1

:style在您的發布項目中使用該參數。例如:

(setq org-publish-project-alist
      '(("Homepage"
     :base-directory "~/git/homepage/"
     :base-extension "org"
     :publishing-directory "~/public_html/"
     :publishing-function org-publish-org-to-html
     :style "<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />")))

您也可以像這樣定義每個文件選項:

#+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />

列出C-h v org-export-html-style TAB TAB與 HTML 匯出樣式相關的各種選項。

相關內容