yihangho / emoji-for-jekyll Goto Github PK
View Code? Open in Web Editor NEWA plugin for Jekyll that seamlessly enable emoji.
Home Page: http://rubygems.org/gems/emoji_for_jekyll
License: MIT License
A plugin for Jekyll that seamlessly enable emoji.
Home Page: http://rubygems.org/gems/emoji_for_jekyll
License: MIT License
HI, could you please provide some examples of syntax for integrating the emojis in blog text?
Seems to only handle page body. (It is really great).
My blog isn't located at the root of my webspace but in a subdirectory. So I've set the baseurl
accordingly in my _config.yml
.
After installing your plugin and trying to use emoji from a local directory instead of including them from GitHub I've noticed that the plugin correctly found the image files in the local directory but generated the wrong URL for the img-tags: The baseurl
-part of the URL was missing.
Adding the baseurl to emoji-images-path
didn't work either as the look up of the local image files failed that way.
As a start here's my quick&dirty patch:
diff --git a/_plugins/emoji_for_jekyll.rb b/_plugins/emoji_for_jekyll.rb
index 39eb05d..1d0f04b 100644
--- a/_plugins/emoji_for_jekyll.rb
+++ b/_plugins/emoji_for_jekyll.rb
@@ -38,7 +38,7 @@ module EmojiForJekyll
Dir.foreach(images_dir) do |image_filename|
if /^(?<tag>.*)\.(?:svg|png|jpg|jpeg|gif)/ =~ image_filename
@master_whitelist << tag
- @images_path[tag] = File.join("/", images_path, image_filename)
+ @images_path[tag] = File.join("/", site.config["baseurl"], images_path, image_filename)
end
end
This solved the problem for me but obviously needs some additional checking if baseurl exists at all.
Sorry for not just providing a merge request with a final solution, but I don't really know Ruby and just don't want to deliver a botched C++-style solution. ๐
Hello,
I placed emoji_for_jekyll.rb
and emoji.json
into _plugins
.
In _config.yaml
I added emoji: true
. In a post I edited the text and added :smile:
into it. When using jekyll build
then it gets not changed to a img element.
What am I doing wrong?
I am using the latest version of that plugin from here and jekyll is version jekyll 3.1.6
.
You can view the page at: https://github.com/wirehack7/capsop.com
hi @yihangho
I'm using your pluggin with jekyll and it's fun.
It works fine for rendering pages at the root of my site and also into posts.
But seems not working with pages in collections, something to do ?
regards
Copied over *rb and json to _plugins. Works locally but not on prod. My site is deployed on github.
Deprecation: Collection#each should be called on the #docs array directly.
Called by /Users/Vikram/Documents/code/vikram/blog/_plugins/emoji_for_jekll.rb:23:in `generate'.
Exactly as it sounds, emojis do not render in excerpts.
Hi,
I'm new to Ruby. Just curious how to call this plugin from another plugin? I'd like to apply your code to a string of markdown text.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.