Comparing version 2.1.0 to 2.1.1
@@ -5,2 +5,8 @@ # Changelog | ||
## v2.1.1 - 10/09/19 | ||
### Fixed | ||
- Fixed issue with `mobileAlternate` and `languageAlternate` only working in Default SEO [PR #98](https://github.com/garmeeh/next-seo/pull/98) | ||
## v2.1.0 - 10/09/19 | ||
@@ -7,0 +13,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireWildcard=require("@babel/runtime-corejs2/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime-corejs2/helpers/interopRequireDefault"),_Object$defineProperty=require("@babel/runtime-corejs2/core-js/object/define-property");_Object$defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits")),_head=_interopRequireDefault(require("next/head")),_react=_interopRequireWildcard(require("react")),_buildTags=_interopRequireDefault(require("./buildTags")),_default=/*#__PURE__*/function(a){function b(){return(0,_classCallCheck2["default"])(this,b),(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(b).apply(this,arguments))}return(0,_inherits2["default"])(b,a),(0,_createClass2["default"])(b,[{key:"render",value:function render(){var a=this.props,b=a.title,c=a.noindex,d=a.description,e=a.canonical,f=a.openGraph,g=a.facebook,h=a.twitter,i=a.additionalMetaTags,j=a.titleTemplate;return _react["default"].createElement(_head["default"],null,(0,_buildTags["default"])({title:b,noindex:void 0!==c&&c,description:d,canonical:e,facebook:g,openGraph:f,additionalMetaTags:i,twitter:h,titleTemplate:j}))}}]),b}(_react.Component);exports["default"]=_default; | ||
"use strict";var _interopRequireWildcard=require("@babel/runtime-corejs2/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime-corejs2/helpers/interopRequireDefault"),_Object$defineProperty=require("@babel/runtime-corejs2/core-js/object/define-property");_Object$defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits")),_head=_interopRequireDefault(require("next/head")),_react=_interopRequireWildcard(require("react")),_buildTags=_interopRequireDefault(require("./buildTags")),_default=/*#__PURE__*/function(a){function b(){return(0,_classCallCheck2["default"])(this,b),(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(b).apply(this,arguments))}return(0,_inherits2["default"])(b,a),(0,_createClass2["default"])(b,[{key:"render",value:function render(){var a=this.props,b=a.title,c=a.noindex,d=a.description,e=a.canonical,f=a.openGraph,g=a.facebook,h=a.twitter,i=a.additionalMetaTags,j=a.titleTemplate,k=a.mobileAlternate,l=a.languageAlternate;return _react["default"].createElement(_head["default"],null,(0,_buildTags["default"])({title:b,noindex:void 0!==c&&c,description:d,canonical:e,facebook:g,openGraph:f,additionalMetaTags:i,twitter:h,titleTemplate:j,mobileAlternate:k,languageAlternate:l}))}}]),b}(_react.Component);exports["default"]=_default; |
{ | ||
"name": "next-seo", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "SEO plugin for Next.js projects", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# Next SEO | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors) | ||
@@ -10,3 +10,3 @@ Next SEO is a plug in that makes managing your SEO easier in Next.js projects. | ||
**Both versions are still maintained.** | ||
**Both versions are still maintained. If upgrading from v1 to v2, please note that the `NextSeo` component has been changed from a default to a named export, so you need to update the import statements in your pages accordingly to avoid errors. Also values are now passed down as properties to the SEO components instead of only using a `config` object so refactor your code accordingly (this would fail silently and your metadata will not be there, so double check and inspect your pages html).** | ||
@@ -151,3 +151,3 @@ Version One docs can be found [here](https://github.com/garmeeh/next-seo/tree/support/1.x) | ||
To achieve this, you will need to create a custom <App>. In your pages directory create a new file, `_app.js`. See the Next.js docs [here](https://github.com/zeit/next.js/#custom-app) for more info on a custom <App>. | ||
To achieve this, you will need to create a custom `<App>`. In your pages directory create a new file, `_app.js`. See the Next.js docs [here](https://github.com/zeit/next.js/#custom-app) for more info on a custom `<App>`. | ||
@@ -200,4 +200,36 @@ Within this file you will need to import `DefaultSeo` from `next-seo` and pass it props. | ||
Alternatively you can also create a config file to store default values such as `next-seo.config.js` | ||
```js | ||
export default { | ||
openGraph: { | ||
type: 'website', | ||
locale: 'en_IE', | ||
url: 'https://www.url.ie/', | ||
site_name: 'SiteName', | ||
}, | ||
twitter: { | ||
handle: '@handle', | ||
site: '@site', | ||
cardType: 'summary_large_image', | ||
}, | ||
}; | ||
``` | ||
import at the top of `_app.js` | ||
```jsx | ||
import SEO from '../next-seo.config'; | ||
``` | ||
and the `DefaultSeo` component can be used like this instead | ||
```jsx | ||
<DefaultSeo {...SEO} /> | ||
``` | ||
From now on all of your pages will have the defaults above applied applied. | ||
**Note that `Container` is deprecated in Next.js v9.0.4 so you can replace that component here with `React.Fragment` on this version and later - see [here](https://github.com/zeit/next.js/blob/master/errors/app-container-deprecated.md)** | ||
### NextSeo Options | ||
@@ -286,3 +318,3 @@ | ||
The only way to unset this, is by removing the prop from the `DefaultSeo` in your custom <App>. | ||
The only way to unset this, is by removing the prop from the `DefaultSeo` in your custom `<App>`. | ||
@@ -297,3 +329,3 @@ #### Twitter | ||
```js | ||
```jsx | ||
facebook={{ | ||
@@ -320,14 +352,14 @@ appId: 1234567890, | ||
```js | ||
mobileAlternate: { | ||
```jsx | ||
mobileAlternate={{ | ||
media: 'only screen and (max-width: 640px)', | ||
href: 'https://m.canonical.ie', | ||
}, | ||
}} | ||
``` | ||
```js | ||
languageAlternate: { | ||
```jsx | ||
languageAlternate={{ | ||
hrefLang: 'de-AT', | ||
href: 'https://www.canonical.ie/de', | ||
}, | ||
}} | ||
``` | ||
@@ -1155,2 +1187,3 @@ | ||
<td align="center"><a href="https://github.com/bolonio"><img src="https://avatars0.githubusercontent.com/u/1288407?v=4" width="100px;" alt="Adrián Bolonio"/><br /><sub><b>Adrián Bolonio</b></sub></a><br /><a href="https://github.com/garmeeh/next-seo/commits?author=bolonio" title="Code">💻</a> <a href="https://github.com/garmeeh/next-seo/commits?author=bolonio" title="Documentation">📖</a> <a href="https://github.com/garmeeh/next-seo/commits?author=bolonio" title="Tests">⚠️</a></td> | ||
<td align="center"><a href="http://erikhofer.de"><img src="https://avatars2.githubusercontent.com/u/17194301?v=4" width="100px;" alt="Erik Hofer"/><br /><sub><b>Erik Hofer</b></sub></a><br /><a href="https://github.com/garmeeh/next-seo/commits?author=erikhofer" title="Documentation">📖</a></td> | ||
</tr> | ||
@@ -1157,0 +1190,0 @@ </table> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
118680
1188
0