X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=posts%2FBlog-with-org-mode.org;h=cc382f3fcd77a07e6572713bb448404236b7844b;hb=refs%2Fheads%2Fmaster;hp=3c20675baf961484fb06ee0d9968eb048d32f1d1;hpb=78bbb5f8fc090fb94562d4a09116c84b591eb59b;p=blog.git diff --git a/posts/Blog-with-org-mode.org b/posts/Blog-with-org-mode.org index 3c20675..cc382f3 100644 --- a/posts/Blog-with-org-mode.org +++ b/posts/Blog-with-org-mode.org @@ -1,22 +1,20 @@ #+TITLE: Blog with Org Mode #+AUTHOR: Peng Li #+EMAIL: seudut@gmail.com -#+DATE: 2016-10-26 +#+DATE: <2016-10-26> #+STARTUP: showall #+STARTUP: inlineimages #+OPTIONS: toc:nil date:t +[[http://orgmode.org][Org-mode]] is an Emacs package, which is used for keeping notes, maintaining TODO lists, planing projects, and authoring + documents with a fast and effective plain-text system. In this blog, I am going to introduce how to setup a blog site + using Org-mode. As you can see, this website is generated by Org-mode. All the souce code is located at [[https://github.com/seudut/blog][blog]]. It has + refered to lots of other websites, like [[http://orgmode.org/worg/][worg]], [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html][Publishing Org-mode files to HTML]], [[https://ogbe.net/blog/blogging_with_org.html][Blogging using org-mode (and nothing else)]]. - - -今天总算把 Blog 的框架大致弄好了。主要参考了 =Org-mode= 的 tutorial, [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html#Special-comment-section][Publishing Org-mode files to HTML]] 和 [[https://ogbe.net/blog/blogging_with_org.html][Blogging using org-mode (and -nothing else)]]。 其中 =css= , 利用的是 =worg.css=, 并参考了[[http://dayigu.github.io/WhyUseOrgModeToWriteBlog.html][为什么用org-mode写 blog?]] 和 [[http://wiki.houye.xyz/blogwithorg-mode.html][用org-mode写博客]]。 - -* Org-publish 配置 -其中有些配置可能是 =Org= 版本不同的原因,有些不同。比如 =htlm-head=, 代替 了 =style= - +* Org-publish configure +Here is the configure of Org-publish (=my-publish.el= in the source code). It setups the most important variable +=org-publish-project-alist=. Also, it defines the header and footer of the html page. #+INCLUDE: "../my-publish.el" src emacs-lisp :lines "29-" - #+BEGIN_SRC sh sudo aptitude install tmux emacs #+END_SRC @@ -24,7 +22,15 @@ nothing else)]]。 其中 =css= , 利用的是 =worg.css=, 并参考了[[http:// * CI build +Here is the =Makefile= in the source code. +#+INCLUDE: "../Makefile" src makefile :lines "2-" + * Web server -* CGI update +* Crontab +Here is the crontab on my VPS. It updates the source code of blog and generates the web pages every 30 minutes. +#+BEGIN_SRC sh + # m h dom mon dow command + */30 * * * * cd /home/seudut/blog && make publish OUTDIR="~/www/html/" emacs=/usr/local/bin/emacs UPDATE=true +#+END_SRC