Skip to content

Commit

Permalink
nav
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Nov 28, 2021
1 parent 82d702b commit aeb2285
Show file tree
Hide file tree
Showing 8 changed files with 1,739 additions and 60 deletions.
32 changes: 32 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module.exports = (eleventyConfig) => {
// Data:
eleventyConfig.addDataExtension("yml", (contents) =>
require("js-yaml").load(contents)
);

// Assets
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addPassthroughCopy({
"node_modules/bootstrap/dist/css/bootstrap.min.css": "assets/bootstrap.css",
Expand All @@ -7,7 +13,33 @@ module.exports = (eleventyConfig) => {
"assets/bootstrap.min.js.map",
});
eleventyConfig.addWatchTarget("assets");

return {
passthroughFileCopy: true,
};
};

function navShortcode(dropdowns) {
console.log(this);
return dropdowns.map(
(d) => /* HTML */ `
<li class="nav-item dropdown">
<button
class="nav-link dropdown-toggle bg-transparent border-0"
style="outline: 0"
id="dropdownMenuLink"
data-bs-toggle="dropdown"
aria-expanded="false"
>
${d.title}
</button>
<ul
class="dropdown-menu dropdown-menu-dark bg-brown4 rounded-3 lg-shadow-brown"
aria-labelledby="dropdownMenuLink"
>
${d.content}
</ul>
</li>
`
);
}
73 changes: 73 additions & 0 deletions _data/nav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
- title: People
content:
- title: Band Board
url: /people/band-board
- title: Schedule
url: /schedule
- title: Join the Band!
url: /join-band
- title: Constitution
url: /constitution

- heading: Sections
- title: Flutes
url: /sections/flutes
- title: Clarinets
url: /sections/clarinets
- title: Saxophones & Mellophones (S&M)
url: /sections/s&m
- title: Trumpets
url: /sections/trumpets
- title: Low Brass
url: /sections/low-brass
- title: Percussion
url: /sections/percussion

- title: Media
content:
- title: Buttons
url: /buttons
- title: Photos
url: /photos
- title: Recordings
url: /recordings
- title: Videos
url: /videos
- title: Lyrics
url: /lyrics
- title: Scripts
url: /show-scripts
- title: Alumni Newsletters
url: /alumni-newsletters

- title: History
content:
- title: About Us
url: /about-us
- title: Elrod Snidley
url: /elrod-snidley
- title: Sound Off!
url: /sound
- title: 75 Years in Pictures
url: "/75-years-pictures"

# todo: Members

- title: More Info
content:
- title: Giving
url: /giving
- title: Visiting Bands
url: /visiting-bands
- title: Ivy Bands
url: /ivy-bands
- title: Ivy Bands Agreement
url: /ivy-bands-agreement

- heading: Commencement
- title: Schedule
url: /commencement-schedule
- title: Student Signup
url: https://docs.google.com/forms/d/1gDBvdABCfKt4JbuEdR2kOVR5RRp4gmNPoyUYlx0Q6cs/viewform?usp=send_form
- title: Alumni Signup
url: /commencement-sign-alumni
14 changes: 2 additions & 12 deletions _includes/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script async src="/assets/bootstrap.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-brown">
<nav class="navbar navbar-expand-lg navbar-dark bg-brown2">
<div class="container">
<a class="navbar-brand me-5" href="#">
<img class="m-1" src="/assets/elrod.png" height="50" />
Expand All @@ -25,17 +25,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="#">One</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Two</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Three</a>
</li>
</ul>
{% include "./nav.njk" %}
</div>
</div>
</nav>
Expand Down
28 changes: 28 additions & 0 deletions _includes/nav.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<ul class="navbar-nav">
{% for dropdown in nav %}
<li class="nav-item dropdown mx-1">
<button
class="nav-link dropdown-toggle bg-transparent border-0"
style="outline: 0"
id="dropdownMenuLink"
data-bs-toggle="dropdown"
aria-expanded="false"
>
{{dropdown.title}}
</button>

<ul
class="dropdown-menu dropdown-menu-dark bg-brown4 rounded-3 lg-shadow-brown"
aria-labelledby="dropdownMenuLink"
>
{% for link in dropdown.content %}{% if link.heading %}
<li><hr class="dropdown-divider" /></li>
<li><h6 class="dropdown-header">{{link.heading}}</h6></li>
{% else %}
<li><a class="dropdown-item" href="{{link.url}}">{{link.title}}</a></li>
{% endif %}{% endfor %}
</ul>
</li>
{% endfor %}
<li class="nav-item"><a href="/contact" class="nav-link">Contact</a></li>
</ul>
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/sections/saxophones-mellophones-sm => /sections/s&m
23 changes: 23 additions & 0 deletions assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,26 @@
--bs-bg-opacity: 1;
background: #271b0c;
}
.bg-brown2 {
--bs-bg-opacity: 1;
background: #382710;
}
.bg-brown3 {
--bs-bg-opacity: 1;
background: #483314;
}
.bg-brown4 {
--bs-bg-opacity: 1;
background: #593f17;
}
@media (min-width: 992px) {
.lg-shadow-brown {
box-shadow: 0 0.35rem 1rem 0.4rem #593f1755 !important;
}
}

.dropdown-header {
user-select: none;
-webkit-user-select: none;
pointer-events: none;
}
Loading

0 comments on commit aeb2285

Please sign in to comment.