GithubHelp home page GithubHelp logo

jenbuzz / ngx-metafrenzy Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 2.0 3.3 MB

๐Ÿท๏ธ Angular module for setting meta/link tags such as open graph, canonical, robots, and title

License: MIT License

TypeScript 93.27% HTML 1.12% JavaScript 5.07% Dockerfile 0.54%
angular metatags angular-library ngx angular-universal server-side-rendering hacktoberfest

ngx-metafrenzy's People

Contributors

dependabot[bot] avatar jenbuzz avatar maxime1992 avatar

Stargazers

 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

ngx-metafrenzy's Issues

Add a removeLinkTag method

Hi Jenbuzz,

thanks for open sourcing this library ๐Ÿ˜„

I'm trying to dynamically set the canonical URL on the page. And I've found exactly what I'm looking for: setCanonical ๐Ÿ‘Œ

But, I sometimes want to remove the canonical URL.

A use case for that is a blog post. If someone's going to a public page I do not want any canonical URL set.
If someone's going to a blog post that should have a canonical URL, I set it.
If that person goes to somewhere else, I want to remove the canonical URL.

I guess I'm basically hoping for a removeLinkTag method.

Do you think it makes sense?
I've tried to implement that myself but I'm not used to use the renderer outside of a component context and I'm not sure how to remove a given element here.

Multiple rel="alternate" hreflang

It seems unable to:

languages.forEach(language => {
    rel: 'alternate',
    hreflang: language,
    href: '...'
});

The plugin overrides every alternate and only the last one will be shown.

How to fix it?

Thanks in advance

Incompatible with typescript strictNullChecks

If you configure an angular project's typescript options with strict or strictNullChecks, then you run into compilation issues with several of metafrenzy's interface definitions. For ex.,

error TS2411: Property 'charset' of type 'string | undefined' is not assignable to string index type 'string'.

This applies to all of the properties in the LinkDefinition and OpenGraph interfaces.

Also it seems that if you enable strictNullChecks for this project there are a few potential bugs identified in MetafrenzyService.

Feature: Setting page/route bound (temporary) tags.

Hello and first of all: I want to thank you for providing this library to assist with meta tags management. ๐Ÿ™๐Ÿฝ

More specifically what I would like to see: Intended usage description when leaving a page.

I do understand how to set some tags with the use of the provided service.
However I wonder how to deal with navigating away from the current page.
The way I understand it, I would still end up keeping the last set tags.
Is there a best practice of how to only apply the tags when I'm actually on the page where it applies?

Maybe even something that we can put in the about description or bake into the library itself?
Any ideas or recommendations of how to deal with that?

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.