packages feed

slick 0.1.0.0 → 0.1.0.1

raw patch · 4 files changed

+52/−2 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,3 +1,9 @@ # Changelog for sitepipe-shake +## 0.1.0.1+- Docs update++## 0.1.0.0+- Initial release+ ## Unreleased changes
README.md view
@@ -35,6 +35,37 @@     a database and render them out using Blaze html; well go ahead, we can help with that! - Provides caching of arbitrary (JSON serializable) objects using Shake resulting in super-fast rebuild times!  +Another static site generator? What about Hakyll/Jekyll?+--------------------------------------------------------++Yup, yet another static site generator. I've tried using Hakyll and Jekyll on+different occasions and found there was too much magic going on with all of the+monadic contexts for me to understand how to customize things for my use-cases.+Even adding simple tags/categories to my blog seemed far more complex then it+needed to be; Hakyll specifically got me really bogged down; what was the+Compiler monad? How does an Item work? How do I add a custom field? Why+couldn't I just edit data directly like I'm used to doing in Haskell? They+seemed a bit too opinionated without giving me escape hatches to wire in my own+functionality. If they're working for you, then great! But they weren't working+for me, so that's where SitePipe and subsequently Slick came from.++Quick Start+---------------++The easiest way to get started is to clone this repo and try out+the example in the example-site directory. ++You can build the example using Stack by `cd`ing into the directory and running+`stack build && stack exec example-site-exe site`. This creates a 'dist' folder with the+results of the build. A quick way to serve the site is to use [Serve](https://www.npmjs.com/package/serve).++```shell+$ npm install -g serve+serve dist+```++Then navigate to the port which is serving (usually http://localhost:3000 or http://localhost:5000 )+  # Example Site: 
slick.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: dc5df4fc0324f77bdfe61afb25a8a9c15a6d83dd8ca550837de78247854108dc+-- hash: 92135c7604872ee92fb8e0cd098460c1b3a6eeae11d42c44827b5c7ba429470e  name:           slick-version:        0.1.0.0+version:        0.1.0.1 description:    Please see the README on GitHub at <https://github.com/ChrisPenner/slick#readme> homepage:       https://github.com/ChrisPenner/slick#readme bug-reports:    https://github.com/ChrisPenner/slick/issues
src/Slick/Caching.hs view
@@ -25,6 +25,19 @@ -- | A wrapper around 'addOracleCache' which given a @q@ which is a 'ShakeValue' -- allows caching and retrieving 'Value's within Shake. See documentation on -- 'addOracleCache' or see Slick examples for more info.+-- +-- > -- We need to define a unique datatype as our cache key+-- > newtype PostFilePath =+-- >   PostFilePath String+-- > -- We can derive the classes we need (using GeneralizedNewtypeDeriving) +-- > -- so long as the underlying type implements them+-- >   deriving (Show, Eq, Hashable, Binary, NFData)+-- > -- now in our shake rules we can create a cache by providing a loader action+-- > +-- > do+-- > postCache <- jsonCache $ \(PostFilePath path) ->+-- >   readFile' path >>= markdownToHTML . Text.pack+-- > -- Now use postCache inside an Action to load your post with caching! jsonCache ::      ShakeValue q   => (q -> Action Value)