mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
Adding baseUrl to feed links. (#745)
This commit is contained in:
parent
3c6d3e6df7
commit
8e58d2e903
1 changed files with 9 additions and 12 deletions
|
@ -29,6 +29,11 @@ class Head extends React.Component {
|
|||
highlight.version
|
||||
}/styles/${highlight.theme}.min.css`;
|
||||
|
||||
// ensure the siteUrl variable ends with a single slash
|
||||
const siteUrl =
|
||||
(this.props.config.url + this.props.config.baseUrl).replace(/\/+$/, '') +
|
||||
'/';
|
||||
|
||||
return (
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
|
@ -44,22 +49,14 @@ class Head extends React.Component {
|
|||
{this.props.config.ogImage && (
|
||||
<meta
|
||||
property="og:image"
|
||||
content={
|
||||
this.props.config.url +
|
||||
this.props.config.baseUrl +
|
||||
this.props.config.ogImage
|
||||
}
|
||||
content={siteUrl + this.props.config.ogImage}
|
||||
/>
|
||||
)}
|
||||
<meta name="twitter:card" content="summary" />
|
||||
{this.props.config.twitterImage && (
|
||||
<meta
|
||||
name="twitter:image"
|
||||
content={
|
||||
this.props.config.url +
|
||||
this.props.config.baseUrl +
|
||||
this.props.config.twitterImage
|
||||
}
|
||||
content={siteUrl + this.props.config.twitterImage}
|
||||
/>
|
||||
)}
|
||||
{this.props.config.noIndex && <meta name="robots" content="noindex" />}
|
||||
|
@ -81,7 +78,7 @@ class Head extends React.Component {
|
|||
<link
|
||||
rel="alternate"
|
||||
type="application/atom+xml"
|
||||
href={this.props.config.url + '/blog/atom.xml'}
|
||||
href={siteUrl + 'blog/atom.xml'}
|
||||
title={this.props.config.title + ' Blog ATOM Feed'}
|
||||
/>
|
||||
)}
|
||||
|
@ -89,7 +86,7 @@ class Head extends React.Component {
|
|||
<link
|
||||
rel="alternate"
|
||||
type="application/rss+xml"
|
||||
href={this.props.config.url + '/blog/feed.xml'}
|
||||
href={siteUrl + 'blog/feed.xml'}
|
||||
title={this.props.config.title + ' Blog RSS Feed'}
|
||||
/>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue