-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added header and some other stuff to Astro rework (#1127)
This branch adds: - a reimplementation of the page header in Tailwind (animation currently not working) - a more DRY footer and some layout components - stored menu data in content folder and query it in components - SVGs imported as proper images instead of inlining ref #1125 --------- Co-authored-by: Rok Garbas <[email protected]>
- Loading branch information
1 parent
e30f585
commit a535747
Showing
9 changed files
with
131 additions
and
55 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
const { class: extraClasses } = Astro.props; | ||
--- | ||
|
||
<div class={`mx-4 md:mx-auto md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl ${extraClasses}`}> | ||
<slot /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
sections: | ||
- name: The Project | ||
items: | ||
- name: Channel Status | ||
link: https://status.nixos.org/ | ||
- name: Packages search | ||
link: https://search.nixos.org/packages | ||
- name: Options search | ||
link: https://search.nixos.org/options | ||
- name: Reproducible Builds Status | ||
link: https://reproducible.nixos.org/ | ||
- name: Security | ||
link: /community/teams/security | ||
- name: Get in Touch | ||
items: | ||
- name: Forum | ||
link: https://discourse.nixos.org/ | ||
- name: Matrix Chat | ||
link: https://matrix.to/#/#community:nixos.org | ||
- name: Commercial support | ||
link: /community/commercial-support | ||
- name: Contribute | ||
items: | ||
- name: Contributing Guide | ||
link: https://nix.dev/contributing/how-to-contribute | ||
- name: Donate | ||
link: /donate | ||
- name: Stay up to Date | ||
items: | ||
- name: Blog | ||
link: /blog/ | ||
- name: Newsletter | ||
link: https://weekly.nixos.org/ | ||
social: | ||
- name: Mastodon | ||
link: https://chaos.social/@nixos_org | ||
- name: Twitter | ||
link: https://twitter.com/nixos_org | ||
- name: Youtube | ||
link: https://www.youtube.com/channel/UC3vIimi9q4AT8EgxYp_dWIw | ||
- name: GitHub | ||
link: https://github.com/NixOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
items: | ||
- name: Explore | ||
link: /explore | ||
- name: Download | ||
link: /download | ||
- name: Learn | ||
link: /learn | ||
- name: Community | ||
link: /community | ||
- name: Blog | ||
link: /blog | ||
- name: Donate | ||
link: /donate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,45 @@ | ||
--- | ||
import {Icon} from "astro-icon"; | ||
import { Image } from 'astro:assets'; | ||
import flakeBlue from "../assets/image/flake-blue.svg"; | ||
import { getEntry } from 'astro:content'; | ||
import Container from "../components/layout/Container.astro"; | ||
const headerMenu = await getEntry('menus', 'header'); | ||
const navbarItemStyle = "text-center text-nixsemidarkblue md:text-black border-b-transparent hover:border-b-nixlightblue border-b-4 bg-nixlighterblue md:bg-transparent"; | ||
--- | ||
|
||
<header> | ||
Header | ||
<header class="bg-white text-black font-light shadow-lg"> | ||
<Container class="flex flex-col md:flex-row justify-between md:items-center"> | ||
<div class="text-4xl font-normal gap-2 flex justify-between md:justify-start items-center my-2"> | ||
<div class="gap-2 flex justify-between md:justify-start items-center"> | ||
<Image class="h-16 w-16" src={flakeBlue} alt="Nix Logo" /> | ||
<span class="visible md:invisible xl:visible">Nix</span> | ||
</div> | ||
<div class="bg-nixlightblue block md:hidden p-4 rounded-lg" id="navigation-toggle"> | ||
<span class="bg-white block w-8 h-1 mb-1.5"></span> | ||
<span class="bg-white block w-8 h-1 mb-1.5"></span> | ||
<span class="bg-white block w-8 h-1"></span> | ||
</div> | ||
</div> | ||
<div class="pb-4 md:pb-0 flex-col md:flex-row gap-0.5 md:gap-5 hidden md:flex" id="navbar-menu"> | ||
{headerMenu.data.items.map((item) => ( | ||
<a class={`pt-8 pb-6 ${navbarItemStyle}`} href={item.link}>{item.name}</a> | ||
))} | ||
<a target="_blank" rel="noreferrer noopener" class={`pt-8 md:pt-7 pb-6 ${navbarItemStyle}`} href="https://search.nixos.org"> | ||
<Icon alt="Search" class="h-8 text-nixdarkblue hidden md:block" pack="mdi" name="search" /> | ||
<span class="inline-block md:hidden">Search</span> | ||
</a> | ||
</div> | ||
</Container> | ||
</header> | ||
|
||
<script lang="ts"> | ||
const navigationToggle= document.getElementById("navigation-toggle"); | ||
const navbarMenu = document.getElementById("navbar-menu"); | ||
|
||
navigationToggle.addEventListener("click", () => { | ||
navbarMenu.classList.toggle("hidden"); | ||
navbarMenu.classList.toggle("flex") | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters