Commit 8d5d734d authored by Eduardo Diaz's avatar Eduardo Diaz
Browse files

Add CDN

I'd prefer to hit my little dev server as little as possible. So let's make sure to use a cdn for images and the like.
parent 4c8645ef
{:prod true
:port 3000}
:port 3000
:cdn-prefix "https://iamedu.sfo3.digitaloceanspaces.com/public/"}
......@@ -13,13 +13,17 @@
(source/from-system-props)
(source/from-env)]))
(defn cdn-resource [path]
(let [prefix (-> env :cdn-prefix)]
(str prefix path)))
(defn current-year []
(-> (LocalDate/now)
(.getYear)))
(def css-sheets
(defn css-sheets []
["https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css"
"/css/main.css"])
(cdn-resource "css/main.css")])
(def raw-resources
["html/analytics.html"])
......
(ns iamedu-web.ui.components
(:require [clojure.java.io :as io])
(:require [clojure.java.io :as io]
[iamedu-web.config :as config])
(:use hiccup.page))
(defn read-raw-resource [resource-file]
......@@ -11,8 +12,8 @@
[:head
[:title (str title-prefix title)]
[:meta {:name "viewport" :content "width=device-width, initial-scale=1"}]
[:link {:rel "icon" :type "image/x-icon" :href "favicon.ico"}]
[:link {:rel "apple-touch-icon" :href "apple-touch-icon.ico"}]
[:link {:rel "icon" :type "image/x-icon" :href (config/cdn-resource "favicon.ico")}]
[:link {:rel "apple-touch-icon" :href (config/cdn-resource "apple-touch-icon.png")}]
(apply include-css css-sheets)
(for [raw-resource raw-resources]
(read-raw-resource raw-resource))])
......
......@@ -8,14 +8,15 @@
(defn about-page []
(html5 [:html
(html-head config/title-prefix "About Me"
:css-sheets config/css-sheets
:css-sheets (config/css-sheets)
:raw-resources config/raw-resources)
[:body
(top-bar :about-me config/sections)
(body-container
(center-content
[:h2.title.is-2 "About me"]
(pic-circle "img/iamedu.jpg"))
(pic-circle
(config/cdn-resource "img/iamedu.jpg")))
[:div.section
[:div.columns
[:div.column.is-half.is-offset-one-quarter
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment