Giter VIP home page Giter VIP logo

yellow-linkpreview's Introduction

Linkpreview 0.9.1

Shows a link preview for selected links

Screenshot

How to install the extension

Download ZIP file and copy it into your system/extensions folder. Learn more about extensions.

How to show a link preview.

Create a link card that displays content from the meta properties of the linked website. If it has no meta properties, at least the title is displayed.

The link preview is only generated if it is inserted as a block element. If the shortcode is inadvertently inserted as an inline element, a normal link is generated.

Appearance

You can influence the appearance of the paragraph by adapting the stylesheet to your needs.

Examples

Put a shortcode per link anywhere in your page

[linkpreview https://example.com]

Stylesheets

Since I have removed the stylesheet from the extension so that you can integrate all style specifications in your own stylesheets, I will give you the standard styles here as CSS and, if you prefer, as SASS.

CSS

.linkpreview {
  align-items: center;
  border: 1px solid rgb(207, 213, 226);
  border-radius: 0.25rem;
  color: rgb(77, 83, 94);
  display: flex;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}

.linkpreview__content {
  box-sizing: border-box;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
  padding-inline: 1rem;
}

.linkpreview__content__title {
  color: rgb(45, 49, 56);
  display: block;
  font-size: 24px;
  font-weight: 500;
  line-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-block: 8px;
}

.linkpreview__content__description,
.linkpreview__content__host {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkpreview__image {
  aspect-ratio: 1;
  flex: 0 0 auto;
  position: relative;
  width: 110px;
}

.linkpreview__image img {
  background-position: 50%;
  background-size: cover;
  display: block;
  height: 100% !important;
  margin: 0;
  -o-object-fit: cover;
  object-fit: cover;
  width: 100%;
}

a.linkpreview {
  cursor: pointer;
}

a.linkpreview:active,
a.linkpreview:focus,
a.linkpreview:hover,
a.linkpreview:active .linkpreview__content__description,
a.linkpreview:active .linkpreview__content__url,
a.linkpreview:active .linkpreview__content__title,
a.linkpreview:focus .linkpreview__content__description,
a.linkpreview:focus .linkpreview__content__url,
a.linkpreview:focus .linkpreview__content__title,
a.linkpreview:hover .linkpreview__content__description,
a.linkpreview:hover .linkpreview__content__url,
a.linkpreview:hover .linkpreview__content__title {
  color: rgb(77, 83, 94);
  text-decoration: none;
}

SASS

.linkpreview {
    align-items: center;
    border: 1px solid rgb(207, 213, 226);
    border-radius: .25rem;
    color: rgb(77, 83, 94);
    display: flex;
    margin-top: 14px;
    overflow: hidden;
    position: relative;
    text-decoration: none;

    &__content {
        box-sizing: border-box;
        flex: 1 1 auto;
        max-width: 100%;
        overflow: hidden;
        padding-inline: 1rem;

        &__title {
            color: rgb(45, 49, 56);
            display: block;
            font-size: 24px;
            font-weight: 500;
            line-height: 24px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-block: 8px;
        }

        &__description,
        &__host {
            display: block;
            overflow: hidden;
            font-size: 14px;
            text-overflow: ellipsis;
            white-space: nowrap
        }
    }

    &__image {
        aspect-ratio: 1;
        flex: 0 0 auto;
        position: relative;
        width: 110px;

        img {
            background-position: 50%;
            background-size: cover;
            display: block;
            height: 100% !important;
            margin: 0;
            -o-object-fit: cover;
            object-fit: cover;
            width: 100%;
        }
    }
}

a.linkpreview {
    cursor:pointer;
    
    &:active,
    &:focus,
    &:hover,
    &:active .linkpreview__content__description,
    &:active .linkpreview__content__url,
    &:active .linkpreview__content__title,
    &:focus .linkpreview__content__description,
    &:focus .linkpreview__content__url,
    &:focus .linkpreview__content__title,
    &:hover .linkpreview__content__description,
    &:hover .linkpreview__content__url,
    &:hover .linkpreview__content__title {
        color: rgb(77, 83, 94);
        text-decoration: none;
    }
}

Developer

Robert Pfotenhauer. Get help.

yellow-linkpreview's People

Contributors

pftnhr avatar

Stargazers

 avatar

Watchers

 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.