Skip to content

Commit 9090295

Browse files
petelemeyerwebddbeckcaptainbrossetpepelsbey
authored
Add browser-agnostic Baseline site & content (#1706)
Co-authored-by: Eric A. Meyer <[email protected]> Co-authored-by: Daniel D. Beck <[email protected]> Co-authored-by: Patrick Brosset <[email protected]> Co-authored-by: Vadim Makeev <[email protected]>
1 parent ec55c6d commit 9090295

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3684
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Build and deploy gh-pages website
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- "main"
9+
paths:
10+
- "gh-pages/**"
11+
- ".github/workflows/gh-pages-build-deploy.yml"
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# Use color in output
17+
env:
18+
FORCE_COLOR: 3
19+
20+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
21+
permissions:
22+
contents: read
23+
pages: write
24+
id-token: write
25+
26+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
27+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
28+
concurrency:
29+
group: "pages"
30+
cancel-in-progress: false
31+
32+
jobs:
33+
# Build the site
34+
build:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
- name: Setup Node
40+
uses: actions/setup-node@v3
41+
with:
42+
cache: npm
43+
node-version-file: .node-version
44+
- name: NPM Install
45+
run: npm ci
46+
working-directory: gh-pages/
47+
- name: Build pages
48+
run: npm run build:prod
49+
working-directory: gh-pages/
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
53+
54+
# Deployment job
55+
deploy:
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
runs-on: ubuntu-latest
60+
needs: build
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ packages/web-features/data.schema.json
88
packages/web-features/types.ts
99
data.extended.json
1010
index.js
11+
12+
# Ignore files created & used by pages & 11ty
13+
/_site/**

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
/**/*.dist
33
/**/dist
44

5+
6+
# Exclude the website includes since these are typically fragments, or include
7+
# things that makes Prettier unhappy.
8+
/gh-pages/src/_includes/**
9+
510
# Files/folders that have not yet been formatted
611
# TODO: Format all these files
712
README.md

gh-pages/eleventy.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
2+
const markdownIt = require("markdown-it");
3+
const markdownItAnchor = require("markdown-it-anchor");
4+
5+
module.exports = function (eleventyConfig) {
6+
eleventyConfig.addPassthroughCopy("./src/assets/img");
7+
eleventyConfig.addPassthroughCopy("./src/assets/fonts");
8+
eleventyConfig.addPassthroughCopy("./src/assets/css");
9+
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
10+
const mdOpts = {
11+
html: true,
12+
breaks: true,
13+
linkify: true,
14+
};
15+
eleventyConfig.setLibrary("md", markdownIt(mdOpts).use(markdownItAnchor));
16+
return {
17+
dir: {
18+
input: "src",
19+
output: "../_site",
20+
},
21+
};
22+
};

0 commit comments

Comments
 (0)