Code Monkey home page Code Monkey logo

obsidian-link-favicon's Introduction

Link Favicons

Plugin for Obsidian

GitHub package.json version GitHub manifest.json dynamic (path) GitHub libera manifesto

With this plugin you can see the favicon for a linked website without using any custom CSS.

Demo

Works with: Admonition , RSS Reader and many more plugins.

Also check out Link Favicons for Firefox & Chromium based browsers

Icon Providers

You can select between these providers in the settings:

Provider Max Size Fallback max requests
Google 16x16px default icon no limit️
DuckDuckGo none default icon no limit
Favicon Grabber none none 100 per minute
The Favicon Finder (selfhosted) 256x256px automatically generated no limit️
Icon Horse none automatically generated fair use policy
Splitbee none yes (from Google) unknown

Depending on which provider you choose the icons might look different.

The Icon Provider will only receive the hostname your links, so forum.obsidian.md instead of https://forum.obsidian.md/t/custom-link-favicons-hiding-in-community-plugins/24112/5?u=joethei

Overwriting icons

Requires the Icon Shortcodes plugin

You can overwrite any domain favicon with an icon of your choosing in the settings. (See the demo gif below)

Defining Icons for URI Schemes

Requires the Icon Shortcodes plugin

You can also add icons for uri schemes such as mailto://, obsidian:// or calculator://. To do this specify the name of the uri scheme(without ://) in the settings. (See the demo gif below)

Custom icons demo

Disabling on specific links

If you have a link where you do not want to see the favicon, add |nofavicon to the link alias.

[Display text|nofavicon](https://example.org)

For Designers

For help with styling you can also check out the #appearance channel on the Obsidian Members Group Discord

If you want to style the favicons you can use a CSS snippet similar to the one below, which makes all favicons appear in grayscale.

body .link-favicon[data-is-readable-a-a] {
	filter: grayscale(100%);
}

If you want to disable your own styling for favicons you can check if the data-favicon Attribute is "true". The example below removes the external link icon .

.external-link::after {
	display: none;
	content: '';
}

.external-link {
	background-image: none;
}

Color Inversion

By default, icons that are perceived as unreadable will have a color filter applied to help with readability. There are multiple metrics that could be used to decide if an icon is readable or not:

By default, the AA value is used.

using the is-dark, is-light values is not recommended as they don't take the background color into account.

These values are calculated from the average color. Using the most dominant color would be more accurate, but is not implemented currently.

For Developers

As long as you use the renderMarkdown Method this plugin will add favicons to your external links. If you want no link favicons in your plugin either add no-favicon to your source path when calling the method. Or specify the Attribute data-no-favicon on your link element.

obsidian-link-favicon's People

Contributors

joethei avatar chuangcaleb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.