0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Docs/fix sitesidebar template (#778)

* Fix: Do not commit `.env` files in any directory

* Links that aren't current should have either *no* aria-current attribute or `aria-current="false"` for the same effect.
This commit is contained in:
Caleb Jasik 2021-07-20 15:56:45 -05:00 committed by GitHub
parent 6915dc688b
commit ec4e00a8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
.gitignore vendored
View file

@ -9,3 +9,6 @@ package-lock.json
# .vscode files other than at top-level
**/.vscode
# do not commit .env files or any files that end with `.env`
*.env

View file

@ -11,7 +11,7 @@ const {currentPage} = Astro.props;
<h2 class="nav-group-title">{category.text}</h2>
<ul>
{category.children.map(child => (
<li class="nav-link"><a href={`${Astro.site.pathname}${child.link}`} aria-current={`${currentPage === child.link ? 'page' : ''}`}>{child.text}</a></li>
<li class="nav-link"><a href={`${Astro.site.pathname}${child.link}`} aria-current={`${currentPage === child.link ? 'page' : 'false'}`}>{child.text}</a></li>
))}
</ul>
</div>