Giter Site home page Giter Site logo

blaze-meta's Introduction

blaze-meta

Gitter

A meteor package that makes it easy to manage meta-data

This package is currently unmaintained

This package will probably be deprecated in near future, check out https://github.com/kadirahq/meteor-dochead

meteor add yasinuslu:blaze-meta
Meta.config({
  options: {
    title: "Default Title",
    suffix: "Suffix"
  }
});

Meta.setTitle("") => "Default Title"
Meta.setTitle("test") => "test | Suffix"

Meta.set("og:title", "Title");
Meta.set("og:description", "Description");

Meta.unset("og:title");

or

Meta.set({
  name: 'property',
  property: 'og:title',
  content: 'Titleee'
});

or

Meta.set([
  {
    name: "name",
    property: "apple-mobile-web-app-capable",
    content: "yes"
  },
  {
    name: "property",
    property: "og:locale",
    content: "en_GB"
  }
]);

which results in:

<meta name="apple-mobile-web-app-capable" content="yes">

It will be updated on DOM automatically.

blaze-meta's People

Contributors

arunoda avatar dferber90 avatar gitter-badger avatar thinklinux avatar yasinuslu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blaze-meta's Issues

Unsetting all meta tags

I'm using angular-meteor with ui-router, hence og:tags stay after set and a new page is opened. For now, I've solved this as such:

  $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
    _.each(Meta.arr(), function(item) {
      Meta.unset(item.property);
    });
  });

would be nice to have a Meta.unsetAll(); method so that _.each loop could be ommitted.

JS Console Error: Deprecated Helper Assignment

After adding this package (even if I haven't written any code to set/unset any meta tags using this package), I'm getting the following logged to Chrome's console:

W20141119-11:44:28.252(-5) (blaze.js:67) Warning: Assigning helper withTemplate.MetaTags.tags = ...is deprecated. UseTemplate.MetaTags.helpers(...)instead.

Does the package need an update? Or is this error on me?

Helper warning

This is not a real issue, but a warning, since the API has changed recently:

(blaze.js:67) Warning: Assigning helper with Template.MetaTags.tags = ... is deprecated. Use Template.MetaTags.helpers(...) instead.

Everything else works as expected! Thank you!

proper meta tags

Hello,

are you planning in providing proper meta tag definitions? Currently all meta tags named propertybut that is a very unusual property name. For descriptions it should be nameif I am not mistaken.

Cheers

TypeError: UI.materialize is not a function

I updated my meteor app to 0.8.3 and the application crashes with this error TypeError: UI.materialize is not a function from UI.materialize(Template.MetaTags, document.head); on meta.js. Any suggestions?

Can't set property with same name. Visible only last one.

For example I need :

<meta property="og:image" content="http://example.com/rock.jpg" />
<meta property="og:image" content="http://example.com/rock2.jpg" />

So when I try:

Meta.set([
        {
          name: "property",
          property: "og:image",
          content: "http://example.com/rock.jpg"
        },
        {
          name: "property",
          property: "og:image",
          content: "http://example.com/rock2.jpg"
        },
])

The result is:

<meta property="og:image" content="http://example.com/rock2.jpg" />

Can we fix it? Or it's not easy thing? Seems like second property with the same name overwrite previous one.

setTitle, iron:router and Browser History

If you are using iron:router and set page title based on route, browser history gets all messed up. I've tried Meta.setTitle in onBeforeAction, onAfterAction and action.

For testing, add three routes and on each route set a different title. Then, on your application, move from one route to another then to another. Then check the titles under history by clicking and holding the back button on your browser (assuming you are using Chrome).

Licence ?

Hi

I'd like to use this package for my app but there's no licence on the repository, which means that I can't use it due to github's policy.
Is it possible to add an open source licence like MIT ?

title set to Default Text

after installing, my site's title became 'Default Title'
I tried setting it in meteor.startup with

Meta.config({
      options: {
        title: "something",
        suffix: "something else"
      }
    });

but all my site does is showing Default Title as title

Multiple attributes on meta tags

I would love to be able to create a single meta tag for my meta description looking something like this:

<meta name="description" property="og:description" content="My awesome website will knock your socks off">

Sadly, that doesn't seem to be possible with the current API. May I instead suggest an API where passing an object with options to Meta.set would use the key as the property name and the value as the value for that property. For my example meta tag above, this would look something like this:

Meta.set({
  name: 'description',
  property: 'og:description',
  content: 'My awesome website will knock your socks off'
});

What do you think?

blaze-meta config not setting properly

I have the following code running in the /client directory, it doesn't set the company every time:

Tracker.autorun(function () {
  var config = Meteor.subscribe('public_configuration');
  if (config.ready()) {

    var company = configurations.findOne({ configuration_type: 'public' });
    console.log('meta config | company: ', company);

    if (company && company.company_name) {
      // Gets you 'Company Name' as a default title not 'Default Title'
      console.log('meta config | company name: ', company.company_name);
      Meta.config({
        options: {
          title: company.company_name,
          suffix: company.company_name
        }
      });
    }
  }
});

I get this from the Chrome console, so I know it's picking up company name and running the code:

meta config | company:  Object
meta-tracker.js:33 meta config | company name:  Test Inc.

On initial load it will not set, then if I refresh the page the company name will get set properly. Then if I hit refresh again, it will revert back to localhost:3000. On other times it says with the company name. And this is on my local box.

When I deploy to staging, I can never get the tab title to change with the same code.

It must be a timing issue?

What am I doing wrong?

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.