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

linked-data-partials

v0.5.1

Published

Linked Data partials for inclusion in templates, implementing classes from Schema.org.

Downloads

13

Readme

linked-data-partials

Linked Data partials for inclusion in templates, implementing classes from Schema.org.

Motivation

To come up with a set of partials that:

  • are useful in such a large number of situations that lots of people will want to help keep them up-to-date, for everyone's benefit;
  • are provided as a module so that they can be easily imported into apps such as static-site generators (SSGs), web servers, mail servers, and so on. Being a module means that we also benefit from versioning;
  • use as much semantic HTML as possible, and continue to evolve with 'best practice';
  • contain no styling so as not to restrict their use (this is not just avoiding the use of @style, but also excluding uses of @class that are only for appearance);
  • include @property and @typeof attributes with values that align with Schema.org;
  • use template variables that also match the Schema.org properties so as to reduce the need to look up the names for values in different parts of a system.

This final point simply means that software making use of these partials, such as SSGs, should use variables named the same as those used in Schema.org, when providing the values to be injected. For example, the title of a blog post using the BlogPosting class would be headline rather than title.

Example

To illustrate the kind of markup that is being used in the partials, here's a segment of the partial for the Schema.org BlogPosting class. This class includes properties such as articleBody and headline, and these are included in the BlogPosting partial as follows:

<article vocab="http://schema.org/" typeof="BlogPosting">
  <header>
    <h3 property="headline">{{ headline }}</h3>
  </header>
  <div property="articleBody">
    {{ articleBody }}
  </div>
</article>

The key points to note are:

  • that the RDFa @property values for Schema.org are provided, and;
  • the template variables have exactly the same name as the values in the BlogPosting class.

Currently Implemented Partials

The following partials have been added:

Blog

A blog, which is a collection of blog posts.

BlogPosting

An individual blog post.

Organization

An organisation.

SportsEvent

A sports event.

To Do

There is still work to do in the Blog partial to align the object properties with the names of the properties in Schema.org, since at the moment these are determined by static-site generators. This will be addressed, though.

There's also a bit of markup that needs to be removed, but changes in some other modules need to happen first.

There are lots of partials that it would be useful to add.

Getting Involved

More partials are of course welcome, but it's just as important to ensure that partials use the best possible markup, and provide as many properties from the Schema.org classes as possible. Any discussion on these aspects of partials will therefore be most welcome.