chriskempson / jekyll-emoji

A jekyll plug-in that provides a Liquid filter for emojifying text with https://github.com/github/gemoji. See http://www.emoji-cheat-sheet.com for a full listing of emoji codes.
22 stars 5 forks source link

gemoji (LoadError) #1

Closed s10wen closed 11 years ago

s10wen commented 11 years ago

Trying to get this up and running with Octopress.

Went over the readme, did a rake generate, then rake preview, but getting the following error: `require': cannot load such file -- gemoji (LoadError)

Any ideas please?

chriskempson commented 11 years ago

Have you got the gemoji gem installed?

gem install gemoji or add gem 'gemoji' to your gemfile.

s10wen commented 11 years ago

Yes, did both those, that got rid of the LoadError cheers, but I'm still seeing :smiley: rather than the icon graphic when I do a rake generate, rake preview.

chriskempson commented 11 years ago

Have you applied the filter to the area you wish to be parsed? e.g. {{ content | emojify }}

s10wen commented 11 years ago

Do you need to do {{ content | emojify }} as well as add :smiley: ? If so, where do you add {{ content | emojify }} please?

chriskempson commented 11 years ago

I just took a look at the Ocotopress source. I'm guessing it's this file to add emoji to the posts: https://github.com/imathis/octopress/blob/master/.themes/classic/source/_includes/article.html

And this file to add emoji to the pages: https://github.com/imathis/octopress/blob/master/.themes/classic/source/_layouts/page.html

s10wen commented 11 years ago

Now getting Liquid Exception: No such file or directory - ./images/emoji in post Guess it's looking in the wrong place?

s10wen commented 11 years ago

In Finder, I can see them at images/emoji and source/images/emoji

chriskempson commented 11 years ago

Give me a second. I'm going to have to install Octopress to figure this one out.

s10wen commented 11 years ago

Lol, don't have to do that mate! I'm almost there, with {{ content | excerpt }} can you like do multiple e.g. {{ content | excerpt | emojify }}?

Just got it working with pages! :dancer:

chriskempson commented 11 years ago

Oh just got Octopress installed haha. So it's working now? Great :smile:. Yep {{ content | excerpt | emojify }} should be fine.

s10wen commented 11 years ago

So close! Changed {{ content }} to {{ content | emojify }} in the page.html and it's all cool, but when I do the same thing in the article.html I get Liquid Exception: No such file or directory - ./images/emoji in post

chriskempson commented 11 years ago

I figured out the issue but fixing it is proving tricky.

s10wen commented 11 years ago

K, ta for helping out, is there a work around for the time being?

chriskempson commented 11 years ago

No work around I'm afraid but I've just updated the plugin for you. You'll need to replace the plugin with the new version and place emoji_dir: images/emoji in your _config.yml file. I've confirmed this works with Octopress.

s10wen commented 11 years ago

Awesome, seems to work ok!

Just wondering... the images are 64x64. Previously in the HTML there was a height of 20, but it was still pulling in the 64x64 images, wondering if it's better to serve 20x20 images?

chriskempson commented 11 years ago

Great, glad to hear it works now.

It wasn't good to hardcode the image size into the plugin, so the images are now shown at their native size. Each image has an emoji class so a little CSS like .emoji { width: 20px; height: 20px; } will allow you to choose the size that suits your site. I suppose I could have made it a config option to be placed in your _config.yml. Wasn't sure what people would prefer though.

s10wen commented 11 years ago

Just wondering if it's possible to serve 20x20 images, rather than scaling them down?

chriskempson commented 11 years ago

The gemoji gem (https://github.com/github/gemoji) supplies the images in 64x64px. If you want 20x20px you could just batch process the images in your images/emoji dir.

s10wen commented 11 years ago

Cool, thanks for the help :v:

Wrote up a blog on how I got it working: http://simonowendesign.github.com/blog/2013/03/23/adding-emoticons-to-octopress/