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

aurelia-meta

v1.0.0

Published

A plugin on top of aurelia-router to handle meta tags of your application, both automatically and manually.

Downloads

16

Readme

aurelia-meta

A plugin on top of aurelia-router to handle meta tags of your application, both automatically and manually.

Usage

  1. Install the plugin
yarn install aurelia-meta
  1. Make Aurelia aware of your application
aurelia.use.plugin('aurelia-meta');
  • Bear in mind to use PLATFORM.moduleName if you use webpack
  1. It's ready to use, just add your meta tags to your routes as a property, no matter whether it's a parent route or a child one.
config.map([
      {
        route: '',
        name: 'home',
        moduleId: PLATFORM.moduleName('./routes/home'),
        nav: true,
        title: 'Home',

        meta: [
          {
            name: 'home', content: 'This is a Home page'
          },
          {
            property: 'og:title' , content:'Home'
          },
          {
            property: 'og:description' , content:'Aurelia meta is a plugin for Aurelia'
          }
        ]
      },
  ...
]);
  • If you want to add meta tags manually and not necessarily on route changes, use one of these services: Router, AureliaMetaService and use the appropriate methods for your purpose.
import { autoinject } from "aurelia-framework";
import { AureliaMetaService } from "aurelia-meta";

@autoinject()
export class HomeRouteComponent{

  message: string = "Hello world!";

  constructor(private aureliaMetaService: AureliaMetaService) { }

  activate() {
    this.aureliaMetaService.addTag({
      name: 'author' , content:'Saeed Ganji'
    });
  }
  
  deactivate() {
    this.aureliaMetaService.removeTag({
      name: 'author' , content:'Saeed Ganji'
    })
  }
}
  • Keep in mind that you are responsible to remove tags that you have added manually, the plugin only automatically handles tags defined on the routes.

Build

  • To build the plugin clone this repository and run au build-plugin
  • To run the sample project run npm start