(defunorg-hugo-new-subtree-post-capture-template()"Returns `org-capture' template string for new Hugo post.
See `org-capture-templates' for more information."(let*(;; http://www.holgerschurig.de/en/emacs-blog-from-org-to-hugo/(date(format-time-string(org-time-stamp-format:long:inactive)(org-current-time)))(title(read-from-minibuffer"Post Title: "));Prompt to enter the post title(fname(org-hugo-slugtitle)))(mapconcat#'identity`(,(concat"\n* TODO "title" :@cat:tag:")":PROPERTIES:",(concat":EXPORT_HUGO_BUNDLE: "fname)":EXPORT_FILE_NAME: index",(concat":EXPORT_DATE: "date);Enter current date and time":EXPORT_HUGO_CUSTOM_FRONT_MATTER: :image \"/images/icons/tortoise.png\""":EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :libraries '(mathjax)"":EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :description \"this is a description\""":END:""%?\n")"\n")))(with-eval-after-load'org-capture(setqhugo-content-org-dir"~/git-repo/blog/blog-src/content-org")(add-to-list'org-capture-templates`("pe""Hugo Post (en)"entry(file,(expand-file-name"all-posts.en.org"hugo-content-org-dir))(functionorg-hugo-new-subtree-post-capture-template)))(add-to-list'org-capture-templates`("pz""Hugo Post (zh)"entry(file,(expand-file-name"all-posts.zh.org"hugo-content-org-dir))(functionorg-hugo-new-subtree-post-capture-template)))(add-to-list'org-capture-templates'("p""Hugo Post")))
Code
Inline code with ‘=’ or ‘~’: =echo 123=, ~echo 456~
You can also paste images from clipboard with org-download2. I’ve bind C-M-y to paste images, and the pasted image will be stored under path ../static/images/posts/<Level-0-Header-Name>.
You can use org babel to evaluate (tangle) C-c C-c source block to multiple results. One of them being images. then you can add some attributes to the result (width, name, caption, etc.).
The source block could be latex or plantuml3, etc.
#+begin_src plantuml :file "../static/images/posts/Writing-Guide-Org/first.svg"
@startuml
title Authentication Sequence
Alice->Bob: Authentication Request
note right of Bob: Bob thinks about it
Bob->Alice: Authentication Response
@enduml
#+end_src
Figure 4: this is first.svg
you can export ASCII diagrams by changing file extension to .txt (this will export diagram to a text file) or if you want to just include the ASCII diagram itself, set :results to verbatim.
1
2
3
4
5
6
7
8
9
#+begin_src plantuml :results verbatim
@startuml
title Authentication Sequence
Alice->Bob: Authentication Request
note right of Bob: Bob thinks about it
Bob->Alice: Authentication Response
@enduml
#+end_src