You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
256 lines
7.4 KiB
256 lines
7.4 KiB
#+HUGO_BASE_DIR: ../ |
|
#+OPTIONS: loffset:1 |
|
#+SEQ_TODO: TODO DRAFT DONE |
|
|
|
* Preparation |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: prep |
|
:END: |
|
1. Be the root directory for this Hugo site (the directory containing =config.toml=). |
|
2. Run |
|
#+BEGIN_EXAMPLE |
|
hugo server --port 1111 |
|
#+END_EXAMPLE |
|
3. See the site served on "http://localhost:1111/" |
|
* Post 1 |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: post-1 |
|
:END: |
|
Export this *first* post only by moving point here and doing =C-c C-e |
|
H H=. |
|
* Post 2 |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: post-2 |
|
:END: |
|
Export this *second* post only by moving point here and doing =C-c C-e |
|
H H=. |
|
* Image |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: image |
|
:EXPORT_TAGS: image |
|
:END: |
|
*To be fixed*: At the moment, you need to place the point here and do =C-c C-e H H=. If the point is under any of the nested sub-trees in |
|
here where you do that, only that subtree gets exported. |
|
/Need to add smarts that determines which subtree contains the whole |
|
post.. like look for =EXPORT_FILE_NAME=?/ |
|
** Unclickable image (works!) |
|
[[/images/org-mode-unicorn-logo.png]] |
|
*To be fixed*: The sub-headings in a post get exported as /Heading 1/ |
|
instead of /Heading 2/. |
|
|
|
For example, this sub-section's heading is exported as: |
|
#+BEGIN_EXAMPLE |
|
# Unclickable image |
|
#+END_EXAMPLE |
|
instead of |
|
#+BEGIN_EXAMPLE |
|
## Unclickable image |
|
#+END_EXAMPLE |
|
|
|
So the sub-heading title and the post title both get the /Heading 1/ |
|
tag and look the same size. |
|
** Clickable link that opens the image (works!) |
|
[[/images/org-mode-unicorn-logo.png][Click here to see the unicorn]] |
|
** Clickable image that opens the image (works!) |
|
Click below image to jump to the unicorn image. |
|
[[file:/images/org-mode-unicorn-logo.png][file:/images/org-mode-unicorn-logo.png]] |
|
|
|
- NOTE :: =file:= has to be used in both Link and Description components |
|
of the Org link. |
|
** Image with =ATTR_HTML= [[https://github.com/kaushalmodi/ox-hugo/issues/17][Issue # 17]] |
|
#+ATTR_HTML: :class inset |
|
[[/images/org-mode-unicorn-logo.png]] |
|
|
|
[[https://github.com/kaushalmodi/ox-hugo/issues/17#issuecomment-313627728][Discussion]] |
|
*** COMMENT Below will not work! |
|
You cannot wrap markdown code inside HTML. |
|
|
|
As /rdwatters/ says [[https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/4?u=kaushalmodi][here]], |
|
#+BEGIN_QUOTE |
|
HTML can be part of markdown because HTML-inside-markdown is part of |
|
the spec. That said, remember that the spec disallows markdown nested |
|
inside of HTML. So if you create a div, just make sure everything |
|
inside that div is valid HTML. |
|
#+END_QUOTE |
|
|
|
#+BEGIN_EXPORT md |
|
<div class="inset"> |
|
#+END_EXPORT |
|
[[/images/org-mode-unicorn-logo.png]] |
|
#+BEGIN_EXPORT md |
|
</div> |
|
#+END_EXPORT |
|
* Setting heading anchors |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: setting-heading-anchors |
|
:END: |
|
** Heading 1 of the post |
|
:PROPERTIES: |
|
:CUSTOM_ID: cool-ref-1 |
|
:END: |
|
Something |
|
*** Heading 1.1 of the post |
|
:PROPERTIES: |
|
:CUSTOM_ID: cool-ref-1.1 |
|
:END: |
|
Something else |
|
** Heading 2 of the post |
|
:PROPERTIES: |
|
:CUSTOM_ID: cool-ref-2 |
|
:END: |
|
Something 2 |
|
*** Heading 2.1 of the post |
|
:PROPERTIES: |
|
:CUSTOM_ID: cool-ref-2.1 |
|
:END: |
|
Something 2.1 |
|
* Post heading with crazy characters |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: post-heading-slugs |
|
:END: |
|
** Releasing version 1.1 |
|
** Foo ( Bar ) Baz |
|
** (Foo)Bar.Baz&Zoo |
|
** Hey! I have a link [[https://example.org][here]] (Awesome!) |
|
* Excluded post :noexport: |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: excluded-post |
|
:END: |
|
This post must not be exported as it is tagged =noexport=. |
|
* COMMENT Commented post |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: commented-post |
|
:END: |
|
This post must not be exported as it is commented. |
|
* Test tags :abc:def: |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: test-tags |
|
:END: |
|
* Section :emacs: |
|
** Emacs Post 1 :foo: |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: emacs-post-1 |
|
:END: |
|
Here is the first post on Emacs. |
|
** Emacs Post 2 :bar: |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: emacs-post-2 |
|
:END: |
|
Here is the second post on Emacs. |
|
* Tables :table: |
|
** Simple Table |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: simple-table |
|
:END: |
|
| h1 | h2 | |
|
| a | b | |
|
| c | d | |
|
** Table with narrowest cols |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-with-narrowest-columns |
|
:END: |
|
| 1 | 2 | 3 | |
|
| a | b | e | |
|
| c | d | f | |
|
** Table with top border |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-top-border |
|
:END: |
|
|---+---+---+---| |
|
| 1 | 2 | 3 | 4 | |
|
| a | b | e | g | |
|
| c | d | f | h | |
|
** Table with bottom border |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-bottom-border |
|
:END: |
|
| 1 | 2 | 3 | 4 | |
|
| a | b | e | g | |
|
| c | d | f | h | |
|
|---+---+---+---| |
|
** Table with top and bottom border |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-top-and-bottom-border |
|
:END: |
|
|---+---+---+---| |
|
| 1 | 2 | 3 | 4 | |
|
| a | b | e | g | |
|
| c | d | f | h | |
|
|---+---+---+---| |
|
** Table with rule after first row |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-only-rule-after-first-row |
|
:END: |
|
| 1 | 2 | 3 | 4 | |
|
|---+---+---+---| |
|
| a | b | e | g | |
|
| c | d | f | h | |
|
** Table with borders and rule after first |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: table-with-borders-and-rule-after-first |
|
:END: |
|
|---+---+---+---| |
|
| 1 | 2 | 3 | 4 | |
|
|---+---+---+---| |
|
| a | b | e | g | |
|
| c | d | f | h | |
|
|---+---+---+---| |
|
* Source blocks :src-block: |
|
** Code-fenced source blocks |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: code-fenced-src-blocks |
|
:END: |
|
Here are few variables that you might like to change in the =local.mk=: |
|
- =prefix= :: Org installation directory |
|
#+BEGIN_SRC makefile |
|
prefix = /dir/where/you/want/to/install/org # Default: /usr/share |
|
#+END_SRC |
|
The =.el= files will go to =$(prefix)/emacs/site-lisp/org= by |
|
default. If you'd like to change that, you can tweak the =lispdir= variable. |
|
- =infodir= :: Org Info installation directory. I like to keep the |
|
Info file for development version of Org in a separate |
|
directory. |
|
#+BEGIN_SRC makefile |
|
infodir = $(prefix)/org/info # Default: $(prefix)/info |
|
#+END_SRC |
|
- =ORG_MAKE_DOC= :: Types of Org documentation you'd like to build by |
|
default. |
|
#+BEGIN_SRC makefile |
|
# Define below you only need info documentation, the default includes html and pdf |
|
ORG_MAKE_DOC = info pdf card # html |
|
#+END_SRC |
|
- =ORG_ADD_CONTRIB= :: Packages from the =contrib/= directory that |
|
you'd like to build along with Org. Below are the ones on my /must-have/ list. |
|
#+BEGIN_SRC makefile |
|
# Define if you want to include some (or all) files from contrib/lisp |
|
# just the filename please (no path prefix, no .el suffix), maybe with globbing |
|
# org-eldoc - Headline breadcrumb trail in minibuffer |
|
# ox-extra - Allow ignoring just the heading, but still export the body of those headings |
|
# org-mime - Convert org buffer to htmlized format for email |
|
ORG_ADD_CONTRIB = org-eldoc ox-extra org-mime |
|
#+END_SRC |
|
* TODO Pre-Draft State |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: draft-state-todo |
|
:END: |
|
If a post has the =TODO= keyword, the =draft= front matter variable |
|
should be set to =true=. |
|
|
|
Idea to to mark a post or blog idea as =TODO= that you yet have to |
|
start writing. |
|
* DRAFT Draft state |
|
:PROPERTIES: |
|
:EXPORT_FILE_NAME: draft-state-draft |
|
:END: |
|
If a post has the =DRAFT= keyword too, the =draft= front matter variable |
|
should be set to =true=. |
|
|
|
Idea is to mark a post as =DRAFT= that you have already started |
|
writing, or are in the process at the moment, but it is not yet ready |
|
to be published |
|
|
|
|