Add analytics.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Oly 2023-06-21 15:01:04 +01:00
parent 3ba9cdec4c
commit aa89814afe
2 changed files with 17 additions and 6 deletions

View File

@ -84,6 +84,15 @@
right: 12px; right: 12px;
</style> </style>
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-59HNPDZF2T"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-59HNPDZF2T');
</script>
</head> </head>
<body class="f5 sans-serif"> <body class="f5 sans-serif">

View File

@ -12,7 +12,7 @@
[cl-eorg.html :as h :refer [body headers org->replacements]] [cl-eorg.html :as h :refer [body headers org->replacements]]
[cl-eorg.parser :as o :refer [parse]] [cl-eorg.parser :as o :refer [parse]]
[cl-eorg.themes.tachyon :refer [tachyon-theme]] [cl-eorg.themes.tachyon :refer [tachyon-theme]]
[clojure.set :refer [rename-keys]] [clojure.string :as str]
[honey.sql :as sql] [honey.sql :as sql]
[honey.sql.helpers :as sqlh] [honey.sql.helpers :as sqlh]
[reagent.core :as reagent] [reagent.core :as reagent]
@ -28,6 +28,8 @@
(def languages (def languages
{"clojure" {:mode "clojure"} {"clojure" {:mode "clojure"}
"clojurescript" {:mode "clojure"} "clojurescript" {:mode "clojure"}
"html" {:mode "html"}
"json" {:mode "json"}
"yaml" {:mode "yaml"}}) "yaml" {:mode "yaml"}})
(def yaml-mode (LanguageSupport. (.define StreamLanguage yaml))) (def yaml-mode (LanguageSupport. (.define StreamLanguage yaml)))
@ -64,9 +66,9 @@
(when s (when s
(str ;;"toc" (str ;;"toc"
(-> s (-> s
(clojure.string/lower-case) (str/lower-case)
(clojure.string/replace #"[^\w]+" "-") (str/replace #"[^\w]+" "-")
(clojure.string/replace #"^-\\|-\\-$" ""))))) (str/replace #"^-\\|-\\-$" "")))))
(defn fetch-selected-text (defn fetch-selected-text
"Get the users selected text" "Get the users selected text"
@ -303,7 +305,7 @@
(group-by (fn [block] (:tangle (second block)))) (group-by (fn [block] (:tangle (second block))))
(reduce (fn [m [k v]] (reduce (fn [m [k v]]
(conj m {:name (str k) (conj m {:name (str k)
:content (str (clojure.string/join "\n\n" (mapv last v)))})) []))) :content (str (str/join "\n\n" (mapv last v)))})) [])))
(defn org->split2 (defn org->split2
"Split out meta and body" "Split out meta and body"
@ -480,7 +482,7 @@
(and (and
(ignore-anchor-click? router e el uri) (ignore-anchor-click? router e el uri)
(not (let [href (or (.-href el) "") (not (let [href (or (.-href el) "")
result (clojure.string/includes? href "#")] result (str/includes? href "#")]
#_(when result #_(when result
;(.preventDefault e) ;(.preventDefault e)
#_(js/console.log "will prevent by href" href)) #_(js/console.log "will prevent by href" href))