From 867a49dd1c246a7116b44f49ec1994f8025928e3 Mon Sep 17 00:00:00 2001 From: Eric Nakagawa Date: Tue, 24 Oct 2017 15:15:52 -0700 Subject: [PATCH] Removes #content from sidebar links and from within pages (#170) --- lib/core/BlogPageLayout.js | 18 ++++++++---------- lib/core/DocsLayout.js | 19 +++++++++---------- lib/core/nav/SideNav.js | 14 ++++---------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/lib/core/BlogPageLayout.js b/lib/core/BlogPageLayout.js index 0eb71b4a6e..bc3d261eaa 100644 --- a/lib/core/BlogPageLayout.js +++ b/lib/core/BlogPageLayout.js @@ -19,18 +19,14 @@ const BlogPageLayout = React.createClass({ if (page > 0) { url += "page" + (page + 1) + "/"; } - return url + "#content"; + return url; }, render() { const perPage = this.props.metadata.perPage; const page = this.props.metadata.page; return ( - +
- {page > 0 && + {page > 0 && ( ← Prev - } - {MetadataBlog.length > (page + 1) * perPage && + + )} + {MetadataBlog.length > (page + 1) * perPage && ( Next → - } + + )}
diff --git a/lib/core/DocsLayout.js b/lib/core/DocsLayout.js index 9edd745a37..bf0bea199f 100644 --- a/lib/core/DocsLayout.js +++ b/lib/core/DocsLayout.js @@ -35,8 +35,7 @@ class DocsLayout extends React.Component { } description={content.trim().split("\n")[0]} language={metadata.language} - version={metadata.version} - > + version={metadata.version}>
@@ -56,30 +55,30 @@ class DocsLayout extends React.Component { language={metadata.language} />
diff --git a/lib/core/nav/SideNav.js b/lib/core/nav/SideNav.js index bb36d296d0..6ed67975ef 100644 --- a/lib/core/nav/SideNav.js +++ b/lib/core/nav/SideNav.js @@ -23,9 +23,7 @@ class SideNav extends React.Component {

- - {this.props.current.category} - + {this.props.current.category}

@@ -50,12 +48,8 @@ class SideNav extends React.Component { renderCategory(category) { return (
-

- {this.getLocalizedCategoryString(category.name)} -

-
    - {category.links.map(this.renderItemLink, this)} -
+

{this.getLocalizedCategoryString(category.name)}

+
    {category.links.map(this.renderItemLink, this)}
); } @@ -91,7 +85,7 @@ class SideNav extends React.Component { if (metadata.permalink.match(/^https?:/)) { return metadata.permalink; } - return siteConfig.baseUrl + metadata.permalink + "#content"; + return siteConfig.baseUrl + metadata.permalink; } if (metadata.path) { return siteConfig.baseUrl + "blog/" + metadata.path;