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.
- Host: GitHub
- URL: https://github.com/athanclark/webpage
- Owner: athanclark
- License: bsd-3-clause
- Created: 2014-12-09T20:54:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-01-26T07:59:27.000Z (over 7 years ago)
- Last Synced: 2025-12-26T22:53:48.739Z (6 months ago)
- Topics: haskell, html, webpage, wordpress
- Language: Haskell
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.