From 48a1c13f72a52249ea5891d144e6dfb3e035be55 Mon Sep 17 00:00:00 2001 From: Levi Pearson Date: Wed, 3 Oct 2018 01:20:38 -0600 Subject: [PATCH] Update to latest hakyll/clay, fix template for https usage --- css/layout.hs | 24 +++++++++++----------- posts/2014-10-17-OperatorSections.markdown | 2 +- site.hs | 4 ++-- templates/default.html | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/css/layout.hs b/css/layout.hs index 2c321d6..7c89f77 100644 --- a/css/layout.hs +++ b/css/layout.hs @@ -61,10 +61,10 @@ i `times` Em b = Em $ (fromIntegral i) * b i `times` Rem b = Rem $ (fromIntegral i) * b i `times` Ex b = Ex $ (fromIntegral i) * b -toSize :: CalcSize -> Size Abs +toSize :: CalcSize -> Size LengthUnit toSize s = case s of Zero -> nil - Px i -> px i + Px i -> px $ fromIntegral i Pt d -> pt d Em d -> em d 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 _ _ = 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 data LayoutSettings = @@ -190,10 +190,10 @@ showGrid = showBaseline n = do backgroundSize $ (px 40) `by` (px n) - backgroundImage $ repeatingLinearGradient (angular $ deg 0) [("#111", px 0) - ,("#111", px 1) - ,(transparent, px 1) - ,(transparent, px n)] + backgroundImage $ repeatingLinearGradient (angular $ deg 0) [("#111", pct 0) + ,("#111", pct 1) + ,(transparent, pct 1) + ,(transparent, pct n)] height (pct 100) width (pct 100) opacity 0.75 @@ -212,9 +212,9 @@ selectors :: [Selector] -> Selector selectors = foldl1 (<>) setFontSize x = do - let line = 1 + x `div` baselinePx - fontSize $ emFromRatio x defaultFontPx - lineHeight $ emFromRatio (line * baselinePx) x + let line = 1 + x / baselinePx + fontSize $ em $ x / defaultFontPx + lineHeight $ em $ (line * baselinePx) / x {- Insert this into main for layout-debugging grids @@ -312,7 +312,7 @@ typography = do textRendering optimizeLegibility color bodyCopyColor a ? color primary - lineHeight $ emFromRatio baselinePx defaultFontPx + lineHeight $ em $ baselinePx / defaultFontPx "#logo" ? do paddingTop $ px (1*baselinePx) @@ -368,7 +368,7 @@ typography = do setFontSize 24 ul <> ol ? do - marginLeft $ emFromRatio baselinePx baseFontPx + marginLeft $ em $ baselinePx / baseFontPx marginBottom $ px baselinePx "list-style-type" -: "none" diff --git a/posts/2014-10-17-OperatorSections.markdown b/posts/2014-10-17-OperatorSections.markdown index 0874fea..95ec40a 100644 --- a/posts/2014-10-17-OperatorSections.markdown +++ b/posts/2014-10-17-OperatorSections.markdown @@ -1,5 +1,5 @@ --- -title: Operator Sections in Haskell: A History +title: 'Operator Sections in Haskell: A History' --- Operator Sections diff --git a/site.hs b/site.hs index 03b2a29..964e460 100644 --- a/site.hs +++ b/site.hs @@ -9,7 +9,7 @@ import Hakyll frontPagePosts = 5 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 () @@ -24,7 +24,7 @@ main = hakyllWith hakyllConfig $ do match "css/*.hs" $ do route $ setExtension "css" - compile $ getResourceString >>= withItemBody (unixFilter "runhaskell" []) + compile $ getResourceString >>= withItemBody (unixFilter "stack" ["runhaskell", "--"]) >>= return . fmap compressCss match "*.markdown" $ do route $ setExtension "html" diff --git a/templates/default.html b/templates/default.html index 713b659..ce1925f 100644 --- a/templates/default.html +++ b/templates/default.html @@ -1,7 +1,7 @@ - + PinealServo$if(title)$ - $title$$endif$