sjakobi
sjakobi

Reputation: 3606

How can I embed a PNG image in a stack (mustache) template?

My specific problem is that I want to create a stack template to replace the hakyll-init executable that is included in the hakyll package.

The problematic file is haskell-logo.png. How do I have to encode this file so it is recreated when I run stack new my-project my-template.hsfiles?

Upvotes: 1

Views: 575

Answers (1)

jeiea
jeiea

Reputation: 2405

You can specify base64 as content encoding like this.

{-# START_FILE BASE64 static/fonts/glyphicons-halflings-regular.eot #-}
b08AABFOAAACAAIABAAAAAAABQAAAAAAAAABAJABAAAEAExQAAAAAAAAAAAAAAAAAAAAAAEAAAAA

That feature is provided from this stack's dependency, although not directly documented.

Upvotes: 2

Related Questions