Skip to content

Commit db7b00e

Browse files
authored
build: configure output dir and basic styling setup (#3)
- Changed output directory from `_site` to `public` - Added `src` directory and moved `index.md` into it - Created base HTML and CSS for home page - Added CSS as passthrough and watch target in 11ty config
1 parent 9c9cafb commit db7b00e

6 files changed

Lines changed: 44 additions & 7 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
uses: peaceiris/actions-gh-pages@v4
2828
with:
2929
github_token: ${{ secrets.GITHUB_TOKEN }}
30-
publish_dir: ./_site
30+
publish_dir: ./public
3131
publish_branch: gh-pages

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
_site/
1+
public/
22
node_modules/

eleventy.config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
export default async function(eleventyConfig) {
2-
eleventyConfig.addPassthroughCopy("CNAME");
2+
// Copy unprocessed source files to public directory.
3+
eleventyConfig.addPassthroughCopy("./CNAME");
4+
eleventyConfig.addPassthroughCopy("./src/css");
5+
6+
// Hot reload when the style changes.
7+
eleventyConfig.addWatchTarget("./src/css");
8+
9+
// Return config object.
10+
return {
11+
dir: {
12+
input: "src",
13+
output: "public"
14+
}
15+
}
316
};

src/_includes/base.njk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="/css/style.css" />
7+
<title>{{ title }}</title>
8+
</head>
9+
<body>
10+
<header>
11+
<h1>{{ title }}</h1>
12+
</header>
13+
<main>
14+
{{ content | safe }}
15+
</main>
16+
</body>
17+
</html>

src/css/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
body {
2+
font-family: sans-serif;
3+
}
4+
5+
header, main, footer {
6+
max-width: 720px;
7+
margin: auto;
8+
padding: 1rem 2rem;
9+
}

index.md renamed to src/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
2-
title: Howdy, I’m Emily!
2+
title: Emily DuBois
3+
layout: base.njk
34
---
4-
# {{ title }}
5-
6-
## About
75

86
Emily lives in Austin with her husband and dog. She works in the College of Natural Sciences Career Services office at The University of Texas at Austin. Previously, she worked at [Upstream Tech](https://www.upstream.tech/), [Toitū Te Whenua Land Information New Zealand](https://www.linz.govt.nz/), and [Mapbox](https://www.mapbox.com/).
97

0 commit comments

Comments
 (0)