Added uri and site-url selmer tags for canonical url meta tags
This commit is contained in:
parent
73338935fa
commit
bca0e89aa2
2 changed files with 17 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
(defproject cryogen-core "0.1.9"
|
(defproject cryogen-core "0.1.10"
|
||||||
:description "Cryogen's compiler"
|
:description "Cryogen's compiler"
|
||||||
:url "https://github.com/lacarmen/cryogen-core"
|
:url "https://github.com/lacarmen/cryogen-core"
|
||||||
:license {:name "Eclipse Public License"
|
:license {:name "Eclipse Public License"
|
||||||
|
|
|
@ -174,7 +174,7 @@
|
||||||
|
|
||||||
(defn compile-pages
|
(defn compile-pages
|
||||||
"Compiles all the pages into html and spits them out into the public folder"
|
"Compiles all the pages into html and spits them out into the public folder"
|
||||||
[default-params pages {:keys [blog-prefix page-root asset-url]}]
|
[default-params pages {:keys [blog-prefix page-root]}]
|
||||||
(when-not (empty? pages)
|
(when-not (empty? pages)
|
||||||
(println (blue "compiling pages"))
|
(println (blue "compiling pages"))
|
||||||
(create-folder (str blog-prefix page-root))
|
(create-folder (str blog-prefix page-root))
|
||||||
|
@ -184,7 +184,8 @@
|
||||||
(render-file "templates/html/layouts/page.html"
|
(render-file "templates/html/layouts/page.html"
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:servlet-context "../"
|
{:servlet-context "../"
|
||||||
:page page}))))))
|
:page page
|
||||||
|
:uri uri}))))))
|
||||||
|
|
||||||
(defn compile-posts
|
(defn compile-posts
|
||||||
"Compiles all the posts into html and spits them out into the public folder"
|
"Compiles all the posts into html and spits them out into the public folder"
|
||||||
|
@ -199,7 +200,8 @@
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:servlet-context "../"
|
{:servlet-context "../"
|
||||||
:post post
|
:post post
|
||||||
:disqus-shortname disqus-shortname}))))))
|
:disqus-shortname disqus-shortname
|
||||||
|
:uri (:uri post)}))))))
|
||||||
|
|
||||||
(defn compile-tags
|
(defn compile-tags
|
||||||
"Compiles all the tag pages into html and spits them out into the public folder"
|
"Compiles all the tag pages into html and spits them out into the public folder"
|
||||||
|
@ -212,9 +214,11 @@
|
||||||
(println "\t-->" (cyan uri))
|
(println "\t-->" (cyan uri))
|
||||||
(spit (str public uri)
|
(spit (str public uri)
|
||||||
(render-file "templates/html/layouts/tag.html"
|
(render-file "templates/html/layouts/tag.html"
|
||||||
(merge default-params {:servlet-context "../"
|
(merge default-params
|
||||||
:name name
|
{:servlet-context "../"
|
||||||
:posts posts})))))))
|
:name name
|
||||||
|
:posts posts
|
||||||
|
:uri uri})))))))
|
||||||
|
|
||||||
(defn compile-index
|
(defn compile-index
|
||||||
"Compiles the index page into html and spits it out into the public folder"
|
"Compiles the index page into html and spits it out into the public folder"
|
||||||
|
@ -225,7 +229,8 @@
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:home true
|
{:home true
|
||||||
:disqus? disqus?
|
:disqus? disqus?
|
||||||
:post (get-in default-params [:latest-posts 0])}))))
|
:post (get-in default-params [:latest-posts 0])
|
||||||
|
:uri (str blog-prefix "/index.html")}))))
|
||||||
|
|
||||||
(defn compile-archives
|
(defn compile-archives
|
||||||
"Compiles the archives page into html and spits it out into the public folder"
|
"Compiles the archives page into html and spits it out into the public folder"
|
||||||
|
@ -235,7 +240,8 @@
|
||||||
(render-file "templates/html/layouts/archives.html"
|
(render-file "templates/html/layouts/archives.html"
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:archives true
|
{:archives true
|
||||||
:groups (group-for-archive posts)}))))
|
:groups (group-for-archive posts)
|
||||||
|
:uri (str blog-prefix "/archives.html")}))))
|
||||||
|
|
||||||
(defn tag-posts
|
(defn tag-posts
|
||||||
"Converts the tags in each post into links"
|
"Converts the tags in each post into links"
|
||||||
|
@ -279,7 +285,8 @@
|
||||||
:sidebar-pages sidebar-pages
|
:sidebar-pages sidebar-pages
|
||||||
:archives-uri (str blog-prefix "/archives.html")
|
:archives-uri (str blog-prefix "/archives.html")
|
||||||
:index-uri (str blog-prefix "/index.html")
|
:index-uri (str blog-prefix "/index.html")
|
||||||
:rss-uri (str blog-prefix "/" rss-name)}]
|
:rss-uri (str blog-prefix "/" rss-name)
|
||||||
|
:site-url (if (.endsWith site-url "/") (.substring site-url 0 (dec (count site-url))) site-url)}]
|
||||||
|
|
||||||
(wipe-public-folder keep-files)
|
(wipe-public-folder keep-files)
|
||||||
(println (blue "copying resources"))
|
(println (blue "copying resources"))
|
||||||
|
|
Loading…
Reference in a new issue