diff --git a/.gitignore b/.gitignore index cb41e51..0e9040b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ cabal.sandbox.config .stack-work/ cabal.project.local /site +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 0cb75ef..0000000 --- a/README.md +++ /dev/null @@ -1,193 +0,0 @@ -[![Hackage](https://img.shields.io/badge/hackage-latest-green.svg)](https://hackage.haskell.org/package/sitepipe) -[![Join the chat at https://gitter.im/SitePipe/Lobby](https://badges.gitter.im/SitePipe/Lobby.svg)](https://gitter.im/SitePipe/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -![SitePipe](./artwork/pipe.png) - -Heads up! If you're reading this from the Hackage docs the links will be broken, go -read it on [Github](https://github.com/chrispenner/sitepipe). - -### Contents: - -- [What is it?](#what-is-it) - - [What's it look like?](#whats-it-look-like) - - [Wait, another static site generator? What about - Hakyll/Jekyll?](#wait-another-static-site-generator-what-about-hakylljekyll) -- [Getting Started](#getting-started) - - [Quick Start](#quick-start) - - [Tutorial](#tutorial) -- [Concepts](#concepts) - - [How is SitePipe different from other - solutions?](#how-is-sitepipe-different-from-other-solutions) - - [Data/Metadata](#datametadata) - - [Templating](#templating) - - [Loaders](#loaders) - - [Reader](#reader) - - [Writers](#writers) - - [Loader/Writers](#loaderwriters) - - [Utilities](#utilities) -- [Issues/Troubleshooting](#issuestroubleshooting) - -## What is it? - -It's a simple to understand static site generator for making blogs, personal -websites, etc. - -## What's it look like? - -Start by setting up the structure of your website in a `site` folder: - -``` -site -├── templates -│   ├── post.html -│   └── index.html -└── posts - └── article.md -``` - -Here's a dead-simple blog generator using markdown posts, you can see it in action in -[examples/starter-template](./examples/starter-template), or build on it in the [tutorial](./docs/tutorial.md) - -```haskell -{-# language OverloadedStrings #-} -module Main where - -import SitePipe - -main :: IO () -main = site $ do - -- Load all the posts from site/posts/ - posts <- resourceLoader markdownReader ["posts/*.md"] - - -- Build up a context for our index page - let indexContext :: Value - indexContext = object [ "posts" .= posts - -- The url is where the index page will be written to - , "url" .= ("/index.html" :: String) - ] - - -- write out index page and posts via templates - writeTemplate "templates/index.html" [indexContext] - writeTemplate "templates/post.html" posts -``` - -## Wait, 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 came from. - -# Getting Started - -## Quick Start - -The easiest way to get started is to clone this repo and try out the examples in the -[examples](./examples) directory. There's a starter-template which is a barebones -starting point, and also a slightly more complex blog with tags and an rss feed. -You can build either of the examples using [Stack](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html) -by `cd`ing into the directory and running `stack build && stack exec build-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). - -Serving a site with [Serve](https://www.npmjs.com/package/serve): -- `npm install -g serve` -- `serve dist` -- Navigate to the port which is serving (usually http://localhost:3000) - -## Tutorial - -Read the walkthrough of the system [HERE](./docs/tutorial.md); it'll run you through the basics -of how the system works and how to make your own customizations! - -# Concepts - -How is SitePipe different from other solutions? ------------------------------------------------ - -Instead of dealing with complex contexts SitePipe works with *values*. Values -are loaded from files and can be rendered into html. What happens to the values -in-between is up to you! - -SitePipe provides a bunch of helpers for you, but at the end of the day you can -fit the pipes together however you like. - -## Data/Metadata - -Metadata for posts and content is parsed from yaml into [Aeson's `Value` -type](https://hackage.haskell.org/package/aeson); Aeson can -easily represent nested objects or lists inside your metadata, and there's a -rich ecosystem for working with Aeson types! You can load resources in as any -object which implements `FromJSON` (or just leave them as Aeson Values) and you -have the option to edit the objects directly without worrying about monadic or -external context. - -## Templating - -SitePipe has built-in support for [Mustache -Templates](https://mustache.github.io/mustache.5.html), specifically [Justus -Adam's implementation](https://hackage.haskell.org/package/mustache) in -Haskell. This lets you use a well established templating system in your site, -complete with template functions, partials, and iteration. Since the underlying -data is based on It's clear how templates will behave since resources are based -on Aeson's JSON types. - -## Loaders - -You can load resources in to work on them using a `Loader`, A loader simply -finds and loads files into resources by employing a `Reader` on some files. A -basic `resourceLoader` loader is provided, which will load all of the files -matching a set of file-globs through the provided reader and will return an -Aeson Value containing the relevant metadata and content. You should be able to -use resourceLoader for most things by customizing the reader function which you -pass it. - -## Reader - -A reader is a function of the type `String -> IO String`; the input is the file -contents which remain after a yaml header has been stripped off (if it exists). -The most common reader is the provided `markdownReader` which runs a markdown -document through pandoc's markdown processor and outputs html. You can write -your own readers if you like, either by making a function which operates over -the content of the document and matches `String -> IO String` or by using -the provided Pandoc helpers (`mkPandocReader`, `mkPandocReaderWith`) which -allow you to use any of Pandoc's provided document formats, and optionally specify -transformations over the pandoc document before it is rendered to html or some other -output format. - -## Writers - -Writers take a list of resources (anything with a ToJSON instance, often an -Aeson Value) and will write them to the output where the static site will be. -The most common writer is `writeTemplate` which will render the given resource -through a given template, but you can also use `textWriter`, or write your own -writer; either writing to disk using `liftIO` or by using the provided -`writeWith` combinator which given a transformation from a resource to a String -`(a -> SiteM String)` will write the result of the transformation to the place -specified by the resource's url. - -## Loader/Writers - -Some things don't fit into the previous categories. For example `copyFiles` and -`copyFilesWith` are simple tools which just copy the specified files over as-is -into the output directory. You pass either of them a list of file globs and the -resulting files will be copied over. `copyFiles` sends them to the same -relative filepath from the source directory to the output directory, while -`copyFilesWith` allows you to transform the filepath to specify a new location -for each file. - -## Utilities - -Sitepipe includes a few utilities which simply make working with sites easier. -The included utilities will expand as time goes on. - -# Issues/Troubleshooting - -Feel free to file an [issue](https://github.com/chrispenner/sitepipe/issues) if you run into any trouble, -or come ask in the [Chatroom](https://gitter.im/SitePipe/Lobby) diff --git a/README.org b/README.org new file mode 100644 index 0000000..daba6d9 --- /dev/null +++ b/README.org @@ -0,0 +1,4 @@ + +# Avant.org Haskell static implementation + +Based on [SitePipe](https://hackage.haskell.org/package/sitepipe) diff --git a/artwork/Makefile b/artwork/Makefile deleted file mode 100644 index 9e60e39..0000000 --- a/artwork/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# This Makefile is generated by the made script: -# https://github.com/alx741/made -# -# Replace FILE with your filename -# -# Dependencies: -# Inkscape - - -FILE=pipe - -all: $(FILE).png - -$(FILE).png: $(FILE).svg - inkscape -e $@ $< - -clean: - rm $(FILE).png diff --git a/artwork/pipe.png b/artwork/pipe.png deleted file mode 100644 index eb0db8a..0000000 Binary files a/artwork/pipe.png and /dev/null differ diff --git a/artwork/pipe.svg b/artwork/pipe.svg deleted file mode 100644 index e27b801..0000000 --- a/artwork/pipe.svg +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - SitePipe - - diff --git a/examples/blog/dist/index.html b/examples/blog/dist/index.html deleted file mode 100644 index 108f4f9..0000000 --- a/examples/blog/dist/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - Chris Penner's FP - - - - - -
-
DAY
-
- -
-
-

All Posts

- - -
-
- - - - - - - - diff --git a/examples/blog/dist/posts/chapter1.html b/examples/blog/dist/posts/chapter1.html deleted file mode 100644 index c9e46e4..0000000 --- a/examples/blog/dist/posts/chapter1.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - Chapter 1 - - - - - - -
-
DAY
-
- -
-
-
- - Chapter 1 - -
- -
- -
- 1865-11-26-T01 -
- -
-
-
-

Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, ‘and what is the use of a book,’ thought Alice ‘without pictures or conversations?’

-

So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.

-

There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, ‘Oh dear! Oh dear! I shall be late!’ (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge.

-

In another moment down went Alice after it, never once considering how in the world she was to get out again.

-

The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well.

-

Either the well was very deep, or she fell very slowly, for she had plenty of time as she went down to look about her and to wonder what was going to happen next. First, she tried to look down and make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a jar from one of the shelves as she passed; it was labelled ‘ORANGE MARMALADE’, but to her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed to put it into one of the cupboards as she fell past it.

-

‘Well!’ thought Alice to herself, ‘after such a fall as this, I shall think nothing of tumbling down stairs! How brave they’ll all think me at home! Why, I wouldn’t say anything about it, even if I fell off the top of the house!’ (Which was very likely true.)

-

Down, down, down. Would the fall never come to an end! ‘I wonder how many miles I’ve fallen by this time?’ she said aloud. ‘I must be getting somewhere near the centre of the earth. Let me see: that would be four thousand miles down, I think—’ (for, you see, Alice had learnt several things of this sort in her lessons in the schoolroom, and though this was not a very good opportunity for showing off her knowledge, as there was no one to listen to her, still it was good practice to say it over) ‘—yes, that’s about the right distance—but then I wonder what Latitude or Longitude I’ve got to?’ (Alice had no idea what Latitude was, or Longitude either, but thought they were nice grand words to say.)

-

Presently she began again. ‘I wonder if I shall fall right through the earth! How funny it’ll seem to come out among the people that walk with their heads downward! The Antipathies, I think—’ (she was rather glad there was no one listening, this time, as it didn’t sound at all the right word) ‘—but I shall have to ask them what the name of the country is, you know. Please, Ma’am, is this New Zealand or Australia?’ (and she tried to curtsey as she spoke—fancy curtseying as you’re falling through the air! Do you think you could manage it?) ‘And what an ignorant little girl she’ll think me for asking! No, it’ll never do to ask: perhaps I shall see it written up somewhere.’

-

Down, down, down. There was nothing else to do, so Alice soon began talking again. ‘Dinah’ll miss me very much to-night, I should think!’ (Dinah was the cat.) ‘I hope they’ll remember her saucer of milk at tea-time. Dinah my dear! I wish you were down here with me! There are no mice in the air, I’m afraid, but you might catch a bat, and that’s very like a mouse, you know. But do cats eat bats, I wonder?’ And here Alice began to get rather sleepy, and went on saying to herself, in a dreamy sort of way, ‘Do cats eat bats? Do cats eat bats?’ and sometimes, ‘Do bats eat cats?’ for, you see, as she couldn’t answer either question, it didn’t much matter which way she put it. She felt that she was dozing off, and had just begun to dream that she was walking hand in hand with Dinah, and saying to her very earnestly, ‘Now, Dinah, tell me the truth: did you ever eat a bat?’ when suddenly, thump! thump! down she came upon a heap of sticks and dry leaves, and the fall was over.

-

Alice was not a bit hurt, and she jumped up on to her feet in a moment: she looked up, but it was all dark overhead; before her was another long passage, and the White Rabbit was still in sight, hurrying down it. There was not a moment to be lost: away went Alice like the wind, and was just in time to hear it say, as it turned a corner, ‘Oh my ears and whiskers, how late it’s getting!’ She was close behind it when she turned the corner, but the Rabbit was no longer to be seen: she found herself in a long, low hall, which was lit up by a row of lamps hanging from the roof.

-

There were doors all round the hall, but they were all locked; and when Alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.

-

Suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and Alice’s first thought was that it might belong to one of the doors of the hall; but, alas! either the locks were too large, or the key was too small, but at any rate it would not open any of them. However, on the second time round, she came upon a low curtain she had not noticed before, and behind it was a little door about fifteen inches high: she tried the little golden key in the lock, and to her great delight it fitted!

-

Alice opened the door and found that it led into a small passage, not much larger than a rat-hole: she knelt down and looked along the passage into the loveliest garden you ever saw. How she longed to get out of that dark hall, and wander about among those beds of bright flowers and those cool fountains, but she could not even get her head through the doorway; ‘and even if my head would go through,’ thought poor Alice, ‘it would be of very little use without my shoulders. Oh, how I wish I could shut up like a telescope! I think I could, if I only knew how to begin.’ For, you see, so many out-of-the-way things had happened lately, that Alice had begun to think that very few things indeed were really impossible.

-

There seemed to be no use in waiting by the little door, so she went back to the table, half hoping she might find another key on it, or at any rate a book of rules for shutting people up like telescopes: this time she found a little bottle on it, (‘which certainly was not here before,’ said Alice,) and round the neck of the bottle was a paper label, with the words ‘DRINK ME’ beautifully printed on it in large letters.

-

It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree with you, sooner or later.

-

However, this bottle was not marked ‘poison,’ so Alice ventured to taste it, and finding it very nice, (it had, in fact, a sort of mixed flavour of cherry-tart, custard, pine-apple, roast turkey, toffee, and hot buttered toast,) she very soon finished it off.

-
  *    *    *    *    *    *    *
-
-    *    *    *    *    *    *
-
-  *    *    *    *    *    *    *
-

‘What a curious feeling!’ said Alice; ‘I must be shutting up like a telescope.’

-

And so it was indeed: she was now only ten inches high, and her face brightened up at the thought that she was now the right size for going through the little door into that lovely garden. First, however, she waited for a few minutes to see if she was going to shrink any further: she felt a little nervous about this; ‘for it might end, you know,’ said Alice to herself, ‘in my going out altogether, like a candle. I wonder what I should be like then?’ And she tried to fancy what the flame of a candle is like after the candle is blown out, for she could not remember ever having seen such a thing.

-

After a while, finding that nothing more happened, she decided on going into the garden at once; but, alas for poor Alice! when she got to the door, she found she had forgotten the little golden key, and when she went back to the table for it, she found she could not possibly reach it: she could see it quite plainly through the glass, and she tried her best to climb up one of the legs of the table, but it was too slippery; and when she had tired herself out with trying, the poor little thing sat down and cried.

-

‘Come, there’s no use in crying like that!’ said Alice to herself, rather sharply; ‘I advise you to leave off this minute!’ She generally gave herself very good advice, (though she very seldom followed it), and sometimes she scolded herself so severely as to bring tears into her eyes; and once she remembered trying to box her own ears for having cheated herself in a game of croquet she was playing against herself, for this curious child was very fond of pretending to be two people. ‘But it’s no use now,’ thought poor Alice, ‘to pretend to be two people! Why, there’s hardly enough of me left to make one respectable person!’

-

Soon her eye fell on a little glass box that was lying under the table: she opened it, and found in it a very small cake, on which the words ‘EAT ME’ were beautifully marked in currants. ‘Well, I’ll eat it,’ said Alice, ‘and if it makes me grow larger, I can reach the key; and if it makes me grow smaller, I can creep under the door; so either way I’ll get into the garden, and I don’t care which happens!’

-

She ate a little bit, and said anxiously to herself, ‘Which way? Which way?’, holding her hand on the top of her head to feel which way it was growing, and she was quite surprised to find that she remained the same size: to be sure, this generally happens when one eats cake, but Alice had got so much into the way of expecting nothing but out-of-the-way things to happen, that it seemed quite dull and stupid for life to go on in the common way.

-

So she set to work, and very soon finished off the cake.

-
  *    *    *    *    *    *    *
-
-    *    *    *    *    *    *
-
-  *    *    *    *    *    *    *
- -
-
- - - - -
- -
- -
- - - - - - - - diff --git a/examples/blog/dist/rss.xml b/examples/blog/dist/rss.xml deleted file mode 100644 index 8b866ce..0000000 --- a/examples/blog/dist/rss.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - Chris Penner - http://chrispenner.ca - - The Personal blog and musings of Chris Penner; designer, developer and future opsimath. - Technology - 2014 Chris Penner - en-us - - http://chrispenner.ca/images/favicon.png - Chris Penner - http://chrispenner.ca - - - Chapter 1 - chris@chrispenner.ca (Chris Penner) - http://chrispenner.ca/posts/chapter1.html - http://chrispenner.ca/posts/chapter1.html - 1865-11-26-T01 - Down the rabbit hole we go!... - Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, ‘and what is the use of a book,’ thought Alice ‘without pictures or conversations?’

-

So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.

-

There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, ‘Oh dear! Oh dear! I shall be late!’ (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge.

-

In another moment down went Alice after it, never once considering how in the world she was to get out again.

-

The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well.

-

Either the well was very deep, or she fell very slowly, for she had plenty of time as she went down to look about her and to wonder what was going to happen next. First, she tried to look down and make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a jar from one of the shelves as she passed; it was labelled ‘ORANGE MARMALADE’, but to her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed to put it into one of the cupboards as she fell past it.

-

‘Well!’ thought Alice to herself, ‘after such a fall as this, I shall think nothing of tumbling down stairs! How brave they’ll all think me at home! Why, I wouldn’t say anything about it, even if I fell off the top of the house!’ (Which was very likely true.)

-

Down, down, down. Would the fall never come to an end! ‘I wonder how many miles I’ve fallen by this time?’ she said aloud. ‘I must be getting somewhere near the centre of the earth. Let me see: that would be four thousand miles down, I think—’ (for, you see, Alice had learnt several things of this sort in her lessons in the schoolroom, and though this was not a very good opportunity for showing off her knowledge, as there was no one to listen to her, still it was good practice to say it over) ‘—yes, that’s about the right distance—but then I wonder what Latitude or Longitude I’ve got to?’ (Alice had no idea what Latitude was, or Longitude either, but thought they were nice grand words to say.)

-

Presently she began again. ‘I wonder if I shall fall right through the earth! How funny it’ll seem to come out among the people that walk with their heads downward! The Antipathies, I think—’ (she was rather glad there was no one listening, this time, as it didn’t sound at all the right word) ‘—but I shall have to ask them what the name of the country is, you know. Please, Ma’am, is this New Zealand or Australia?’ (and she tried to curtsey as she spoke—fancy curtseying as you’re falling through the air! Do you think you could manage it?) ‘And what an ignorant little girl she’ll think me for asking! No, it’ll never do to ask: perhaps I shall see it written up somewhere.’

-

Down, down, down. There was nothing else to do, so Alice soon began talking again. ‘Dinah’ll miss me very much to-night, I should think!’ (Dinah was the cat.) ‘I hope they’ll remember her saucer of milk at tea-time. Dinah my dear! I wish you were down here with me! There are no mice in the air, I’m afraid, but you might catch a bat, and that’s very like a mouse, you know. But do cats eat bats, I wonder?’ And here Alice began to get rather sleepy, and went on saying to herself, in a dreamy sort of way, ‘Do cats eat bats? Do cats eat bats?’ and sometimes, ‘Do bats eat cats?’ for, you see, as she couldn’t answer either question, it didn’t much matter which way she put it. She felt that she was dozing off, and had just begun to dream that she was walking hand in hand with Dinah, and saying to her very earnestly, ‘Now, Dinah, tell me the truth: did you ever eat a bat?’ when suddenly, thump! thump! down she came upon a heap of sticks and dry leaves, and the fall was over.

-

Alice was not a bit hurt, and she jumped up on to her feet in a moment: she looked up, but it was all dark overhead; before her was another long passage, and the White Rabbit was still in sight, hurrying down it. There was not a moment to be lost: away went Alice like the wind, and was just in time to hear it say, as it turned a corner, ‘Oh my ears and whiskers, how late it’s getting!’ She was close behind it when she turned the corner, but the Rabbit was no longer to be seen: she found herself in a long, low hall, which was lit up by a row of lamps hanging from the roof.

-

There were doors all round the hall, but they were all locked; and when Alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.

-

Suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and Alice’s first thought was that it might belong to one of the doors of the hall; but, alas! either the locks were too large, or the key was too small, but at any rate it would not open any of them. However, on the second time round, she came upon a low curtain she had not noticed before, and behind it was a little door about fifteen inches high: she tried the little golden key in the lock, and to her great delight it fitted!

-

Alice opened the door and found that it led into a small passage, not much larger than a rat-hole: she knelt down and looked along the passage into the loveliest garden you ever saw. How she longed to get out of that dark hall, and wander about among those beds of bright flowers and those cool fountains, but she could not even get her head through the doorway; ‘and even if my head would go through,’ thought poor Alice, ‘it would be of very little use without my shoulders. Oh, how I wish I could shut up like a telescope! I think I could, if I only knew how to begin.’ For, you see, so many out-of-the-way things had happened lately, that Alice had begun to think that very few things indeed were really impossible.

-

There seemed to be no use in waiting by the little door, so she went back to the table, half hoping she might find another key on it, or at any rate a book of rules for shutting people up like telescopes: this time she found a little bottle on it, (‘which certainly was not here before,’ said Alice,) and round the neck of the bottle was a paper label, with the words ‘DRINK ME’ beautifully printed on it in large letters.

-

It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree with you, sooner or later.

-

However, this bottle was not marked ‘poison,’ so Alice ventured to taste it, and finding it very nice, (it had, in fact, a sort of mixed flavour of cherry-tart, custard, pine-apple, roast turkey, toffee, and hot buttered toast,) she very soon finished it off.

-
  *    *    *    *    *    *    *
-
-    *    *    *    *    *    *
-
-  *    *    *    *    *    *    *
-

‘What a curious feeling!’ said Alice; ‘I must be shutting up like a telescope.’

-

And so it was indeed: she was now only ten inches high, and her face brightened up at the thought that she was now the right size for going through the little door into that lovely garden. First, however, she waited for a few minutes to see if she was going to shrink any further: she felt a little nervous about this; ‘for it might end, you know,’ said Alice to herself, ‘in my going out altogether, like a candle. I wonder what I should be like then?’ And she tried to fancy what the flame of a candle is like after the candle is blown out, for she could not remember ever having seen such a thing.

-

After a while, finding that nothing more happened, she decided on going into the garden at once; but, alas for poor Alice! when she got to the door, she found she had forgotten the little golden key, and when she went back to the table for it, she found she could not possibly reach it: she could see it quite plainly through the glass, and she tried her best to climb up one of the legs of the table, but it was too slippery; and when she had tired herself out with trying, the poor little thing sat down and cried.

-

‘Come, there’s no use in crying like that!’ said Alice to herself, rather sharply; ‘I advise you to leave off this minute!’ She generally gave herself very good advice, (though she very seldom followed it), and sometimes she scolded herself so severely as to bring tears into her eyes; and once she remembered trying to box her own ears for having cheated herself in a game of croquet she was playing against herself, for this curious child was very fond of pretending to be two people. ‘But it’s no use now,’ thought poor Alice, ‘to pretend to be two people! Why, there’s hardly enough of me left to make one respectable person!’

-

Soon her eye fell on a little glass box that was lying under the table: she opened it, and found in it a very small cake, on which the words ‘EAT ME’ were beautifully marked in currants. ‘Well, I’ll eat it,’ said Alice, ‘and if it makes me grow larger, I can reach the key; and if it makes me grow smaller, I can creep under the door; so either way I’ll get into the garden, and I don’t care which happens!’

-

She ate a little bit, and said anxiously to herself, ‘Which way? Which way?’, holding her hand on the top of her head to feel which way it was growing, and she was quite surprised to find that she remained the same size: to be sure, this generally happens when one eats cake, but Alice had got so much into the way of expecting nothing but out-of-the-way things to happen, that it seemed quite dull and stupid for life to go on in the common way.

-

So she set to work, and very soon finished off the cake.

-
  *    *    *    *    *    *    *
-
-    *    *    *    *    *    *
-
-  *    *    *    *    *    *    *
- ]]>
-
-
-
diff --git a/examples/blog/dist/tags/keys.html b/examples/blog/dist/tags/keys.html deleted file mode 100644 index 544fc56..0000000 --- a/examples/blog/dist/tags/keys.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Chris Penner's FP - - - - - -
-
DAY
-
- -
-
-

keys

- -
-
- - - - - - - - diff --git a/examples/blog/dist/tags/rabbits.html b/examples/blog/dist/tags/rabbits.html deleted file mode 100644 index 063f224..0000000 --- a/examples/blog/dist/tags/rabbits.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Chris Penner's FP - - - - - -
-
DAY
-
- -
-
-

rabbits

- -
-
- - - - - - - - diff --git a/examples/blog/site/css/style.css b/examples/blog/site/css/style.css deleted file mode 100644 index cb67794..0000000 --- a/examples/blog/site/css/style.css +++ /dev/null @@ -1,539 +0,0 @@ -/* CSS Reset */ -html, body, div, span, object, h1, h2, h3, h4, h5, h6, p, a, abbr, acronym, em, img, ol, ul, li { - border: 0; - font-weight: inherit; - font-style: inherit; - font-size: 100%; - font-family: inherit; - vertical-align: baseline; - margin: 0; - padding: 0; } - -html { - box-sizing: border-box; } - -*, *:before, *:after { - box-sizing: inherit; } - -/* Variables */ -html { - font-family: georgia, serif; - color: #333; - background: #FFFFFC; - background: -webkit-linear-gradient(top, #EEE 0%, #FFF 10%, #FFF 90%, #EEE 100%); - background: linear-gradient(to bottom, #EEE 0%, #FFF 10%, #FFF 90%, #EEE 100%); - background-attachment: fixed; - height: 100%; - width: 100%; - z-index: -10; } - html.dark { - background: #333; - background: -webkit-linear-gradient(top, #2a2a2a 0%, #333 10%, #333 90%, #2a2a2a 100%); - background: linear-gradient(to bottom, #2a2a2a 0%, #333 10%, #333 90%, #2a2a2a 100%); - background-attachment: fixed; - width: 100%; - height: 100%; - color: #DDD; } - -body { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; } - -h2 { - font-family: inherit; - font-size: 1.25em; - font-variant: small-caps; - text-align: center; - width: 80%; - margin: 0 auto 0; - border-top: 1px solid #777; - margin-top: 1em; - padding: 1em 0 0 0; } - -h3 { - font-size: 1.4em; - margin: 0.5em 0; - text-align: center; } - -blockquote { - width: 90%; - margin: 0.7em auto; - text-align: center; - padding-left: 0.5em; - font-size: 1.1em; - font-style: italic; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: row nowrap; - -ms-flex-flow: row nowrap; - flex-flow: row nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; } - blockquote > p { - padding-left: 7px; - border-left: 5px solid rgba(76, 76, 76, 0.9); - margin: auto; } - -ul, ol { - list-style-position: inside; - margin: 1em 0 1em 2em; } - -em { - font-weight: bold; - font-style: italic; } - -img { - margin: auto; } - -a, a:visited, a:hover { - color: #EB005B; - text-decoration: none; - -webkit-transition: color 0.1s; - transition: color 0.1s; } - a:hover, a:visited:hover, a:hover:hover { - color: #EB0978; - text-decoration: underline; } - -header { - position: fixed; - /*color: $night-white;*/ - top: 0; - height: 4em; - width: 100%; } - -footer { - font-size: 0.8em; - min-height: 200px; - padding: 1em; - color: #888; - text-align: center; - clear: both; } - -.photo { - border-radius: 25px; - border: 1px solid black; } - -.blog { - display: table; - width: 100%; - height: 100%; - margin: auto; } - -.title { - font-family: "Quicksand", helvetica, sans-serif; - font-weight: 400; - font-size: 3em; - text-transform: capitalize; } - -.byline { - font-family: helvetica, sans-serif; - font-style: italic; - font-weight: 100; - font-size: 1em; } - -.wrapper { - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; } - -.masthead { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: space-around; - -webkit-align-items: space-around; - -ms-flex-align: space-around; - align-items: space-around; - width: 100%; - min-height: 400px; - padding: 2em 10px; - text-align: center; - margin: auto; } - -.post-image { - height: auto; - width: 400px; - max-width: 400px; } - -.metadata { - text-align: center; } - -.date { - color: rgba(128, 128, 128, 0.5); - font-size: 0.9em; - font-style: italic; - line-height: 2em; - font-family: helvetica, sans-serif; } - -.categories, .tags { - color: rgba(128, 128, 128, 0.5); - font-size: 0.9em; - font-style: italic; - line-height: 2em; - font-family: helvetica, sans-serif; - width: 100%; - max-width: 500px; - display: block; - margin: auto; } - -a.tag, a.category { - padding: 0px 8px; - margin: 2px 1px; - border-radius: 4px; - display: inline-block; - color: #333; - border: 1px solid rgba(76, 76, 76, 0.9); - -webkit-transition: 0.3s; - transition: 0.3s; } - a.tag:hover, a.category:hover { - background: #333; - color: #FFFFFC; - text-decoration: none; } - .dark a.tag, .dark a.category { - color: #DDD; } - .dark a.tag:hover, .dark a.category:hover { - background: #DDD; - color: #333; - text-decoration: none; } - -.post { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - width: auto; - min-width: 100px; - max-width: 600px; - /*min-height: 100%;*/ - padding: 0px 20px; - margin: 3em auto; - -webkit-transition: color 2s; - transition: color 2s; - font-size: 1.1em; } - .post p { - line-height: 1.6em; - letter-spacing: 0.02em; - margin: 0.5em 0 0 0; - -webkit-hyphens: auto; - -moz-hyphens: auto; - -ms-hyphens: auto; - hyphens: auto; - word-break: break-word; } - .post p + p { - margin-top: 1em; } - .post > p:first-of-type:first-letter { - font-size: 8em; - line-height: 0.1em; - padding-right: 0.06em; } - .post ul { - list-style-type: disc; - text-indent: -1em; } - .post ul li { - line-height: 1.3em; - letter-spacing: 0.05em; - margin: 0.5em 0 0 0; - -webkit-hyphens: auto; - -moz-hyphens: auto; - -ms-hyphens: auto; - hyphens: auto; - word-break: break-word; } - -.table-of-contents { - clear: both; - width: 100%; } - .table-of-contents h1 { - font-size: 3em; - text-align: center; - font-family: "Quicksand", helvetica, sans-serif; } - .table-of-contents ul { - margin: 3em 0; - list-style: none; } - .table-of-contents li { - width: 100%; } - .table-of-contents li a { - color: #333; - font-weight: normal; - box-sizing: border-box; - border-top: 1px solid #444; - display: block; - width: 50%; - min-width: 300px; - margin: 0 auto; - padding: 1em 0.5em 1em 0; - -webkit-transition: color 0.7s, background 0.7s, padding 0.5s; - transition: color 0.7s, background 0.7s, padding 0.5s; } - .table-of-contents li a .date { - float: right; - margin-top: -0.25em; - color: rgba(128, 128, 128, 0.8); } - .table-of-contents li a:hover { - background: #333; - color: #FFFFFC; - text-decoration: none; - padding-left: 2em; } - .dark .table-of-contents ul a { - color: #DDD; } - .dark .table-of-contents ul a:hover { - background: #DDD; - color: #333; - padding-left: 2em; } - -.arrow { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - font-size: 1.5em; - width: 1.5em; - height: 1.5em; - background: #DDD; - /*display: table-cell;*/ - /*vertical-align: middle;*/ - text-align: center; - /*padding-top: 0.14em;*/ - box-sizing: border-box; - border-radius: 0.75em; - opacity: 0.7; - -webkit-transition: background 0.5s, opacity 0.5s, width 0.5s; - transition: background 0.5s, opacity 0.5s, width 0.5s; - cursor: pointer; } - .arrow:hover { - box-sizing: border-box; - width: 2em; - color: #EB005B; - border: 1px solid #EB005B; - opacity: 0.9; - background: #FFFFFC; - -webkit-transition: background 0.5s, opacity 0.5s, width 0.5s; - transition: background 0.5s, opacity 0.5s, width 0.5s; - text-decoration: none; } - .dark .arrow { - background: #222; } - .dark .arrow:hover { - color: #C00762; - border-color: #C00762; } - -.social-buttons { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: row nowrap; - -ms-flex-flow: row nowrap; - flex-flow: row nowrap; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - margin: 1em 0; } - .social-buttons > div { - /*margin: 0 1em;*/ } - .social-buttons .twitter-share-button { - max-width: 90px; - margin-right: 5px; } - -.center { - text-align: center; - margin: auto; } - -.monochrome { - color: #333; } - .dark .monochrome { - color: #DDD; } - -.gem-info { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - margin: auto; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; } - .gem-info table { - border: 1px solid #333; - border-collapse: collapse; } - .gem-info table td { - border: 1px solid #333; - padding: 0.4em 1em; } - .dark .gem-info table { - border: 1px solid #DDD; } - .dark .gem-info table td { - border: 1px solid #DDD; } - -.pager-title { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-flow: column nowrap; - -ms-flex-flow: column nowrap; - flex-flow: column nowrap; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; } - .pager-title span { - text-align: center; } - -.pager article { - margin-top: 2em; } - -.dark #disqus_thread { - color: #DDD; } - -#page { - margin: 4em 0; } - -#theme-button { - text-transform: uppercase; - font-family: "Quicksand", helvetica, sans-serif; - font-size: 1.5em; - font-weight: bold; - position: absolute; - top: 0.75em; - right: 0.7em; - text-align: right; - cursor: pointer; - -webkit-transition: opacity 0.5s, color 2s; - transition: opacity 0.5s, color 2s; - opacity: 0.6; } - #theme-button:hover { - opacity: 1; } - .dark #theme-button { - color: #DDD; } - -#beacon { - font-family: "Oswald", helvetica, sans-serif; - font-size: 4em; - height: 1.5em; - width: 1.5em; - text-align: center; - margin: 0.1em; - position: absolute; - border-radius: 0.1em; - opacity: 0.4; - -webkit-transition: opacity 0.5s; - transition: opacity 0.5s; - color: inherit; } - #beacon path { - fill: currentColor; } - #beacon .logo { - width: 100%; - height: 100%; } - #beacon:hover { - opacity: 1; - text-decoration: none; } - -#leftarrow { - position: fixed; - left: 5px; - top: calc(50% - 15px); - text-decoration: none; } - -#rightarrow { - position: fixed; - right: 10px; - top: calc(50% - 15px); - text-decoration: none; } - -@media only screen and (max-width: 750px) { - header { - color: #FFFFFC; - height: 3em; - background: rgba(76, 76, 76, 0.9); } - - #beacon { - color: #FFFFFC; - font-size: 2em; - margin: 0; } - - #theme-button { - color: #FFFFFC; - font-size: 1.5em; - top: 0.5em; - right: 0.2em; - opacity: 0.5; } } -@media only screen and (min-device-width: 320px) and (max-device-width: 480px) { - /* Styles */ - h2 { - border-top: 3px solid #777; } - - .page { - min-width: none; - max-width: none; - width: auto; - padding: 0 1em; - margin: 0; - box-sizing: border-box; } - - .page p { - padding-bottom: 1em; - font-size: 1em; - line-height: 1.8em; } - - .post-image { - height: auto; - width: auto; - max-width: 280px; } - - .page > p:first-of-type:first-letter { - font-size: 4em; - line-height: 0.1em; } } -@media only screen and (max-height: 450px) { - .masthead { - min-height: 350px; } } - -/*# sourceMappingURL=style.css.map */ \ No newline at end of file diff --git a/examples/blog/site/js/main.js b/examples/blog/site/js/main.js deleted file mode 100644 index c829d29..0000000 --- a/examples/blog/site/js/main.js +++ /dev/null @@ -1,45 +0,0 @@ -function switchTheme(){ - var button = document.getElementById("theme-button"); - var html = document.getElementsByTagName("html")[0]; - html.classList.toggle("dark"); - - if(button.innerHTML == "DAY"){ - button.innerHTML = "NIGHT"; - // Expire in two months - setCookie("theme", "night", 60*24*60*60*1000); - } else { - button.innerHTML = "DAY"; - // Expire in two months - setCookie("theme", "day", 60*24*60*60*1000); - } - return; -} - -function setCookie(cname,cvalue,extime) -{ - var d = new Date(); - d.setTime(d.getTime()+(extime)); - var expires = "expires="+d.toGMTString(); - document.cookie = cname + "=" + cvalue + ";" + expires + ";" + "path=/"; -} - -function getCookie(cname) -{ - var name = cname + "="; - var ca = document.cookie.split(';'); - for(var i=0; i - - - - - My Blog - - -

Posts

- - - diff --git a/examples/starter-template/dist/posts/article.html b/examples/starter-template/dist/posts/article.html deleted file mode 100644 index c049804..0000000 --- a/examples/starter-template/dist/posts/article.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Getting started with SitePipe - - -
-

Getting started with SitePipe

-

By Chris

-

Remember that you can build this site using stack: stack build && stack exec build-site

-

Looks like you got SitePipe up and running! Congrats!

-

Here's a few next steps you could take:

- -
- - diff --git a/LICENSE b/library/LICENSE similarity index 100% rename from LICENSE rename to library/LICENSE diff --git a/Setup.hs b/library/Setup.hs similarity index 100% rename from Setup.hs rename to library/Setup.hs diff --git a/docs/tutorial.md b/library/docs/tutorial.md similarity index 100% rename from docs/tutorial.md rename to library/docs/tutorial.md diff --git a/examples/blog/README.md b/library/examples/blog/README.md similarity index 100% rename from examples/blog/README.md rename to library/examples/blog/README.md diff --git a/examples/blog/app/Main.hs b/library/examples/blog/app/Main.hs similarity index 100% rename from examples/blog/app/Main.hs rename to library/examples/blog/app/Main.hs diff --git a/examples/blog/blog.cabal b/library/examples/blog/blog.cabal similarity index 100% rename from examples/blog/blog.cabal rename to library/examples/blog/blog.cabal diff --git a/examples/blog/dist/css/style.css b/library/examples/blog/site/css/style.css similarity index 100% rename from examples/blog/dist/css/style.css rename to library/examples/blog/site/css/style.css diff --git a/examples/blog/dist/js/main.js b/library/examples/blog/site/js/main.js similarity index 100% rename from examples/blog/dist/js/main.js rename to library/examples/blog/site/js/main.js diff --git a/examples/blog/site/posts/chapter1.md b/library/examples/blog/site/posts/chapter1.md similarity index 100% rename from examples/blog/site/posts/chapter1.md rename to library/examples/blog/site/posts/chapter1.md diff --git a/examples/blog/site/templates/index.html b/library/examples/blog/site/templates/index.html similarity index 100% rename from examples/blog/site/templates/index.html rename to library/examples/blog/site/templates/index.html diff --git a/examples/blog/site/templates/meta-data.html b/library/examples/blog/site/templates/meta-data.html similarity index 100% rename from examples/blog/site/templates/meta-data.html rename to library/examples/blog/site/templates/meta-data.html diff --git a/examples/blog/site/templates/post-list.html b/library/examples/blog/site/templates/post-list.html similarity index 100% rename from examples/blog/site/templates/post-list.html rename to library/examples/blog/site/templates/post-list.html diff --git a/examples/blog/site/templates/post.html b/library/examples/blog/site/templates/post.html similarity index 100% rename from examples/blog/site/templates/post.html rename to library/examples/blog/site/templates/post.html diff --git a/examples/blog/site/templates/rss.xml b/library/examples/blog/site/templates/rss.xml similarity index 100% rename from examples/blog/site/templates/rss.xml rename to library/examples/blog/site/templates/rss.xml diff --git a/examples/blog/site/templates/tag.html b/library/examples/blog/site/templates/tag.html similarity index 100% rename from examples/blog/site/templates/tag.html rename to library/examples/blog/site/templates/tag.html diff --git a/examples/blog/stack.yaml b/library/examples/blog/stack.yaml similarity index 100% rename from examples/blog/stack.yaml rename to library/examples/blog/stack.yaml diff --git a/examples/starter-template/LICENSE b/library/examples/starter-template/LICENSE similarity index 100% rename from examples/starter-template/LICENSE rename to library/examples/starter-template/LICENSE diff --git a/examples/starter-template/README.md b/library/examples/starter-template/README.md similarity index 100% rename from examples/starter-template/README.md rename to library/examples/starter-template/README.md diff --git a/examples/starter-template/Setup.hs b/library/examples/starter-template/Setup.hs similarity index 100% rename from examples/starter-template/Setup.hs rename to library/examples/starter-template/Setup.hs diff --git a/examples/starter-template/app/Main.hs b/library/examples/starter-template/app/Main.hs similarity index 100% rename from examples/starter-template/app/Main.hs rename to library/examples/starter-template/app/Main.hs diff --git a/examples/starter-template/site/posts/article.md b/library/examples/starter-template/site/posts/article.md similarity index 100% rename from examples/starter-template/site/posts/article.md rename to library/examples/starter-template/site/posts/article.md diff --git a/examples/starter-template/site/templates/index.html b/library/examples/starter-template/site/templates/index.html similarity index 100% rename from examples/starter-template/site/templates/index.html rename to library/examples/starter-template/site/templates/index.html diff --git a/examples/starter-template/site/templates/post.html b/library/examples/starter-template/site/templates/post.html similarity index 100% rename from examples/starter-template/site/templates/post.html rename to library/examples/starter-template/site/templates/post.html diff --git a/examples/starter-template/stack.yaml b/library/examples/starter-template/stack.yaml similarity index 100% rename from examples/starter-template/stack.yaml rename to library/examples/starter-template/stack.yaml diff --git a/examples/starter-template/starter-template.cabal b/library/examples/starter-template/starter-template.cabal similarity index 100% rename from examples/starter-template/starter-template.cabal rename to library/examples/starter-template/starter-template.cabal diff --git a/sitepipe.cabal b/library/sitepipe.cabal similarity index 96% rename from sitepipe.cabal rename to library/sitepipe.cabal index 166d968..6b272b9 100644 --- a/sitepipe.cabal +++ b/library/sitepipe.cabal @@ -1,5 +1,5 @@ name: sitepipe -version: 0.1.1 +version: 0.1.2 synopsis: A simple to understand static site generator homepage: https://github.com/ChrisPenner/sitepipe#readme license: BSD3 @@ -9,7 +9,6 @@ maintainer: christopher.penner@gmail.com copyright: 2017 Chris Penner category: Web build-type: Simple -extra-source-files: README.md cabal-version: >=1.10 library diff --git a/src/SitePipe.hs b/library/src/SitePipe.hs similarity index 98% rename from src/SitePipe.hs rename to library/src/SitePipe.hs index 706c166..0e2e0b4 100644 --- a/src/SitePipe.hs +++ b/library/src/SitePipe.hs @@ -33,7 +33,7 @@ module SitePipe -- * Utilities , setExt , addPrefix - , getTags + , getMeta -- * Types , module SitePipe.Types diff --git a/src/SitePipe/Files.hs b/library/src/SitePipe/Files.hs similarity index 100% rename from src/SitePipe/Files.hs rename to library/src/SitePipe/Files.hs diff --git a/src/SitePipe/Parse.hs b/library/src/SitePipe/Parse.hs similarity index 100% rename from src/SitePipe/Parse.hs rename to library/src/SitePipe/Parse.hs diff --git a/src/SitePipe/Pipes.hs b/library/src/SitePipe/Pipes.hs similarity index 100% rename from src/SitePipe/Pipes.hs rename to library/src/SitePipe/Pipes.hs diff --git a/src/SitePipe/Readers.hs b/library/src/SitePipe/Readers.hs similarity index 100% rename from src/SitePipe/Readers.hs rename to library/src/SitePipe/Readers.hs diff --git a/src/SitePipe/Templating.hs b/library/src/SitePipe/Templating.hs similarity index 100% rename from src/SitePipe/Templating.hs rename to library/src/SitePipe/Templating.hs diff --git a/src/SitePipe/Types.hs b/library/src/SitePipe/Types.hs similarity index 98% rename from src/SitePipe/Types.hs rename to library/src/SitePipe/Types.hs index 89010e8..3c576fa 100644 --- a/src/SitePipe/Types.hs +++ b/library/src/SitePipe/Types.hs @@ -54,4 +54,4 @@ instance Show SitePipeError where "Template Interpolation Errors in " ++ path ++ ":\n" ++ show errs show (SitePipeError err) = err -instance Exception SitePipeError +instance Exception SitePipeError \ No newline at end of file diff --git a/src/SitePipe/Utilities.hs b/library/src/SitePipe/Utilities.hs similarity index 69% rename from src/SitePipe/Utilities.hs rename to library/src/SitePipe/Utilities.hs index 05a94ab..2bc1417 100644 --- a/src/SitePipe/Utilities.hs +++ b/library/src/SitePipe/Utilities.hs @@ -2,7 +2,7 @@ module SitePipe.Utilities ( addPrefix , setExt - , getTags + , getMeta ) where import System.FilePath.Posix @@ -28,18 +28,18 @@ addPrefix = (++) -- * name: The tag name -- * url: The tag's url -- * posts: The list of posts matching that tag -getTags :: (String -> String) -- ^ Accept a tagname and create a url +getMeta :: (String -> String) -- ^ Accept a tagname and create a url -> [Value] -- ^ List of posts -> [Value] -getTags makeUrl postList = uncurry (makeTag makeUrl) <$> M.toList tagMap +getMeta makeUrl postList = uncurry (makeMeta makeUrl) <$> M.toList metaMap where - tagMap = M.unionsWith mappend (toMap <$> postList) - toMap post = M.fromList (zip (post ^.. key "tags" . values . _String . to T.unpack) $ repeat [post]) + metaMap = M.unionsWith mappend (toMap <$> postList) + toMap post = M.fromList (zip (post ^.. key "meta" . values . _String . to T.unpack) $ repeat [post]) -- | Makes a single tag -makeTag :: (String -> String) -> String -> [Value] -> Value -makeTag makeUrl tagname posts = object - [ "tag" .= tagname - , "url" .= makeUrl tagname +makeMeta :: (String -> String) -> String -> [Value] -> Value +makeMeta makeUrl metaname posts = object + [ "meta" .= metaname + , "url" .= makeUrl metaname , "posts" .= posts - ] + ] \ No newline at end of file diff --git a/stack.yaml b/library/stack.yaml similarity index 100% rename from stack.yaml rename to library/stack.yaml diff --git a/schema/_build.sh b/schema/_build.sh new file mode 100755 index 0000000..b785380 --- /dev/null +++ b/schema/_build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +stack build && stack exec compile \ No newline at end of file diff --git a/schema/imprint.cabal b/schema/imprint.cabal new file mode 100644 index 0000000..f655382 --- /dev/null +++ b/schema/imprint.cabal @@ -0,0 +1,22 @@ +name: imprint +version: 0.0.1 +description: A distributed project space for research and practice. +homepage: Avant.org +license: BSD3 +author: Sam Hart +maintainer: sam.hart@avant.org +copyright: CC +category: Web +build-type: Simple +cabal-version: >=1.10 + +executable compile + hs-source-dirs: src + main-is: Avant.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , sitepipe >= 0.1.2 + , containers + , mustache + , text + default-language: Haskell2010 diff --git a/schema/site/css/style.css b/schema/site/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/schema/site/js/main.js b/schema/site/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/schema/site/posts/event1.md b/schema/site/posts/event1.md new file mode 100644 index 0000000..7d7b341 --- /dev/null +++ b/schema/site/posts/event1.md @@ -0,0 +1,30 @@ +--- +title: "(LISTEN)" +author: Christine Sun Kim +editor: ["Sam Hart", "Charles Eppley", "Kerry Santullo"] +date: 1865-11-26-T01 +meta: ["sound", "performance"] +thread: Sonic Research +description: description goes here +slug: listen +--- + +L + +I + +S + +T + +E + +N + +``` + * * * * * * * + + * * * * * * + + * * * * * * * +``` diff --git a/schema/site/posts/project1.md b/schema/site/posts/project1.md new file mode 100644 index 0000000..f90b2ef --- /dev/null +++ b/schema/site/posts/project1.md @@ -0,0 +1,36 @@ +--- +title: "Hello World!" +author: Taeyoon Choi +editor: Sam Hart +date: 1965-11-26-T01 +meta: ["computation", "poetics"] +thread: Handmade Computer +slug: hello-world +description: Start building a computer with Taeyoon Choi +--- + +H + +A + +N + +D + +M + +A + +D + +E + +COMPUTER + +``` + * * * * * * * + + * * * * * * + + * * * * * * * +``` diff --git a/schema/site/templates/foot.html b/schema/site/templates/foot.html new file mode 100644 index 0000000..1e0b959 --- /dev/null +++ b/schema/site/templates/foot.html @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/schema/site/templates/head.html b/schema/site/templates/head.html new file mode 100644 index 0000000..ec8f0b8 --- /dev/null +++ b/schema/site/templates/head.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + {{#image}} + + {{/image}} + {{title}} + + + + + + + \ No newline at end of file diff --git a/schema/site/templates/index.html b/schema/site/templates/index.html new file mode 100644 index 0000000..917ff44 --- /dev/null +++ b/schema/site/templates/index.html @@ -0,0 +1,24 @@ +{{>templates/head.html}} + +
+
+ +

Avant.org

+ +
+
+ + + + {{>templates/post-list.html}} + +
+
+ +{{>templates/foot.html}} \ No newline at end of file diff --git a/schema/site/templates/meta-list.html b/schema/site/templates/meta-list.html new file mode 100644 index 0000000..fbeeae3 --- /dev/null +++ b/schema/site/templates/meta-list.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/schema/site/templates/meta.html b/schema/site/templates/meta.html new file mode 100644 index 0000000..2d3cefe --- /dev/null +++ b/schema/site/templates/meta.html @@ -0,0 +1,15 @@ +{{>templates/head.html}} + +
+
+ +

Meta

+ +
+
+

{{meta}}

+ {{>templates/post-list.html}} +
+
+ +{{>templates/foot.html}} \ No newline at end of file diff --git a/schema/site/templates/post-list.html b/schema/site/templates/post-list.html new file mode 100644 index 0000000..d9e7bce --- /dev/null +++ b/schema/site/templates/post-list.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/schema/site/templates/post.html b/schema/site/templates/post.html new file mode 100644 index 0000000..940ed34 --- /dev/null +++ b/schema/site/templates/post.html @@ -0,0 +1,39 @@ +{{>templates/head.html}} + +
+
+ +
+
+
+ + {{title}} + + {{#image}} + + {{/image}} + + {{#author}} + {{author}} + {{/author}} + + {{date}} + +
+ + {{#meta}} + {{.}} + {{/meta}} + +
+ +
+
+ +
+ {{{content}}} +
+ +
+ +{{>templates/foot.html}} \ No newline at end of file diff --git a/schema/site/templates/rss.xml b/schema/site/templates/rss.xml new file mode 100644 index 0000000..fa3dc6e --- /dev/null +++ b/schema/site/templates/rss.xml @@ -0,0 +1,36 @@ + + + + Avant.org + {{domain}} + + The Personal blog and musings of Chris Penner; designer, developer and future opsimath. + Technology + 2014 Chris Penner + en-us + + {{domain}}/images/favicon.png + Chris Penner + {{domain}} + + {{#posts}} + + {{title}} + chris@chrispenner.ca (Chris Penner) + {{domain}}{{url}} + {{domain}}{{url}} + {{date}} + {{description}}... + {{#image}} + + {{/image}} + + {{/image}} + {{{content}}} + ]]> + + {{/posts}} + + diff --git a/schema/src/Avant.hs b/schema/src/Avant.hs new file mode 100644 index 0000000..3653e8e --- /dev/null +++ b/schema/src/Avant.hs @@ -0,0 +1,54 @@ +{-# language OverloadedStrings #-} +{-# language DuplicateRecordFields #-} +module Main where + +import SitePipe +import qualified Text.Mustache as MT +import qualified Text.Mustache.Types as MT +import qualified Data.Text as T + +main :: IO () +main = siteWithGlobals templateFuncs $ do + -- Load all the posts from site/posts/ + posts <- resourceLoader markdownReader ["posts/*.md"] + -- getTags will return a list of all tags from the posts, + -- each tag has a 'tag' and a 'posts' property + let meta = getMeta makeMetaUrl posts + -- Create an object with the needed context for a table of contents + indexContext :: Value + indexContext = object [ "posts" .= posts + , "meta" .= meta + , "url" .= ("/index.html" :: String) + ] + rssContext :: Value + rssContext = object [ "posts" .= posts + , "domain" .= ("http://avant.org" :: String) + , "url" .= ("/rss.xml" :: String) + ] + + -- render pages + writeTemplate "templates/index.html" [indexContext] + writeTemplate "templates/post.html" posts + writeTemplate "templates/meta-list.html" meta + writeTemplate "templates/meta.html" meta + writeTemplate "templates/rss.xml" [rssContext] + staticAssets + +-- We can provide a list of functions to be availabe in our mustache templates +templateFuncs :: MT.Value +templateFuncs = MT.object + [ "metaUrl" MT.~> MT.overText (T.pack . makeMetaUrl . T.unpack) + ] + +makeMetaUrl :: String -> String +makeMetaUrl metaName = "/meta/" ++ metaName ++ ".html" + +-- | All the static assets can just be copied over from our site's source +staticAssets :: SiteM () +staticAssets = copyFiles + -- We can copy a glob + [ "css/*.css" + -- Or just copy the whole folder! + , "js/" + , "images/" + ] \ No newline at end of file diff --git a/schema/stack.yaml b/schema/stack.yaml new file mode 100644 index 0000000..c5d84bd --- /dev/null +++ b/schema/stack.yaml @@ -0,0 +1,69 @@ +# 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: +# http://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 +# resolver: +# name: custom-snapshot +# location: "./custom-snapshot.yaml" +resolver: lts-8.15 + +# 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 +# extra-dep: true +# subdirs: +# - auto-update +# - wai +# +# A package marked 'extra-dep: true' will only be built if demanded by a +# non-dependency (i.e. a user package), and its test suites and benchmarks +# will not be run. This is useful for tweaking upstream packages. +packages: +- '.' +- '../library' +# Dependency packages to be pulled from upstream that are not in the resolver +# (e.g., acme-missiles-0.3) +extra-deps: +- mustache-2.2.3 +- sitepipe-0.1.2 + +# 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.2" +# +# 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