Update to latest hakyll/clay, fix template for https usage

master
Levi Pearson 2018-10-03 01:20:38 -06:00
parent 98bb7b0355
commit 48a1c13f72
4 changed files with 16 additions and 16 deletions

View File

@ -61,10 +61,10 @@ i `times` Em b = Em $ (fromIntegral i) * b
i `times` Rem b = Rem $ (fromIntegral i) * b i `times` Rem b = Rem $ (fromIntegral i) * b
i `times` Ex b = Ex $ (fromIntegral i) * b i `times` Ex b = Ex $ (fromIntegral i) * b
toSize :: CalcSize -> Size Abs toSize :: CalcSize -> Size LengthUnit
toSize s = case s of toSize s = case s of
Zero -> nil Zero -> nil
Px i -> px i Px i -> px $ fromIntegral i
Pt d -> pt d Pt d -> pt d
Em d -> em d Em d -> em d
Rem d -> em d -- todo: Add rem to Clay.Size Rem d -> em d -- todo: Add rem to Clay.Size
@ -80,7 +80,7 @@ perct (Rem a) (Rem b) = a / b * 100
perct (Ex a) (Ex b) = a / b * 100 perct (Ex a) (Ex b) = a / b * 100
perct _ _ = error "Can't take percentage of different kinds" perct _ _ = error "Can't take percentage of different kinds"
percentage :: CalcSize -> CalcSize -> Size Rel percentage :: CalcSize -> CalcSize -> Size Percentage
percentage a b = pct $ perct a b percentage a b = pct $ perct a b
data LayoutSettings = data LayoutSettings =
@ -190,10 +190,10 @@ showGrid =
showBaseline n = do showBaseline n = do
backgroundSize $ (px 40) `by` (px n) backgroundSize $ (px 40) `by` (px n)
backgroundImage $ repeatingLinearGradient (angular $ deg 0) [("#111", px 0) backgroundImage $ repeatingLinearGradient (angular $ deg 0) [("#111", pct 0)
,("#111", px 1) ,("#111", pct 1)
,(transparent, px 1) ,(transparent, pct 1)
,(transparent, px n)] ,(transparent, pct n)]
height (pct 100) height (pct 100)
width (pct 100) width (pct 100)
opacity 0.75 opacity 0.75
@ -212,9 +212,9 @@ selectors :: [Selector] -> Selector
selectors = foldl1 (<>) selectors = foldl1 (<>)
setFontSize x = do setFontSize x = do
let line = 1 + x `div` baselinePx let line = 1 + x / baselinePx
fontSize $ emFromRatio x defaultFontPx fontSize $ em $ x / defaultFontPx
lineHeight $ emFromRatio (line * baselinePx) x lineHeight $ em $ (line * baselinePx) / x
{- Insert this into main for layout-debugging grids {- Insert this into main for layout-debugging grids
@ -312,7 +312,7 @@ typography = do
textRendering optimizeLegibility textRendering optimizeLegibility
color bodyCopyColor color bodyCopyColor
a ? color primary a ? color primary
lineHeight $ emFromRatio baselinePx defaultFontPx lineHeight $ em $ baselinePx / defaultFontPx
"#logo" ? do "#logo" ? do
paddingTop $ px (1*baselinePx) paddingTop $ px (1*baselinePx)
@ -368,7 +368,7 @@ typography = do
setFontSize 24 setFontSize 24
ul <> ol ? do ul <> ol ? do
marginLeft $ emFromRatio baselinePx baseFontPx marginLeft $ em $ baselinePx / baseFontPx
marginBottom $ px baselinePx marginBottom $ px baselinePx
"list-style-type" -: "none" "list-style-type" -: "none"

View File

@ -1,5 +1,5 @@
--- ---
title: Operator Sections in Haskell: A History title: 'Operator Sections in Haskell: A History'
--- ---
Operator Sections Operator Sections

View File

@ -9,7 +9,7 @@ import Hakyll
frontPagePosts = 5 frontPagePosts = 5
hakyllConfig :: Configuration hakyllConfig :: Configuration
hakyllConfig = def { deployCommand = "cd _site; cp -R * /var/www/pinealservo.com" } hakyllConfig = def { deployCommand = "cd _site; cp -R * /opt/appdata/letsencrypt/config/www" }
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
main :: IO () main :: IO ()
@ -24,7 +24,7 @@ main = hakyllWith hakyllConfig $ do
match "css/*.hs" $ do match "css/*.hs" $ do
route $ setExtension "css" route $ setExtension "css"
compile $ getResourceString >>= withItemBody (unixFilter "runhaskell" []) compile $ getResourceString >>= withItemBody (unixFilter "stack" ["runhaskell", "--"])
>>= return . fmap compressCss >>= return . fmap compressCss
match "*.markdown" $ do match "*.markdown" $ do
route $ setExtension "html" route $ setExtension "html"

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link href='http://fonts.googleapis.com/css?family=Orbitron:700|PT+Sans|Oswald:400,300' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Orbitron:700|PT+Sans|Oswald:400,300' rel='stylesheet' type='text/css'>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>PinealServo$if(title)$ - $title$$endif$</title> <title>PinealServo$if(title)$ - $title$$endif$</title>
<link rel="stylesheet" href="/css/layout.css" /> <link rel="stylesheet" href="/css/layout.css" />