emacsorphanage / org-page

[INACTIVE] A static site generator based on Emacs and org mode.
673 stars 99 forks source link

pass absolute store dir to `op/publish-changes` #162

Closed jtmoulia closed 8 years ago

jtmoulia commented 8 years ago

Using an absolute directory prevents the relative path returned by op/generate-uri from resolving relative to the current buffer. This is an issue since the string-to-file is called while visiting each to be published site file.

For example, let's take:

(setq op/category-config-alist 
      '(("blog" ...)
        ("index" ...)))

(op/do-publication t nil "_build" nil)

Results in a _build folder being created under the root directory and the blog directory:

~/repos/jtmoulia.github.io-org-page $ tree -L 2
.
|-- LICENSE
|-- README
|-- _build
|   |-- about
|   |-- assets
|   |-- blog
|   |-- index.html
|   |-- media
|   `-- tags
|-- _buildrss.xml
|-- about.org
|-- assets
|   `-- img
|-- blog
|   |-- _build
|   |-- about-ob-elixir.org
|   |-- distrib-seq-diagram.org
|   |-- elixir_call_with_parens.org
|   |-- elixir_distel_basics.org
|   |-- intro_to_spell.org
|   |-- neotomex-intro.org
|   |-- norse_ipviking_map.org
|   `-- switchboard.org
|-- index.org
`-- jtmoulia-config.el
jtmoulia commented 8 years ago

Good point re the path not working -- I updated the fix to use expand-file-name so it'll correctly expand paths, e.g. ~/.op_tmp or ./_build.

sillykelvin commented 8 years ago

Thanks for your fix, merged!