All Projects → afaundez → jekyll-favicon

afaundez / jekyll-favicon

Licence: MIT license
Favicon generator and tag for Jekyll.

Programming Languages

ruby
36898 projects - #4 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to jekyll-favicon

Favicons
Favicons generator for Node.js
Stars: ✭ 872 (+5029.41%)
Mutual labels:  favicon
Webapp Webpack Plugin
[DEPRECATED] use favicons-webpack-plugin instead
Stars: ✭ 127 (+647.06%)
Mutual labels:  favicon
Supercookie
💭 Inspiration
Stars: ✭ 3,630 (+21252.94%)
Mutual labels:  favicon
Getfavicon
获取网站的Favicon图标并显示在你的网页上.
Stars: ✭ 45 (+164.71%)
Mutual labels:  favicon
Pwa Asset Generator
Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html files with the generated images according to Web App Manifest specs and Apple Human Interface guidelines.
Stars: ✭ 1,787 (+10411.76%)
Mutual labels:  favicon
Faviator
A simple easy favicon generator.
Stars: ✭ 155 (+811.76%)
Mutual labels:  favicon
Tools
Tools Online
Stars: ✭ 601 (+3435.29%)
Mutual labels:  favicon
fav
Embrace favicons the modern way 🚀. Inspired by EvilMartian's blogpost.
Stars: ✭ 22 (+29.41%)
Mutual labels:  favicon
Customizer
Kanboard - Customizer adds GUI for logo, favicon and themes
Stars: ✭ 120 (+605.88%)
Mutual labels:  favicon
Rails Env Favicon
Gem to display the rails environment on the favicon
Stars: ✭ 212 (+1147.06%)
Mutual labels:  favicon
Favicon Switcher
Make favicon react on media queries
Stars: ✭ 76 (+347.06%)
Mutual labels:  favicon
Redux Favicon
Redux middleware that displays colourful notification badges in the favicon area.
Stars: ✭ 103 (+505.88%)
Mutual labels:  favicon
Icongenie
CLI tool to generate all the icons and splashscreens for your Quasar Apps
Stars: ✭ 174 (+923.53%)
Mutual labels:  favicon
Head
A simple guide to HTML <head> elements
Stars: ✭ 28,892 (+169852.94%)
Mutual labels:  favicon
Favicon Emoji
🖼 Generate an emoji-favicon in your terminal
Stars: ✭ 247 (+1352.94%)
Mutual labels:  favicon
Ultimate Metatags
A large snippet for your page's <head> that includes all the meta tags you'll need for OPTIMAL sharing and SEO. Extensive work has been put into ensuring you have the optimal images for the most important social media platforms.
Stars: ✭ 24 (+41.18%)
Mutual labels:  favicon
Favicongrabber.com
Grabbing favicons from any domain
Stars: ✭ 152 (+794.12%)
Mutual labels:  favicon
favloader
Vanilla JavaScript library for loading animation in favicon (favicon loader)
Stars: ✭ 20 (+17.65%)
Mutual labels:  favicon
ngx-favicon
Angular service to dynamically update the favicon on an app
Stars: ✭ 21 (+23.53%)
Mutual labels:  favicon
Gatsby Plugin Favicon
Favicon Gatsby plugin
Stars: ✭ 175 (+929.41%)
Mutual labels:  favicon

Jekyll Favicon

This Jekyll plugin adds:

  • a generator for favicons (ICO, PNG, SVG), webmanifests, and browserconfig files
  • a tag for the rendinering of all the corresponding links and metadata needed

Tested with:

  • Jekyll 3.6 to 3.7, ruby 2.6 to 2.7
  • Jekyll 3.8 to 4.2, ruby 2.6 to 3.1

Prerequisites

ImageMagick

Check if it is already installed by running:

$ convert --version | grep Version
Version: ImageMagick 7.0.8-46 Q16 x86_64 2019-05-19 https://imagemagick.org

librsvg (optional)

If you are having pixeled icons or if you have a problem converting SVG files, you may need to install the package librsvg2-bin. For example, in Ubuntu/Debian systems:

sudo apt install librsvg2-bin

You may need to install librsvg before installing the RSVG renderer.

Check the devcontainer's Dockerfile for more practical details.

Installation

Add this line to your application's Gemfile:

gem 'jekyll-favicon', '~> 1.1.0', group: :jekyll_plugins

Usage

If you are going to use this plugin in a hosted build/service, be sure that they include your plugins as part of the process. You can check gh-pages branch for a working example.

As Github Pages doesn't load custom plugins, this plugin won't be included on the build process. As a workaround, you can build your site and push all files (for example, build to docs, version it and push it, although this works only for project pages).

Generator

By installing the plugin, it will be automatically activated without further configurations.

You can override these settings in your sites's _config.yml. The simplest configuration would be this:

favicon:
  source: custom-favicon-png-or.svg

This plugin works best if you use an SVG with a square viewbox as the source, but you can also use a PNG instead (at least 558x588). Check the fixtures favicon.svg or favicon.png as examples.

Favicon tag

To get the links and meta, just add the favicon tag {% favicon %}. For example, on your index.html

---
---
<!DOCTYPE html>
<html>
  <head>
    {% favicon %}
  </head>
  <body>
  </body>
</html>

Configuration

The plugin customization goes in the favicon key in the _config.yml file. There are four key parameters:

attribute name type default description
source hash/string
name: favicon.svg
dir: .
SVG or PNG file relative to site's source. Any favicon without explicit source will use this attribute as default.
background string transparent Color keyword or Hex representation. Any favicon without explicit convert background will use this attribute as default.
dir string . Path relative to site's source. Any favicon without explicit source dir will use this attribute as default.
assets array see defaults Array of asset configuration. Any asset define here will be controlled with this plugin.

Assets

The assets is an array of file spec:

attribute name type default description
name string file's basename. Required.
dir string/symbol :site_dir file's dir, relative to site's destination
source hash file's source. Required.
convert hash {} see convert defaults
tags array [] see tags defaults
refer hash [] see refer defaults

Symbol values:

  • :background: favicon's global background
  • :site_dir: favicon's global dir
  • :href: favicons absolute URL path

Convert

The convert configuration is specific for each type of convertion: SVG to ICO/PNG/SVG and PNG to ICO/PNG.

attribute name type default description
alpha string see convert config see imagemagick alpha docs
background string/symbol see convert config see imagemagick background docs
define string/symbol see convert config see imagemagick define docs
extent string/symbol see convert config see imagemagick extent docs
gravity string see convert config see imagemagick gravity docs
resize string see convert config see imagemagick resize docs
size string see convert config see imagemagick size docs

Symbol values:

  • :auto: if sizes is not a square, then sizes
  • :max: 3 times the largest dimension

Tags

The tags configuration is a list of hashes with only one key, link or meta, and only one value, a hash with the HTML attributes associated to the key. See tags defaults for more details.

Refer

The refer configuration is a list of hashes with only one key, webmanifest or browserconfig, and only one value, a hash that will override the associated file. See refer defaults for more details.

Development

If you want to add something, just make a PR. There is a lot to do:

  • Tests more cases
  • Keep updated the favicons and files needed with modern browsers

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/afaundez/jekyll-favicon. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open-source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Jekyll Favicon project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the code of conduct.

Acknowledgments

Notoriously inspired by jekyll/jekyll-seo-tag and jekyll/jekyll-sitemap.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].