diff --git a/package-lock.json b/package-lock.json index e45e54e..252e21b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1486,24 +1486,17 @@ } }, "@contentful/rich-text-react-renderer": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/@contentful/rich-text-react-renderer/-/rich-text-react-renderer-13.4.0.tgz", - "integrity": "sha512-hZL0DQ+Qj+a9CWsu7bmEp5eh6ERX5pcL+k8+LNlkR3j1jBNraANV2qL3tGXZoR5haSxeCMo+KTryMf/7BRZbrg==", + "version": "15.12.1", + "resolved": "https://registry.npmjs.org/@contentful/rich-text-react-renderer/-/rich-text-react-renderer-15.12.1.tgz", + "integrity": "sha512-bQ69cN51iGBTF3/nYi5MGUaDJ/lnrEXtCUBCxulIZ0fLS/AAEledZTJcEKs+PKeYYgDqiUVDsmx2xZP2QsJJ+Q==", "requires": { - "@contentful/rich-text-types": "^13.4.0" - }, - "dependencies": { - "@contentful/rich-text-types": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/@contentful/rich-text-types/-/rich-text-types-13.4.0.tgz", - "integrity": "sha512-YPdYqGmWiGAood7ri2BUXfPQKNthkQYV1rmQdaq4UAxWK5NLB5NXckaUYLbohqhHKtrq4tnfzVn+ePWID7Dzbg==" - } + "@contentful/rich-text-types": "^15.12.1" } }, "@contentful/rich-text-types": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@contentful/rich-text-types/-/rich-text-types-14.1.0.tgz", - "integrity": "sha512-dqb9U+eMthGl8wJhOM5PGV0MOLxFNMJjMgVU600uHJ4Z4u39iXpdFR1VXbaownuvhJyR+9V+VLEFXNZJ1veGZg==" + "version": "15.12.1", + "resolved": "https://registry.npmjs.org/@contentful/rich-text-types/-/rich-text-types-15.12.1.tgz", + "integrity": "sha512-WQJic0fnAbTa8xzO3Z+aVqDmA5+JMNQlATQMVJ40GoOrnM8YoJZsKGf6xX/O6Y6Eq10T1LrpxIOslODFI9qFgg==" }, "@emotion/cache": { "version": "10.0.29", diff --git a/package.json b/package.json index cddde57..a161fd8 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ }, "homepage": "https://github.com/cezarsmpio/gatsby-knowledge-base-contentful-starter#readme", "dependencies": { - "@contentful/rich-text-react-renderer": "^13.4.0", - "@contentful/rich-text-types": "^14.1.0", + "@contentful/rich-text-react-renderer": "15.12.1", + "@contentful/rich-text-types": "15.12.1", "@emotion/core": "^10.0.28", "@emotion/styled": "^10.0.27", "gatsby": "^2.21.11", diff --git a/src/templates/article.js b/src/templates/article.js index 95975a5..f57a37a 100644 --- a/src/templates/article.js +++ b/src/templates/article.js @@ -1,7 +1,7 @@ import React from 'react'; import is from 'prop-types'; import { graphql } from 'gatsby'; -import { BLOCKS } from '@contentful/rich-text-types'; +import { BLOCKS, INLINES } from '@contentful/rich-text-types'; import { documentToReactComponents } from '@contentful/rich-text-react-renderer'; import styled from '@emotion/styled'; import Layout from './layout'; @@ -25,6 +25,19 @@ const rendererOptions = ({ locale = 'en-US' }) => ({ ); } }, + [INLINES.ENTRY_HYPERLINK]: function Anchor(node) { + const { space, environment, id } = node.data.target.sys; + const { value } = node.content[0]; + return ( + + {value} + + ); + }, }, });