Browse Source

bugfix: google web fonts enabled

master
Christian Mueller 12 years ago
parent
commit
58f61b5caa
  1. 7
      resources/public/style.less
  2. 19
      src/NoteHub/views/common.clj

7
resources/public/style.less

@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
@width: 800px;
@header_font: 'Noticia Text';
@text_font: 'Georgia';
// mixins
.helvetica {
font-weight: 300;
@ -109,7 +112,7 @@ html, body { @@ -109,7 +112,7 @@ html, body {
article {
.central-element;
margin-top: 5em;
font-family: 'Georgia';
font-family: @text_font, 'Georgia';
text-align: justify;
font-size: 1.2em;
}
@ -155,5 +158,5 @@ h1 { @@ -155,5 +158,5 @@ h1 {
margin-bottom: 3em;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Noticia Text','PT Serif','Georgia';
font-family: @header_font,'Noticia Text','PT Serif','Georgia';
}

19
src/NoteHub/views/common.clj

@ -19,7 +19,9 @@ @@ -19,7 +19,9 @@
[params title & content]
; for the sake of security: escape all symbols of the param values
(let [params (into {} (for [[k v] params] [k (escape-html v)]))
theme (:theme params "default")]
theme (:theme params "default")
header-font (:header-font params)
text-font (:text-font params)]
(html5
[:head
[:title (print-str (get-message :name) "—" title)]
@ -28,14 +30,8 @@ @@ -28,14 +30,8 @@
[:link {:href
(clojure.string/replace
(str "http://fonts.googleapis.com/css?family="
(apply
str
(interpose "|"
; ugly thing, but it cannot be avoided since these
; fonts have to be loaded (independently of CSS)
(concat ["PT+Serif:700" "Noticia+Text:700"]
(vals (select-keys params
[:header-font :text-font])))))
(apply str
(interpose "|" ["PT+Serif:700" "Noticia+Text:700" header-font text-font]))
"&subset=latin,cyrillic") " " "+")
:rel "stylesheet"
:type "text/css"}]
@ -53,7 +49,10 @@ @@ -53,7 +49,10 @@
'@foreground_halftone': themes['" theme "'].foreground.halftone,
'@link_fresh': themes['" theme "'].link.fresh,
'@link_visited': themes['" theme "'].link.visited,
'@link_hover': themes['" theme "'].link.hover});")))
'@link_hover': themes['" theme "'].link.hover"
(when header-font (str ", '@header_font': '" header-font "'"))
(when text-font (str ",'@text_font': '" text-font "'"))
"});")))
; google analytics code should appear in prod mode only
(if-not (dev-mode?) (include-js "/js/google-analytics.js"))]
[:body {:onload "loadPage()"} content])))

Loading…
Cancel
Save