Adjust route in sitemap.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
23e6aa60b2
commit
efc090d33b
|
@ -31,7 +31,6 @@
|
|||
[sci.configs.tonsky.datascript :as sci-datascript]
|
||||
[sci.core :as sci]
|
||||
[clojure-demo.routes :refer [site-data routes]]
|
||||
[spec-tools.data-spec :as ds]
|
||||
[clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]
|
||||
[tick.core :as t])
|
||||
#_(:require-macros [clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]))
|
||||
|
@ -361,7 +360,6 @@
|
|||
(defn default-page [route]
|
||||
(let [demo-key (keyword (-> route :parameters :path :page))
|
||||
content (reagent/atom {})]
|
||||
(prn demo-key)
|
||||
(GET (str "/" (-> site-data :demos demo-key :file))
|
||||
{:response-format (raw-response-format)
|
||||
:handler (fn [response]
|
||||
|
@ -385,8 +383,6 @@
|
|||
(GET (str "/" org-file)
|
||||
{:response-format (raw-response-format)
|
||||
:handler (fn [response]
|
||||
;;(prn (org->replacements theme (parse response) ))
|
||||
;;[:LINE "" [:LINK {:href "https://github.com/weavejester/hiccup"} "https://github.com/weavejester/hiccup"]]
|
||||
(->> response
|
||||
parse
|
||||
org->split2
|
||||
|
@ -414,18 +410,11 @@
|
|||
|
||||
;; form one render about page component
|
||||
(defn about-page []
|
||||
[default-page {:parameters {:path {:page "about"}}}]
|
||||
#_[:div
|
||||
[:section.mw7.center.avenir
|
||||
[:h1 "Clojure library examples to aid learning"]
|
||||
[:p ""]
|
||||
[article {:title "Example Article component"
|
||||
:description (-> site-data :lorem)
|
||||
:tagline "https://tachyons.io/components/"}]]])
|
||||
[default-page {:parameters {:path {:page "about"}}}])
|
||||
|
||||
|
||||
(defn render-view
|
||||
"We lookup the view render, this keeps our routes as pure data"
|
||||
"We lookup the view to render from a key in the route, this keeps our routes as pure data"
|
||||
[view]
|
||||
(case view
|
||||
:homepage home-page
|
||||
|
@ -459,7 +448,6 @@
|
|||
;; This simply calls reagent render and puts the result in a div with the id of app
|
||||
;; you can create your own index.html or figwheel provides one with the app id which will replace the default data
|
||||
;; ^:after-load is meta data its not needed but informs figwheel to run this code after a page load
|
||||
|
||||
(defn mount-root-page []
|
||||
;; this select the main node from the html file and injects your page content
|
||||
(.render
|
||||
|
@ -494,7 +482,7 @@
|
|||
;; this means cljs and clj can read and manipulate them
|
||||
(sm/spit-pwa-sitemap
|
||||
"resources/public/sitemap.xml"
|
||||
"https://clojure-demos.digitaloctave.com/")
|
||||
"https://clojure-demos.digitaloctave.com")
|
||||
|
||||
|
||||
#_(macroexpand '(sm/spit-pwa-sitemap
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
:pages
|
||||
(map second)
|
||||
(map :demos)
|
||||
(map (fn cat [c] (map (fn build-url [page] (str "page/" (:page page))) c)))
|
||||
(map (fn cat [c] (map (fn build-url [page] (str "/page/" (:page page))) c)))
|
||||
flatten))
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
(ns clojure-demo.sitemap
|
||||
(:require [clojure.data.xml :as xml]
|
||||
[clojure-demo.routes :refer [routes]]
|
||||
|
||||
))
|
||||
[clojure-demo.routes :refer [routes]]))
|
||||
|
||||
|
||||
(defn pwa-sitemap [domain routes]
|
||||
(xml/emit-str
|
||||
(xml/indent-str
|
||||
{:tag :urlset
|
||||
:attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
||||
:content
|
||||
|
@ -25,22 +23,6 @@
|
|||
)) [])
|
||||
flatten))
|
||||
|
||||
|
||||
|
||||
(defn spit-pwa-sitemap2
|
||||
"Generate the sitemap and outut to the provided path"
|
||||
[path domain urls]
|
||||
`(clojure.core/spit ~path (pwa-sitemap ~domain ~urls)))
|
||||
|
||||
(defmacro spit-pwa-sitemap-test
|
||||
"Generate the sitemap and outut to the provided path"
|
||||
[path domain urls]
|
||||
(clojure.core/spit
|
||||
path
|
||||
(pwa-sitemap
|
||||
domain
|
||||
urls)))
|
||||
|
||||
(defmacro spit-pwa-sitemap
|
||||
"Generate the sitemap and outut to the provided path"
|
||||
[path domain ]
|
||||
|
@ -50,21 +32,4 @@
|
|||
domain
|
||||
(build-sitemap-urls routes))))
|
||||
|
||||
(comment
|
||||
(defn test-urls []
|
||||
["a" "b" "c"])
|
||||
|
||||
(spit-pwa-sitemap
|
||||
"resources/public/sitemap.xml"
|
||||
"https://clojure-demos.digitaloctave.com/"
|
||||
["1" "2"])
|
||||
|
||||
(spit-pwa-sitemap
|
||||
"resources/public/sitemap.xml"
|
||||
"https://clojure-demos.digitaloctave.com/"
|
||||
(test-urls))
|
||||
|
||||
(macroexpand '(spit-pwa-sitemap
|
||||
"resources/public/sitemap.xml"
|
||||
"https://clojure-demos.digitaloctave.com/"
|
||||
(test-urls))))
|
||||
|
|
Loading…
Reference in New Issue