From c0498bff65c91dc4bee79b990bbed9b747e687d0 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Sun, 15 Jul 2018 16:22:57 -0400 Subject: [PATCH] Initial work blowing the dust off this codebase This primarily includes updating dependencies, and using stack for sane dependency management. Signed-off-by: Collin J. Doering --- blog-rekahsoft-ca.cabal | 36 +++++++++++------------ clay/Header.hs | 4 +-- clay/Util.hs | 2 +- src/site.hs | 14 ++++----- stack.yaml | 65 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 29 deletions(-) create mode 100644 stack.yaml diff --git a/blog-rekahsoft-ca.cabal b/blog-rekahsoft-ca.cabal index c9dfecc..6074837 100644 --- a/blog-rekahsoft-ca.cabal +++ b/blog-rekahsoft-ca.cabal @@ -61,8 +61,8 @@ executable blog-rekahsoft-ca other-extensions: OverloadedStrings, TupleSections, FlexibleContexts -- Other library packages from which modules are imported. - build-depends: base >=4.10 && <4.11, - hakyll >= 4.9 && <4.10, + build-depends: base >=4.11 && <4.12, + hakyll >= 4.12 && <4.13, pandoc >= 1.13, parsec >= 3.1, filepath >= 1.3, @@ -89,8 +89,8 @@ executable gencss other-extensions: OverloadedStrings -- Other library packages from which modules are imported. - build-depends: base >=4.10 && <4.11, - clay >=0.12 && <0.13, + build-depends: base >=4.11 && <4.12, + clay >=0.13 && <0.14, text >=1.2 && <1.3 -- Directories containing source files. @@ -99,17 +99,17 @@ executable gencss -- Base language which the package is written in. default-language: Haskell2010 -Test-Suite test-site - type: exitcode-stdio-1.0 - main-is: Main.hs - Ghc-options: -Wall -O2 -threaded - hs-source-dirs: src, test - build-depends: base >=4.10 && <4.11, - hspec >= 2.1, - hspec-webdriver >= 1.0, - webdriver >= 0.6, - process >= 1.2, - directory >= 1.2, - text >= 1.2 && <1.3, - filepath >= 1.3 - default-language: Haskell2010 +-- Test-Suite test-site +-- type: exitcode-stdio-1.0 +-- main-is: Main.hs +-- Ghc-options: -Wall -O2 -threaded +-- hs-source-dirs: src, test +-- build-depends: base >=4.11 && <4.12, +-- hspec >= 2.1, +-- hspec-webdriver >= 1.2 && <1.3, +-- webdriver >= 0.6, +-- process >= 1.2, +-- directory >= 1.2, +-- text >= 1.2 && <1.3, +-- filepath >= 1.3 +-- default-language: Haskell2010 diff --git a/clay/Header.hs b/clay/Header.hs index 96707af..4e914d0 100644 --- a/clay/Header.hs +++ b/clay/Header.hs @@ -131,8 +131,8 @@ statusMessage = do borderBottomRightRadius (px 5) (px 5) borderBottomLeftRadius (px 5) (px 5) backgroundColor $ rgb 146 208 240 - -- boxShadow (px 2) (px 5) (px 5) (px 2) "#888888" - boxShadow (px 2) (px 5) (px 5) "#888888" + -- boxShadow (px 2) (px 5) (px 5) "#888888" + --boxShadow [shadowWithSpread (px 2) (px 5) (px 5), bsColor "#888888" $ shadow (px 1) (px 2)] sym padding (px 8) marginBottom (em 1.25) diff --git a/clay/Util.hs b/clay/Util.hs index 04132b8..34191eb 100644 --- a/clay/Util.hs +++ b/clay/Util.hs @@ -34,6 +34,6 @@ makeBorderBox pad backCol = backgroundColor backCol' border solid (px 1) "#888" borderRadius (px 5) (px 5) (px 5) (px 5) - boxShadow (px 2) (px 5) (px 2) "#888" +-- boxShadow (px 2) (px 5) (px 2) "#888" sym padding pad' marginBottom (em 1.25) diff --git a/src/site.hs b/src/site.hs index 13df5f7..08ee4df 100644 --- a/src/site.hs +++ b/src/site.hs @@ -26,24 +26,23 @@ import Hakyll import Control.Monad import Data.Monoid (mconcat,(<>)) import Data.List (sortBy) -import Data.Map (toList, size) -import qualified Data.Set as S +import Data.Map (toList) import Data.Ord (comparing) import System.Random -import System.FilePath (takeBaseName, ()) +import System.FilePath (takeBaseName) import System.Process import System.Exit import System.IO (hGetContents) import Text.Parsec import Text.Pandoc.Options -import Control.Applicative hiding ((<|>),many) +import Control.Applicative() --------------------------------------------------------------------------------------------------------- pandocReaderOptions :: ReaderOptions -pandocReaderOptions = defaultHakyllReaderOptions - { readerExtensions = S.fromList +pandocReaderOptions = def + { readerExtensions = extensionsFromList [ Ext_footnotes , Ext_inline_notes , Ext_pandoc_title_block @@ -84,8 +83,7 @@ pandocReaderOptions = defaultHakyllReaderOptions pandocWriterOptions :: WriterOptions pandocWriterOptions = defaultHakyllWriterOptions - { writerHtml5 = True - , writerHTMLMathMethod = MathJax "" + { writerHTMLMathMethod = MathJax "" , writerEmailObfuscation = NoObfuscation -- ReferenceObfuscation } diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..eb13973 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,65 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# https://docs.haskellstack.org/en/stable/yaml_configuration/ + +# Resolver to choose a 'specific' stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# resolver: lts-3.5 +# resolver: nightly-2015-09-21 +# resolver: ghc-7.10.2 +# resolver: ghcjs-0.1.0_ghc-7.10.2 +# +# The location of a snapshot can be provided as a file or url. Stack assumes +# a snapshot provided as a file might change, whereas a url resource does not. +# +# resolver: ./custom-snapshot.yaml +# resolver: https://example.com/snapshots/2018-01-01.yaml +resolver: lts-12.0 + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# - location: +# git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# subdirs: +# - auto-update +# - wai +packages: +- . +# Dependency packages to be pulled from upstream that are not in the resolver +# using the same syntax as the packages field. +# (e.g., acme-missiles-0.3) +# extra-deps: [] + +# Override default flag values for local packages and extra-deps +# flags: {} + +# Extra package databases containing global packages +# extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true +# +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=1.7" +# +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor \ No newline at end of file