npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@visual-framework/embl-content-hub-loader

v1.2.0

Published

embl-content-hub-loader component

Downloads

2,064

Readme

EMBL ContentHub Loader component

npm version

About

Use this component to remotely load markup and content from the central EMBL ContentHub, this particular component allows reuse and distribution of content ranging articles to navigation elements (such as a global footer).

Usage

Currently this is done as HTML imports (see the code example) + some JS. In the future other methods will be support (such as JSON).

Integrations

After loading from contentHub, this component will also invoke these functions on child content:

  • vf-banner/vf-banner
  • vf-tabs/vf-tabs
  • embl-conditional-edit/embl-conditional-edit
  • embl-notifications/embl-notifications

Supported patterns

See the introductory text on the contentHub.

Standard HTML import

Load a content and pattern through the contentHub:

<link rel="import" href="https://www.embl.org/api/v1/pattern.html?filter-content-type=article&filter-id=580&pattern=node-body&source=contenthub" data-target="self" data-embl-js-content-hub-loader>

Options

There are optional features specified by data attributes, looks like:

<link rel="import" href="https://www.embl.org/api/v1/pattern.html?source=contenthub&pattern=embl-person-publications&limit=100&sort-field-value[changed]=DESC&orcid=0000-0002-2524-5026&source=contenthub" data-target="publications-block" data-embl-js-content-hub-loader-no-content="No publications were found." data-embl-js-content-hub-loader-no-content-hide=".publications-container" data-embl-js-content-hub-loader>

Breakdown:

  • data-target="publications-block": pass the class of an element to insert text into
  • data-embl-js-content-hub-loader-no-content="No publications were found.": String to use if no results found, can also pass true to use default no match text
  • data-embl-js-content-hub-loader-no-content-hide=".publications-container": If no results, hide an element that matches this selector selector
  • data-inject-class="vf-grid vf-grid__col-2" data-inject-class-target="ul": Inject class(es) to a an element inside the returned content

Install

This repository is distributed with npm. After installing npm and yarn, you can install with this command.

$ yarn add --dev @visual-framework/embl-content-hub-loader

Sass/CSS

The style files included are written in Sass. If you're using a VF-core project, you can import it like this:

@import "@visual-framework/embl-content-hub-loader/index.scss";

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

Help