Skip to main content

在Muse模板里添加elisp函数

技术
Author

cookwhy

Published

October 21, 2008

在Muse定义的模板里,如果要对其中一些可变的内容用lisp函数来处理,可以在其中嵌入lisp函数,只要把lisp语句括在和之间即可。

比如说我在页面的footer里要设定网页发布的时间,就可以加上这么变态的几句来处理:

最后更新:

(format-time-string “%4Y-%2m-%2d-%T”
(nth 5 (file-attributes
muse-publishing-current-file)))

当然,如果你是放到变量muse-xhtml-footer里,对“要记得用”来转义。比如,加入了这一句后,我的muse-xhtml-footer就成了这样:

;;;;  muse xhtml-footer
(setq muse-xhtml-footer ”
<!– end page content –>
   


<!– it’d be super if you left this link intact –>

Web Design by dreamLogic

最后更新:

(format-time-string &#8221;%4Y-%2m-%2d-%T&#8221;
(nth 5 (file-attributes
muse-publishing-current-file)))

“)

最后转出的效果如下图所示: