misaki.config documentation
Configuration Manager
*base-dir*
Blog base directory.
*config*
Current config map.
*config-file*
Config filename.
Default filename is '_config.clj'.
*page-index*
Page index. First page is 0.
*print-stack-trace?*
Flag for printing stack trace.
COMPILER
Default compiler.
INDEX_TEMPLATE_REGEXP
Default regexp to detect index template file.
LANGUAGE
Default language.
PAGE_FILENAME_FORMAT
Default format to generate page output filename.
PORT
Default dev server port.
POST_FILENAME_REGEXP
Default regexp to parse post filename.
POST_OUTPUT_NAME_FORMAT
Default format to generage post output filename.
absolute-path
(absolute-path path-str)
Convert path to absolute with `(:url-base *config*)`
With following pattern, this function does not convert path.
* Starts with 'http' or 'https'
* Starts with './' which represents relative path
* Starts with '#' which represents jump link
* Starts with `(:url-base *confit*)`
config-file?
(config-file? file)
Check whether file is config file or not.
get-date-from-file
(get-date-from-file post-file)
Get date from file(java.io.File) with `(:post-filename-regexp *config*)`.
get-index-filename
(get-index-filename)
Get index filename string.
get-page-posts
(get-page-posts posts)
Return posts at the *page-index*.
If posts-per-page is not defined, return all posts.
index-file?
(index-file? file)
Check whether file is index file or not.
load-compiler-publics
(load-compiler-publics name)
Load specified compiler's public method map.
Compiler's namespace must be **misaki.compiler.FOO.core**.
make-basic-config-map
(make-basic-config-map)
Make basic config to pass plugin's configuration.
make-output-filename
(make-output-filename file & {:keys [page], :or {page nil}})
Make output filename from java.io.File.
make-output-url
(make-output-url file & {:keys [page], :or {page nil}})
Make output url from java.io.File.
make-page-data
(make-page-data file page last-page)
Make pagination data from page numbers.
post-file?
(post-file? file)
Check whether file is post file or not.
public-path
(public-path filename)
Return public path from specified filename.
read-config
(read-config)
(read-config default-value)
Load `*config-file*` from `*base-dir*`.
remove-date-from-name
(remove-date-from-name filename)
Remove date string from filename(String).
sort-type->sort-fn
(sort-type->sort-fn)
Convert sort-type keyword to sort function.
template-name->file
(template-name->file tmpl-name)
Convert template name to java.io.File.
with-config
macro
(with-config & body)
Declare config data, and wrap sexp body with them.