An open API service indexing awesome lists of open source software.

https://github.com/athanclark/webpage

A generic scaffold for a web page, for lucid.
https://github.com/athanclark/webpage

haskell html webpage wordpress

Last synced: 3 months ago
JSON representation

A generic scaffold for a web page, for lucid.

Awesome Lists containing this project

README

          

# webpage

This is a general web page scaffold written in Haskell for the
[Lucid](https://github.com/chrisdone/lucid) Html DSL.

## Usage

It's pretty straigt forward:

```haskell
λ> renderText $ template def "some content"

"some content"
```

overload the particular areas with record syntax, or do whatever:

```haskell
λ> let page = def {pageTitle = "foo", bodyScripts = script_ [src_ "jquery.js"] ""}

λ> template page "some content"

"foosome content"
```

> **Note**: When using the [Hastache](http://hackage.haskell.org/package/hastache)
> implementation, the content inside a `WebPage` data type will be in the same
> scope as the rest of the template - you can access the things your final
> content will see from `metaVars`, for instance (unless you do multiple
> renderings).

> **Another Note**: We don't provide an instance for the beloved
[Hamlet](http://hackage.haskell.org/package/shakespeare)
> because under the hood, it's just Blaze-Html -
>`$(runQ $ shamletFile "foo.hamlet")` gives us an `Html`.

## Contributing

Fork, Pull-Request, repeat.