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.configs.tonsky.datascript :as sci-datascript]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[clojure-demo.routes :refer [site-data routes]]
|
[clojure-demo.routes :refer [site-data routes]]
|
||||||
[spec-tools.data-spec :as ds]
|
|
||||||
[clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]
|
[clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]
|
||||||
[tick.core :as t])
|
[tick.core :as t])
|
||||||
#_(:require-macros [clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]))
|
#_(:require-macros [clojure-demo.sitemap :as sm #_#_:refer [spit-pwa-sitemap]]))
|
||||||
|
@ -361,7 +360,6 @@
|
||||||
(defn default-page [route]
|
(defn default-page [route]
|
||||||
(let [demo-key (keyword (-> route :parameters :path :page))
|
(let [demo-key (keyword (-> route :parameters :path :page))
|
||||||
content (reagent/atom {})]
|
content (reagent/atom {})]
|
||||||
(prn demo-key)
|
|
||||||
(GET (str "/" (-> site-data :demos demo-key :file))
|
(GET (str "/" (-> site-data :demos demo-key :file))
|
||||||
{:response-format (raw-response-format)
|
{:response-format (raw-response-format)
|
||||||
:handler (fn [response]
|
:handler (fn [response]
|
||||||
|
@ -385,8 +383,6 @@
|
||||||
(GET (str "/" org-file)
|
(GET (str "/" org-file)
|
||||||
{:response-format (raw-response-format)
|
{:response-format (raw-response-format)
|
||||||
:handler (fn [response]
|
:handler (fn [response]
|
||||||
;;(prn (org->replacements theme (parse response) ))
|
|
||||||
;;[:LINE "" [:LINK {:href "https://github.com/weavejester/hiccup"} "https://github.com/weavejester/hiccup"]]
|
|
||||||
(->> response
|
(->> response
|
||||||
parse
|
parse
|
||||||
org->split2
|
org->split2
|
||||||
|
@ -414,18 +410,11 @@
|
||||||
|
|
||||||
;; form one render about page component
|
;; form one render about page component
|
||||||
(defn about-page []
|
(defn about-page []
|
||||||
[default-page {:parameters {:path {:page "about"}}}]
|
[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/"}]]])
|
|
||||||
|
|
||||||
|
|
||||||
(defn render-view
|
(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]
|
[view]
|
||||||
(case view
|
(case view
|
||||||
:homepage home-page
|
:homepage home-page
|
||||||
|
@ -459,7 +448,6 @@
|
||||||
;; This simply calls reagent render and puts the result in a div with the id of app
|
;; 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
|
;; 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
|
;; ^:after-load is meta data its not needed but informs figwheel to run this code after a page load
|
||||||
|
|
||||||
(defn mount-root-page []
|
(defn mount-root-page []
|
||||||
;; this select the main node from the html file and injects your page content
|
;; this select the main node from the html file and injects your page content
|
||||||
(.render
|
(.render
|
||||||
|
@ -494,7 +482,7 @@
|
||||||
;; this means cljs and clj can read and manipulate them
|
;; this means cljs and clj can read and manipulate them
|
||||||
(sm/spit-pwa-sitemap
|
(sm/spit-pwa-sitemap
|
||||||
"resources/public/sitemap.xml"
|
"resources/public/sitemap.xml"
|
||||||
"https://clojure-demos.digitaloctave.com/")
|
"https://clojure-demos.digitaloctave.com")
|
||||||
|
|
||||||
|
|
||||||
#_(macroexpand '(sm/spit-pwa-sitemap
|
#_(macroexpand '(sm/spit-pwa-sitemap
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
:pages
|
:pages
|
||||||
(map second)
|
(map second)
|
||||||
(map :demos)
|
(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))
|
flatten))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
(ns clojure-demo.sitemap
|
(ns clojure-demo.sitemap
|
||||||
(:require [clojure.data.xml :as xml]
|
(:require [clojure.data.xml :as xml]
|
||||||
[clojure-demo.routes :refer [routes]]
|
[clojure-demo.routes :refer [routes]]))
|
||||||
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
(defn pwa-sitemap [domain routes]
|
(defn pwa-sitemap [domain routes]
|
||||||
(xml/emit-str
|
(xml/indent-str
|
||||||
{:tag :urlset
|
{:tag :urlset
|
||||||
:attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
:attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
||||||
:content
|
:content
|
||||||
|
@ -25,22 +23,6 @@
|
||||||
)) [])
|
)) [])
|
||||||
flatten))
|
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
|
(defmacro spit-pwa-sitemap
|
||||||
"Generate the sitemap and outut to the provided path"
|
"Generate the sitemap and outut to the provided path"
|
||||||
[path domain ]
|
[path domain ]
|
||||||
|
@ -50,21 +32,4 @@
|
||||||
domain
|
domain
|
||||||
(build-sitemap-urls routes))))
|
(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