Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elaye/hakyll-favicon
Favicons for Hakyll websites
https://github.com/elaye/hakyll-favicon
favicon hakyll haskell web
Last synced: 27 days ago
JSON representation
Favicons for Hakyll websites
- Host: GitHub
- URL: https://github.com/elaye/hakyll-favicon
- Owner: elaye
- License: bsd-3-clause
- Created: 2017-04-23T12:28:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-20T05:18:31.000Z (about 6 years ago)
- Last Synced: 2024-04-24T16:18:34.270Z (7 months ago)
- Topics: favicon, hakyll, haskell, web
- Language: Haskell
- Size: 15.6 KB
- Stars: 4
- Watchers: 0
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# hakyll-favicon [![Build Status](https://travis-ci.org/elaye/mushu.svg?branch=master)](https://travis-ci.org/elaye/hakyll-favicon)
This library allows you to easily add favicons to your hakyll website.
You provide one SVG image and the library will convert it to different resolutions and generate the corresponding html.## Dependencies
This library depends on `ImageMagick` to convert the images.
## Usage
First, add a `faviconsRules` that points to your main favicon in your `Site.hs` file like this:
```
main = hakyll $ do
faviconsRules "images/favicon.svg" -- path to your favicon
...
```Second, add a `favicons` field in your template `head`:
```
...
$favicons$```
Finally add the favicons context to your template context:
```
main = hakyll $ do
...
match "index.html" $ do
...
let ctx = ... `mappend`
... `mappend`
faviconsField `mappend` -- add this
defaultContext
...
```The [example](example/) directory provides a minimal working example of this.
## Example
First, build the example:
stack build
Then build the example page:
stack exec example build
Or you can start a local server to serve the generated page:stack exec example watch
## Generated favicons
The following favicons are generated:
target | format | sizes | description
-------------|--------|--------|------------
all | .ico | 32, 64 | basic favicon
all | .png | 32 | basic favicon
iOS | .png | 144 | third-generation iPad with high-resolution Retina display
iOS | .png | 114 | iPhone with high-resolution Retina display
iOS | .png | 72 | first- and second-generation iPad
iOS, Android | .png | 57 | non-Retina iPhone, iPod Touch, and Android 2.1+ devices