-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign pages, remove layout nesting (#24)
* wip * new svelte-style prop declaration is working * got it working! * revert h changes * format * style lang update
- Loading branch information
1 parent
3c24faa
commit a72ab10
Showing
28 changed files
with
769 additions
and
732 deletions.
There are no files selected for viewing
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,38 @@ | ||
--- | ||
import Banner from './Banner.astro'; | ||
import Nav from './Nav.astro'; | ||
export let title: string; | ||
export let description: string; | ||
export let permalink: string; | ||
--- | ||
|
||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> | ||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" /> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" /> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" /> | ||
<link rel="manifest" href="/favicon/site.webmanifest" /> | ||
|
||
<!-- Primary Meta Tags --> | ||
<title>{title}</title> | ||
<meta name="title" content={title} /> | ||
<meta name="description" content="{description}" /> | ||
|
||
<!-- Open Graph / Facebook --> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:url" content={permalink} /> | ||
<meta property="og:title" content={title} /> | ||
<meta property="og:description" content={description} /> | ||
<meta property="og:image" content="https://www.snowpack.dev/img/social-2.jpg" /> | ||
|
||
<!-- Twitter --> | ||
<meta property="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:url" content={permalink} /> | ||
<meta property="twitter:title" content={title} /> | ||
<meta property="twitter:description" content={description} /> | ||
<meta property="twitter:image" content="https://www.snowpack.dev/img/social-2.jpg" /> | ||
|
||
<!-- Global Stylesheets --> | ||
<link rel="stylesheet" href="/css/app.css" /> | ||
<link href="https://fonts.googleapis.com/css2?family=Overpass:wght@400;700;900&display=swap" rel="stylesheet" /> |
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,20 @@ | ||
--- | ||
import Banner from './Banner.astro'; | ||
import Nav from './Nav.astro'; | ||
--- | ||
|
||
<Banner></Banner> | ||
<Nav /> | ||
|
||
<slot></slot> | ||
|
||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-130280175-9"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { | ||
dataLayer.push(arguments); | ||
} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-130280175-9', { page_path: location.pathname === '/' ? (location.pathname + location.hash) : (location.pathname) }); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
import BaseLayout from './BaseLayout.astro'; | ||
import Menu from './Menu.astro'; | ||
export function setup({ context }) { | ||
return {}; | ||
} | ||
--- | ||
|
||
<BaseLayout> | ||
<div class="container"> | ||
<section class="snow-view__docs is-full"> | ||
|
||
<aside id="nav-primary" class="snow-view-nav"> | ||
<Menu /> | ||
</aside> | ||
|
||
<article class="snow-view-main"> | ||
<slot></slot> | ||
</article> | ||
|
||
</section> | ||
</div> | ||
</BaseLayout> |
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
This file was deleted.
Oops, something went wrong.
134 changes: 72 additions & 62 deletions
134
examples/snowpack/astro/layouts/content-with-cover.astro
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,78 +1,88 @@ | ||
--- | ||
import Menu from '../components/Menu.astro'; | ||
import Subnav from '../components/Subnav.astro'; | ||
import Subnav from '../components/Subnav.astro'; | ||
import Menu from '../components/Menu.astro'; | ||
import BaseHead from '../components/BaseHead.astro'; | ||
import BaseLayout from '../components/BaseLayout.astro'; | ||
export const layout = 'layouts/base.astro'; | ||
export function setup({ context }) { | ||
return {}; | ||
} | ||
export let content: any; | ||
--- | ||
|
||
<html> | ||
|
||
<style> | ||
.cover-wrapper { | ||
width: 100%; | ||
height: 44vh; | ||
min-height: 20rem; | ||
max-height: 30rem; | ||
position: relative; | ||
background: #2a85ca40; | ||
overflow: hidden; | ||
} | ||
.cover, | ||
.cover-blur { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
.cover-blur { | ||
object-fit: cover; | ||
filter: blur(3px) brightness(1.5); | ||
transform: scale(1.1); | ||
} | ||
.cover { | ||
object-fit: contain; | ||
filter: brightness(1.5); | ||
} | ||
@media (max-width: 1200px) { | ||
<head> | ||
<style> | ||
.cover-wrapper { | ||
width: 100%; | ||
height: 44vh; | ||
min-height: 20rem; | ||
max-height: 30rem; | ||
position: relative; | ||
background: #2a85ca40; | ||
overflow: hidden; | ||
} | ||
.cover, | ||
.cover-blur { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
.cover-blur { | ||
object-fit: cover; | ||
filter: blur(3px) brightness(1.5); | ||
transform: scale(1.1); | ||
} | ||
.cover { | ||
object-fit: cover; | ||
object-fit: contain; | ||
filter: brightness(1.5); | ||
} | ||
} | ||
</style> | ||
@media (max-width: 1200px) { | ||
.cover-blur { | ||
object-fit: cover; | ||
} | ||
.cover { | ||
object-fit: cover; | ||
} | ||
} | ||
</style> | ||
<BaseHead title={content.title} description={content.description} permalink="TODO" /> | ||
</head> | ||
|
||
<body> | ||
<BaseLayout> | ||
|
||
<div class="cover-wrapper"> | ||
<img class="cover-blur" src={context.cover} alt=""/> | ||
<img class="cover" src={context.cover} alt=""/> | ||
</div> | ||
<div class="cover-wrapper"> | ||
<img class="cover-blur" src={content.cover} alt=""/> | ||
<img class="cover" src={content.cover} alt=""/> | ||
</div> | ||
|
||
<div class="container"> | ||
<section class="snow-view__docs has-subnav"> | ||
<div class="container"> | ||
<section class="snow-view__docs has-subnav"> | ||
|
||
<aside id="nav-primary" class="snow-view-nav"> | ||
<Menu /> | ||
</aside> | ||
<aside id="nav-primary" class="snow-view-nav"> | ||
<Menu /> | ||
</aside> | ||
|
||
<article class="snow-view-main"> | ||
<div class="content"> | ||
<h2 class="content-title"> | ||
{context.title} | ||
</h2> | ||
<div class="content-layout"> | ||
<div class="content-body"> | ||
<slot></slot> | ||
<article class="snow-view-main"> | ||
<div class="content"> | ||
<h2 class="content-title"> | ||
{content.title} | ||
</h2> | ||
<div class="content-layout"> | ||
<div class="content-body"> | ||
{content.body} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</article> | ||
</article> | ||
|
||
<Subnav title={content.title} headers={content.headers} /> | ||
</section> | ||
</div> | ||
</BaseLayout> | ||
</body> | ||
|
||
<Subnav title={context.title} headers={context.content.headers} /> | ||
</section> | ||
</div> | ||
</html> |
Oops, something went wrong.