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

Add isIndex prop to Sidebar in index-template #94

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

vzhou842
Copy link
Collaborator

@vzhou842 vzhou842 commented Feb 7, 2019

A quick codebase search for <Sidebar reveals that the isIndex prop is never used in Sidebar! I also tried setting it just to see what it looks like, and it basically changes nothing - the difference between an h1 and h2 in <Author /> makes basically no visual difference. This PR removes the isIndex prop because it's unused and shouldn't be used.

@codecov
Copy link

codecov bot commented Feb 7, 2019

Codecov Report

Merging #94 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #94   +/-   ##
======================================
  Coverage    95.1%   95.1%           
======================================
  Files          28      28           
  Lines         143     143           
  Branches        8       8           
======================================
  Hits          136     136           
  Misses          7       7
Impacted Files Coverage Δ
src/templates/index-template.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f67130...1a81d54. Read the comment docs.

@alxshelepenok
Copy link
Owner

Hi @vzhou842
isIndex is used to set H1 on the home page. I think it's important for SEO. (https://web.dev/accessible/headings-and-landmarks)

@vzhou842 vzhou842 changed the title Remove unused isIndex prop from Sidebar Add isIndex prop to Sidebar in index-template Feb 10, 2019
@vzhou842
Copy link
Collaborator Author

@alxshelepenok fair enough. The isIndex prop wasn't actually being used before though, so I've modified this PR to add the isIndex prop for the <Sidebar /> component in index-template. Now it actually shows up as a h1 as intended:

screen shot 2019-02-10 at 12 57 48 pm

Copy link
Owner

@alxshelepenok alxshelepenok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed that isIndex is undefined in the index template.
Need to add to PR

...

const IndexTemplate = ({ data, pageContext, location }) => {
  const {
    title: siteTitle,
    subtitle: siteSubtitle
  } = data.site.siteMetadata;

  const isIndex = location.pathname === '/';

...

@vzhou842
Copy link
Collaborator Author

@alxshelepenok why would you need to check pathname? The index-template should only be used for the index page, so we can just assume it's always index, right? I don't see anything that needs changing here.

@alxshelepenok
Copy link
Owner

@vzhou842 Yes exactly, It does not need to do. I was inattentive.
Thanks for the PR!

@alxshelepenok alxshelepenok merged commit bf8a726 into alxshelepenok:master Feb 13, 2019
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.

None yet

2 participants