Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In the "themes" section of your config/config.*.yml configuration file, add (one or more) "headTags", pointing at the favicon file you want to use. For example:

    Code Block
    themes:
      # The default dspace theme
      - name: dspace
        # Whenever this theme is active, the following tags will be injected into the <head> of the page.
        # Example use case: set the favicon based on the active theme.
        headTags:
          # Insert <link rel="icon" href="assets/dspace/images/favicons/favicon.ico" sizes="any"/> into the <head> of the page.
          - tagName: link
            attributes:
              rel: icon
              href: assets/dspace/images/favicons/favicon.ico
              sizes: any
          # Insert <link rel="icon" href="assets/dspace/images/favicons/favicon.svg" type="image/svg+xml"/> into the <head> of the page.
          - tagName: link
            attributes:
              rel: icon
              href: assets/dspace/images/favicons/favicon.svg
              type: image/svg+xml
          # Insert <link rel="apple-touch-icon" href="assets/dspace/images/favicons/apple-touch-icon.png"/> into the <head> of the page.
          - tagName: link
            attributes:
              rel: apple-touch-icon
              href: assets/dspace/images/favicons/apple-touch-icon.png
          # Insert <link rel="manifest" href="assets/dspace/images/favicons/manifest.webmanifest"/> into the <head> of the page.
          - tagName: link
            attributes:
              rel: manifest
              href: assets/dspace/images/favicons/manifest.webmanifest


  2. In 7.2 or above, any changes to this configuration just require restarting your site (no rebuild necessary).  In 7.1 or 7.0, you must rebuild your site after modifying the favicon.ico.
  3. NOTE: If you specify multiple formats for your favicon (e.g. favicon.svg and favicon.ico), then your browser will select which one it prefers (e.g. Chrome seems to favor SVG over ICO).  SoHowever, if you want to force all browser to use a single favicon, then you may wish to only specify one "icon" format in your headTags  section.

...