EMBL Favicon embl-element

Add the EMBL favicon to your project.

github location npm version

Usage

Note: There is no Sass for this component.

Variants

Nunjucks syntax

Depending on your environment you'll want to use render or include. As a rule of thumb: server-side use include, precompiled browser use render. If you're using vf-eleventy you should use include.

Using include

You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include is an abstraction of render and provides some additional portability.


{% set context fromYourYamlFile %}
- or -
{% set context = { 
"component-type" : "embl-element",
 }
%}
{% include "../path_to/embl-favicon/embl-favicon.njk" %}
                

Using render

This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include is not be available.


{% render '@embl-favicon', {
  "component-type" : "embl-element",}
%}
                
HTML
<link rel="shortcut icon" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/favicon-16x16.png">
<link rel="manifest" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/site.webmanifest">
<link rel="mask-icon" href="https://assets.emblstatic.net/vf/v2.5.0/assets/embl-favicon/assets/safari-pinned-tab.svg" color="#ffffff">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
              

Examples

Installation info

This component is distributed with npm. After installing npm, you can install the embl-favicon with this command.

$ yarn add --dev @visual-framework/embl-favicon

Sass/CSS

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Changelog

Changelog

1.0.3

  • Point favicon urls to 2.5.0 stable release.

1.0.2

  • missing a link to favicon.ico
  • adds better defaults to the site.webmanifest
  • https://github.com/visual-framework/vf-core/pull/838

1.0.0 (2019-12-17)

  • Initial stable release

Assets



File system location: components/embl-favicon

Find an issue on this page? Propose a change or discuss it.