René's URL Explorer Experiment


Title: Twemoji in Rails · Issue #18 · jollygoodcode/jollygoodcode.github.io · GitHub

Open Graph Title: Twemoji in Rails · Issue #18 · jollygoodcode/jollygoodcode.github.io

X Title: Twemoji in Rails · Issue #18 · jollygoodcode/jollygoodcode.github.io

Description: If you want to integrate Emoji for your Rails project, Twemoji would be a good choice, gemoji is also available. They're all open sourced and free to use if you properly attribute. Twemoji provides set of Emoji Keywords (Names) like :hea...

Open Graph Description: If you want to integrate Emoji for your Rails project, Twemoji would be a good choice, gemoji is also available. They're all open sourced and free to use if you properly attribute. Twemoji provides...

X Description: If you want to integrate Emoji for your Rails project, Twemoji would be a good choice, gemoji is also available. They're all open sourced and free to use if you properly attribute. Twemoji prov...

Opengraph URL: https://github.com/jollygoodcode/jollygoodcode.github.io/issues/18

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Twemoji in Rails","articleBody":"If you want to integrate Emoji for your Rails project, [Twemoji](https://github.com/jollygoodcode/twemoji) would be a good choice, [gemoji](https://github.com/github/gemoji) is also available. They're all open sourced and free to use if you properly attribute.\n\nTwemoji provides set of [Emoji Keywords](https://github.com/jollygoodcode/emoji-keywords) (Names) like `:heart:`, `:man::skin-tone-2:`, `:man-woman-boy:`:\n\n\u003cimg width=\"252\" alt=\"screenshot 2016-06-09 15 18 13\" src=\"https://cloud.githubusercontent.com/assets/1000669/15921651/6aca7102-2e55-11e6-889e-7037aee20605.png\"\u003e\n\nSo you can let your users type these keywords and store the simple string in your database instead of storing the real Unicodes which may be troublesome for some database (read: [older version of MySQL](http://blog.arkency.com/2015/05/how-to-store-emoji-in-a-rails-app-with-a-mysql-database/)).\n## Integrate with Rails\n\nInstall Twemoji:\n\n``` ruby\n# Gemfile\ngem \"twemoji\", \"~\u003e 3.0.0\"\n```\n## View\n\nAnd just add a simple View Helper:\n\n``` ruby\nmodule EmojiHelper\n  def emojify(content, **options)\n    Twemoji.parse(h(content), options).html_safe if content.present?\n  end\nend\n```\n\nThen in where your content contains emoji, apply this view helper:\n\n``` html+erb\n\u003c%= emojify post.body %\u003e\n```\n\nIn the `post.body` that all occurrences of emoji keywords will be replaced into Twemoji image.\n\nTwemoji by Twitter provides you scalable SVG images that powered by kind folks from MaxCDN, e.g.:\n\n\u003cimg width=\"72\" alt=\"screenshot 2016-06-09 14 58 40\" src=\"https://twemoji.maxcdn.com/2/svg/1f60d.svg\"\u003e\n\nhttps://twemoji.maxcdn.com/2/svg/1f60d.svg\n\nPNG is also available of size `72x72`: https://twemoji.maxcdn.com/2/72x72/1f60d.png.\n\nAdd a little CSS:\n\n``` css\nimg.emoji {\n  height: 1em;\n  width: 1em;\n  margin: 0 .05em 0 .1em;\n  vertical-align: -0.1em;\n}\n```\n\nand make sure your HTML is unicode-friendly:\n\n``` html\n\u003cmeta charset=\"utf-8\"\u003e\n```\n\nVoilà, very simple.\n## Mailer\n\nIn your mailer, you can fallback the SVG images to PNG format by passing in [`file_ext` option](https://github.com/jollygoodcode/twemoji#file_ext):\n\n``` erb\n\u003c%= emojify post.body, file_ext: \"png\" %\u003e\n```\n## Front-end\n\nProvide a json which contains all \"emoji name to unicode\" mappings for your front-end:\n\n``` ruby\n# emojis.json.erb\n\u003c%=\n  Twemoji.codes.map do |code, _|\n    Hash(\n      value: code,\n      html: content_tag(:span, Twemoji.parse(code).html_safe + \" #{code}\" )\n    )\n  end.to_json.html_safe\n%\u003e\n```\n\nTwemoji gem also provides mappings for SVG and PNG, but they are not loaded by default:\n\n``` ruby\n\u003e require \"twemoji/svg\"\n\u003e Twemoji.svg\n{\n  \":mahjong:\"=\u003e\"https://twemoji.maxcdn.com/2/svg/1f004.svg\",\n  ...,\n  \":shibuya:\" =\u003e \"https://twemoji.maxcdn.com/2/svg/e50a.svg\",\n}\n\n\u003e require \"twemoji/png\"\n\u003e Twemoji.png\n{\n  \":mahjong:\"=\u003e\"https://twemoji.maxcdn.com/2/72x72/1f004.png\",\n  ...,\n  \":shibuya:\" =\u003e \"https://twemoji.maxcdn.com/2/72x72/e50a.png\",\n}\n```\n\nIf above data fits your use, you can require and use them:\n\nWith this json in place, you can then use a [autocomplete JavaScript library](https://jqueryui.com/autocomplete/) to implement the autocomlpete feature:\n\n\u003cimg width=\"256\" alt=\"screenshot 2016-06-09 14 58 40\" src=\"https://cloud.githubusercontent.com/assets/1000669/15921416/eeb498c8-2e53-11e6-9dfb-fb228b69469f.png\"\u003e\n\nTwemoji also plays nicely if you implement markdown with [html-pipeline](https://github.com/jch/html-pipeline).\n\nAdd a `EmojiFilter`:\n\n``` ruby\nmodule HTML\n  class Pipeline\n    module Twitter\n      class EmojiFilter \u003c HTML::Pipeline::Filter\n        def call\n          Twemoji.parse(doc,\n            file_ext:   context[:file_ext]   || 'svg',\n            class_name: context[:class_name] || 'emoji',\n            img_attrs:  context[:img_attrs],\n          )\n        end\n      end\n    end\n  end\nend\n```\n\nand include the `EmojiFilter` in your filter chain:\n\n``` ruby\nHTML::Pipeline.new [\n  HTML::Pipeline::MarkdownFilter,\n  HTML::Pipeline::SanitizationFilter,\n  ...\n  HTML::Pipeline::Twitter::EmojiFilter\n], { gfm: true, **options }\n```\n\nThat's bascially all about integrating Twemoji in Rails.\n","author":{"url":"https://github.com/JuanitoFatas","@type":"Person","name":"JuanitoFatas"},"datePublished":"2016-06-09T07:14:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/18/jollygoodcode.github.io/issues/18"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:859fb021-0b53-5f14-b08c-82bf6f0eeeda
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED64:1683F:462A35:5E09D7:6A5EDE26
html-safe-nonceb988b2c92fad374717e0e16cde9959f4f9d4e22a42281e0cd00175f64dd9bec2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDY0OjE2ODNGOjQ2MkEzNTo1RTA5RDc6NkE1RURFMjYiLCJ2aXNpdG9yX2lkIjoiODMxMTQ0NzEyNzYwNTU2NzAxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6962ba79615d987d06902b879ccb73063a057a9d128416ad2385b4d245260c40
hovercard-subject-tagissue:159342274
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/jollygoodcode/jollygoodcode.github.io/18/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e995b6e7a1d6861931aff6795389a5ab0259ca563213322e30e35eb8f661673c/jollygoodcode/jollygoodcode.github.io/issues/18
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e995b6e7a1d6861931aff6795389a5ab0259ca563213322e30e35eb8f661673c/jollygoodcode/jollygoodcode.github.io/issues/18
og:image:altIf you want to integrate Emoji for your Rails project, Twemoji would be a good choice, gemoji is also available. They're all open sourced and free to use if you properly attribute. Twemoji provides...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJuanitoFatas
hostnamegithub.com
expected-hostnamegithub.com
None82d0004a35927bdb00c652a57f456c55aa0eda4ade1bc7956d7510fdea6e454b
turbo-cache-controlno-preview
go-importgithub.com/jollygoodcode/jollygoodcode.github.io git https://github.com/jollygoodcode/jollygoodcode.github.io.git
octolytics-dimension-user_id5326832
octolytics-dimension-user_loginjollygoodcode
octolytics-dimension-repository_id39484578
octolytics-dimension-repository_nwojollygoodcode/jollygoodcode.github.io
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id39484578
octolytics-dimension-repository_network_root_nwojollygoodcode/jollygoodcode.github.io
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released2d913dd727d2d7ac189fb4d05b10bc34ecd03ee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjollygoodcode%2Fjollygoodcode.github.io%2Fissues%2F18
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjollygoodcode%2Fjollygoodcode.github.io%2Fissues%2F18
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=jollygoodcode%2Fjollygoodcode.github.io
Reloadhttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18
Reloadhttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18
Reloadhttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18
Please reload this pagehttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18
jollygoodcode https://github.com/jollygoodcode
jollygoodcode.github.iohttps://github.com/jollygoodcode/jollygoodcode.github.io
Notifications https://github.com/login?return_to=%2Fjollygoodcode%2Fjollygoodcode.github.io
Fork 4 https://github.com/login?return_to=%2Fjollygoodcode%2Fjollygoodcode.github.io
Star 136 https://github.com/login?return_to=%2Fjollygoodcode%2Fjollygoodcode.github.io
Code https://github.com/jollygoodcode/jollygoodcode.github.io
Issues 21 https://github.com/jollygoodcode/jollygoodcode.github.io/issues
Pull requests 0 https://github.com/jollygoodcode/jollygoodcode.github.io/pulls
Actions https://github.com/jollygoodcode/jollygoodcode.github.io/actions
Projects https://github.com/jollygoodcode/jollygoodcode.github.io/projects
Wiki https://github.com/jollygoodcode/jollygoodcode.github.io/wiki
Security and quality 0 https://github.com/jollygoodcode/jollygoodcode.github.io/security
Insights https://github.com/jollygoodcode/jollygoodcode.github.io/pulse
Code https://github.com/jollygoodcode/jollygoodcode.github.io
Issues https://github.com/jollygoodcode/jollygoodcode.github.io/issues
Pull requests https://github.com/jollygoodcode/jollygoodcode.github.io/pulls
Actions https://github.com/jollygoodcode/jollygoodcode.github.io/actions
Projects https://github.com/jollygoodcode/jollygoodcode.github.io/projects
Wiki https://github.com/jollygoodcode/jollygoodcode.github.io/wiki
Security and quality https://github.com/jollygoodcode/jollygoodcode.github.io/security
Insights https://github.com/jollygoodcode/jollygoodcode.github.io/pulse
Twemoji in Railshttps://github.com/jollygoodcode/jollygoodcode.github.io/issues/18#top
Bloghttps://github.com/jollygoodcode/jollygoodcode.github.io/issues?q=state%3Aopen%20label%3A%22Blog%22
https://github.com/JuanitoFatas
JuanitoFatashttps://github.com/JuanitoFatas
on Jun 9, 2016https://github.com/jollygoodcode/jollygoodcode.github.io/issues/18#issue-159342274
Twemojihttps://github.com/jollygoodcode/twemoji
gemojihttps://github.com/github/gemoji
Emoji Keywordshttps://github.com/jollygoodcode/emoji-keywords
https://cloud.githubusercontent.com/assets/1000669/15921651/6aca7102-2e55-11e6-889e-7037aee20605.png
older version of MySQLhttp://blog.arkency.com/2015/05/how-to-store-emoji-in-a-rails-app-with-a-mysql-database/
https://camo.githubusercontent.com/fa1c72750b0e7bf7feae665192f28b05d531ab81b86794b54f46795079f3493d/68747470733a2f2f7477656d6f6a692e6d617863646e2e636f6d2f322f7376672f31663630642e737667
https://twemoji.maxcdn.com/2/svg/1f60d.svghttps://twemoji.maxcdn.com/2/svg/1f60d.svg
https://twemoji.maxcdn.com/2/72x72/1f60d.pnghttps://twemoji.maxcdn.com/2/72x72/1f60d.png
file_ext optionhttps://github.com/jollygoodcode/twemoji#file_ext
autocomplete JavaScript libraryhttps://jqueryui.com/autocomplete/
https://cloud.githubusercontent.com/assets/1000669/15921416/eeb498c8-2e53-11e6-9dfb-fb228b69469f.png
html-pipelinehttps://github.com/jch/html-pipeline
Bloghttps://github.com/jollygoodcode/jollygoodcode.github.io/issues?q=state%3Aopen%20label%3A%22Blog%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.