Skip to content

Commit

Permalink
feature/issue 32 shared layout for all pages (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Jun 13, 2024
1 parent 03756b6 commit 0148fce
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 21 deletions.
1 change: 0 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "../src/styles/theme.css";
import "../src/styles/main.css";

/** @type { import('@storybook/web-components').Preview } */
const preview = {
Expand Down
3 changes: 3 additions & 0 deletions greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ import { greenwoodPluginCssModules } from "./plugin-css-modules.js";
export default {
prerender: true,
plugins: [greenwoodPluginImportRaw(), greenwoodPluginCssModules()],
markdown: {
plugins: ["@mapbox/rehype-prism"],
},
};
58 changes: 56 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
},
"dependencies": {
"geist": "^1.2.0",
"open-props": "^1.7.4"
"open-props": "^1.7.4",
"prism-themes": "^1.9.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.24.5",
Expand All @@ -45,6 +46,7 @@
"@greenwood/cli": "^0.30.0-alpha.2",
"@greenwood/plugin-import-raw": "^0.30.0-alpha.2",
"@ls-lint/ls-lint": "^1.10.0",
"@mapbox/rehype-prism": "^0.9.0",
"@storybook/addon-essentials": "^8.0.6",
"@storybook/addon-links": "^8.0.6",
"@storybook/blocks": "^8.0.6",
Expand Down
Binary file added src/assets/greenwood-logo-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions src/pages/index.html

This file was deleted.

14 changes: 14 additions & 0 deletions src/pages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
imports:
- ../styles/home.css
---

# Welcome to Greenwood!

```js
return new Response("<h1>Hello World</h1>", {
headers: {
"Content-Type": "text/html",
},
});
```
9 changes: 9 additions & 0 deletions src/styles/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
h1 {
text-align: center;
}

pre {
margin: 0 auto !important;
width: 30%;
overflow: scroll;
}
3 changes: 0 additions & 3 deletions src/styles/main.css

This file was deleted.

9 changes: 9 additions & 0 deletions src/styles/theme.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import "../../node_modules/open-props/src/props.borders.css";
@import "../../node_modules/open-props/src/props.fonts.css";
@import "../../node_modules/open-props/src/props.shadows.css";
@import "../../node_modules/open-props/src/props.sizes.css";
@import "../../node_modules/prism-themes/themes/prism-nord.css";

@font-face {
font-family: "Geist-Sans";
Expand Down Expand Up @@ -32,3 +34,10 @@
font-size: var(--size-px-3);
box-sizing: border-box;
}

/* tweaks for PrismJS */
code[class*="language-"],
pre[class*="language-"],
span.token {
font-family: "Geist-Mono", monospace;
}
37 changes: 37 additions & 0 deletions src/templates/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!doctype html>
<html lang="en" prefix="og:http://ogp.me/ns#">
<head>
<title>Greenwood</title>
<meta charset="utf-8" />
<meta
name="description"
content="Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.."
/>
<meta name="twitter:site" content="@PrjEvergreen" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.greenwoodjs.dev" />
<meta property="og:image" content="https://www.greenwoodjs.dev/assets/greenwood-logo-og.png" />
<meta
property="og:description"
content="Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back."
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<script type="module" src="../components/footer/footer.js" data-gwd-opt="static"></script>
<script type="module" src="../components/header/header.js"></script>
<link rel="stylesheet" href="../styles/theme.css" />
</head>

<body>
<app-header></app-header>

<main>
<page-outlet></page-outlet>
</main>

<app-footer></app-footer>
</body>
</html>

0 comments on commit 0148fce

Please sign in to comment.