Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11 - add support for objects passed to link #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

linkesch
Copy link

Add support for objects passed to link option which makes possible more advanced meta tags like:

<link rel="icon" type="image/png" sizes="32x32" href="/img/favicons/favicon-32x32.png">
<link rel="alternate" type="application/rss+xml" href="/foo/feed" />
<link rel="alternate" href="/url" hreflang="en-us" />

This PR is backwards compatible. You can still use the old format for simpler meta tags:

var meta = {
    link: {
        rel: {
            stylesheet: [
                'http://domain.tld/css/vendor.css',
                'http://domain.tld/css/styles.css'
            ]
        }
    }
};

But for more advanced you can use this:

var meta = {
    link: {
        rel: {
            alternate: [
                { href: '/alternate/us', hreflang: 'en-us' },
                { href: '/alternate/gb', hreflang: 'en-gb' }
            ]
        }
    }
};

@linkesch
Copy link
Author

Fixes #11

@danieljuhl
Copy link
Contributor

Thanks! I'll have a look.. One thing that I would like to test, is how changes is handled. What happens in nested cases? We need to make sure, that we are able to "remove" the old ones.

@linkesch
Copy link
Author

Yes. Good thinking. You can consider this PR as a work in progress. I needed for my project at least basic support of alternate links. So I just extended the current behavior.

@danieljuhl
Copy link
Contributor

Sounds great - I might contribute my self, I'm just trying to figure out, what would be the best approach.

@NowTV-Assurance
Copy link

Any movement on this?

@danieljuhl
Copy link
Contributor

@NowTV-Assurance yes, there is movement on this. I've just made some core changes to react-document-meta. I'm working on another version to be released start of next week, which will support this and a few other cases.

@tadjohnston
Copy link

Any idea when this might be merged? Having the same issues and needing to add a media query to a link rel tag.

@sahat
Copy link

sahat commented Jun 21, 2017

Any update on this pull request? I too need to pass a media query to alternate rel tag. Thanks!

@stocks29
Copy link

Any thoughts on when we might see this released?

@blling
Copy link

blling commented Mar 8, 2018

Any plan of this?

@Fluorz
Copy link

Fluorz commented Nov 2, 2019

I need this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants