Skip to content

Commit

Permalink
Move headings nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Saltssaumure committed Nov 3, 2023
1 parent 2fffad5 commit e1fa34a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false
"singleQuote": false,
"overrides": [
{
"files": "*.scss",
"options": {
"tabWidth": 4
}
}
]
}
4 changes: 4 additions & 0 deletions _includes/headings-navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<nav class="headings-nav">
<h2 id="contents">In this page</h2>
<ul></ul>
</nav>
File renamed without changes.
8 changes: 3 additions & 5 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
<header class="page-header" role="banner">
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
{% include navigation.html %}
{% include steps-navigation.html %}
</header>

{% include headings-navigation.html %}

<main id="content" class="main-content" role="main">
{{ content }}
</main>

<nav class="headings-nav">
<ul></ul>
</nav>

<footer class="site-footer">
{% if site.github.is_project_page %}
<span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
Expand Down
18 changes: 15 additions & 3 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@ body {
justify-content: center;
}

@media screen and (min-width: 64em) {
.main-content {
max-width: 64rem;
padding: 2rem 6rem;
margin: 0 auto;
font-size: 1.1rem;
}
}

// Headings navigation
.headings-nav {

}

// Formatted code block
Expand All @@ -61,5 +69,9 @@ body {
padding: 2rem;
display: flex;
justify-content: space-between;
background-image: linear-gradient(120deg, transparentize(#6c00c4, 0.7), transparentize(#9b5816, 0.7))
}
background-image: linear-gradient(
120deg,
transparentize(#6c00c4, 0.7),
transparentize(#9b5816, 0.7)
);
}
2 changes: 1 addition & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(function () {
$("main h1, main h2, main h3, main h4, main h5, main h6").each(function () {
$("main h3").each(function () {
$("nav ul").append(
"<li class='tag-" +
this.nodeName.toLowerCase() +
Expand Down

0 comments on commit e1fa34a

Please sign in to comment.