-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blog/Page/Post/Tag uri customisation #56
Conversation
The core thing is the function io/path - which compose the path from elements and throw appart the empty ones (you can also specify the "/" at the beginning and the end) . I also added the function io/create-file (similar to io/create-folder) to localise "public" variable in "io" namespace. All the other changes are:
|
(copy-resources | ||
(merge config | ||
{:resources (for [mu (m/markups) | ||
t ["posts" "pages"]] (str (m/dir mu) "/" t)) | ||
t (distinct [post-root page-root])] (str (m/dir mu) "/" t)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hardcoded post/pages dir names with names from the config
Does this let you have URL's like |
No, it does not. |
Hey @sbondaryev, I finally got around to looking at this pr. Sorry it took so long! Everything looks great but there's one little bug. On line 293 of (path "/" blog-prefix "p" "index.html") as the (path "/" blog-prefix "p" (str index ".html")) since If you could fix that and then squash your commits I'll merge in the pr. :) |
Hello, sure I will take a look this week-end |
add :tag-root-uri :page-root-uri :post-root-uri parsing replace {entity}-root with {entity}-root-uri parameters to set uri fix root-path call fix root-path function params order (worked erlier because of keyword<->map transposition) fix keyword :{entity}-root-uri to :{entity}-root transformation misprint: congig -> config add function to compose file path add create-file function add function to compose a path handle empty blog-path using path function fix filename for preview
done |
Blog/Page/Post/Tag uri customisation
Thanks! I'll push a new version to Clojars and update the template as well as the docs. |
Add possibility to configure uri root directory for pages, posts and tags
via config params:
Issues:
#32
cryogen-project/cryogen#83
Related PR:
cryogen-project/cryogen#96