Skip to content

Commit 84026cc

Browse files
bradfrostbmuenzenmeyer
authored andcommitted
Merge branch 'master' of github.com:bradfrost/pl-website-eleventy
1 parent 49d35c5 commit 84026cc

Some content is hidden

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

41 files changed

+406
-376
lines changed

packages/docs/.eleventy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ module.exports = function(config) {
4444
].reverse();
4545
});
4646

47+
config.addCollection('demos', collection => {
48+
return [
49+
...collection.getFilteredByGlob('./src/demos/*.md')
50+
].reverse();
51+
});
52+
4753
config.addCollection('postFeed', collection => {
4854
return [...collection.getFilteredByGlob('./src/posts/*.md').filter(livePosts)]
4955
.reverse()

packages/docs/.prettierrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"printWidth": 90,
3-
"tabWidth": 2,
4-
"singleQuote": true,
5-
"bracketSpacing": false
2+
"printWidth": 90,
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"bracketSpacing": false
66
}

packages/docs/.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"skipFiles": [
12+
"<node_internals>/**"
13+
],
14+
"program": "${workspaceFolder}/index.js"
15+
}
16+
]
17+
}

packages/docs/README.md

Lines changed: 5 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,15 @@
1-
# This site was built with a Hylia starter kit
1+
# Pattern Lab Website
22

3-
# A simple starter kit for Eleventy
4-
5-
Hylia is a lightweight [Eleventy](https://11ty.io) starter kit with [Netlify CMS](https://www.netlifycms.org/) pre-configured, so that you can one-click install a progressive, accessible blog in minutes. It also gives you a well organised starting point to extend it for yourself.
6-
7-
Get started now by **[deploying Hylia to Netlify.][deploy-to-netlify]**
8-
9-
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)][deploy-to-netlify]
10-
11-
12-
13-
## Features
14-
15-
Hylia version 0.5.1 features:
16-
17-
✍️ A pre-configured [Netlify CMS](https://www.netlifycms.org/) setup
18-
🎨 Customisable design tokens to make it your own
19-
🌍 Customisable global data and navigation
20-
📂 Tags and tag archives
21-
✅ Progressively enhanced, semantic and accessible
22-
🎈 _Super_ lightweight front-end
23-
🚰 Sass powered CSS system with utility class generator
24-
⚙️ Service worker that caches pages so people can read your articles offline
25-
🚀 An RSS feed for your posts
26-
27-
## Roadmap
28-
29-
💬 [Netlify Forms](https://www.netlify.com/docs/form-handling/) powered comments
30-
💡 ~~Dark/Light mode toggle~~ [Added in 0.4.0](https://github.com/hankchizljaw/hylia/releases/tag/0.4.0)
31-
🗣 Webmentions
32-
📖 Pagination
33-
🐦 Web sharing API integration
34-
🗒 Offline mode with links to cached pages
35-
📄 Documentation site
36-
💅 Proper Sass documentation
37-
✍️ Proper CMS documentation
38-
🖼 A facility for you to be able to add your logo / branding
3+
This is the website for patternlab.io. This site was build using the [Hylia starter kit](https://hylia.website/), which is a lightweight [Eleventy](https://11ty.io) starter kit.
394

405
---
416

42-
## Getting started
7+
## How to work with this project
438

44-
### Method one: One-Click Deploy to Netlify
45-
46-
You can [deploy Hylia to Netlify with one click][deploy-to-netlify] and you’ll be up and running in minutes!
47-
48-
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)][deploy-to-netlify]
49-
50-
I recorded a quick start video of me deploying Hylia to Netlify and getting the CMS set up. [Check it out here](https://youtu.be/0hM_0BH-Y_A).
51-
52-
### Method two: Clone / Fork
53-
54-
1. Clone or fork this repo: `git clone https://github.com/hankchizljaw/hylia`
9+
1. Clone this repository
5510
2. `cd` into the project directory and run `npm install`
5611
3. Once all the dependencies are installed run `npm start`
57-
4. Open your browser at `http://localhost:8080` and away you go!
12+
4. Open your browser at `http://localhost:8080`
5813

5914
## Terminal commands
6015

@@ -75,135 +30,3 @@ npm run production
7530
```bash
7631
npm run sass:process
7732
```
78-
79-
### Re-generate design tokens for Sass
80-
81-
```bash
82-
npm run sass:tokens
83-
```
84-
85-
## Getting started with the CMS
86-
87-
Before you can use the CMS, you need to do some config in Netlify. Luckily they provide a [very handy guide to get started](https://www.netlify.com/docs/identity/).
88-
89-
In short, though:
90-
91-
- Once you’ve set up the site on Netlify, go to “Settings” > “Identity” and enable Identity
92-
- Scroll down to the “Git Gateway” area, click “Enable Git Gateway” and follow the steps
93-
- Click the “Identity” tab at the top
94-
- Once you’ve enabled identity, click “Invite Users”
95-
- Check the invite link in your inbox and click the link in the email that’s sent to you
96-
- Set a password in the popup box
97-
- Go to `/admin` on your site and login
98-
- You’re in and ready to edit your content!
99-
100-
## Design Tokens and Styleguide
101-
102-
### Design Tokens
103-
104-
Although Hylia has a pretty simple design, you can configure the core design tokens that control the colours, size ratio and fonts.
105-
106-
---
107-
108-
**Note**: _Credit must be given to the hard work [Jina Anne](https://twitter.com/jina) did in order for the concept of design tokens to even exist. You should watch [this video](https://www.youtube.com/watch?v=wDBEc3dJJV8), then [read this article](https://the-pastry-box-project.net/jina-bolton/2015-march-28) and then sign up for [this course](https://aycl.uie.com/virtual_seminars/design_tokens_scaling_design_with_a_single_source_of_truth) to expand your knowledge._
109-
110-
---
111-
112-
To change the design tokens in the CMS, find the “Globals” in the sidebar then in the presented options, select “Theme Settings”.
113-
114-
To change the design tokens directly, edit [`_src/data/tokens.json`](https://github.com/hankchizljaw/hylia/blob/master/src/_data/tokens.json).
115-
116-
The tokens are converted into maps that the Sass uses to compile the front-end CSS, so make sure that you maintain the correct structure of `tokens.json`.
117-
118-
### Styleguide
119-
120-
Your version of Hylia ships with a Styleguide by default. You can see a demo of the Styleguide at <https://hylia.website/styleguide/>.
121-
122-
You can edit the Styleguide by opening [`src/styleguide.njk`](https://github.com/hankchizljaw/hylia/blob/master/src/styleguide.njk). If you don’t want the Styleguide, delete that file and the page will vanish.
123-
124-
## Sass
125-
126-
Hylia is based on the [WIP v2 version of Stalfos](https://github.com/hankchizljaw/stalfos/tree/feature/v2), which currently has no documentation (I know, I’m bad). Here is some very basic documentation for elements of the new framework that you will encounter on this project.
127-
128-
### Configuration
129-
130-
The whole Sass system is powered by central config file, which lives here: [`_src/scss/_config.scss`](https://github.com/hankchizljaw/hylia/blob/master/src/scss/_config.scss).
131-
132-
Before Sass is compiled, a `_tokens.scss` file is generated from the [design tokens config](https://github.com/hankchizljaw/hylia/blob/master/src/_data/tokens.json) which is required.
133-
134-
Key elements:
135-
136-
- `$stalfos-size-scale`: A token driven size scale which by default, is a “Major Third” scale
137-
- `$stalfos-colors`: A token driven map of colours
138-
- `$stalfos-util-prefix`: All pre-built, framework utilities will have this prefix. Example: the wrapper utility is '.sf-wrapper' because the default prefix is 'sf-'
139-
- `$metrics`: Various misc metrics to use around the site
140-
- `$stalfos-config`: This powers everything from utility class generation to breakpoints to enabling/disabling pre-built components/utilities
141-
142-
### How to create a new utility class with the generator
143-
144-
The utility class generator lets you generate whatever you want, with no opinions on class name or properties affected.
145-
146-
To add a new class, add another item to the exists `$stalfos-config` map. This example adds a utility for floating elements.
147-
148-
```scss
149-
'float':('items':('left':'left','right': 'right'
150-
),
151-
'output': 'responsive',
152-
'property': 'float'
153-
);
154-
```
155-
156-
The `output` is set to `responsive` which means every breakpoint will generate a prefixed class for itself. If you only wanted elements to float left in the `md` breakpoint, you’d now be able to add a class of `md:float-left` to your HTML elements.
157-
158-
If you only want standard utility classes generating, set the `output` to `standard`.
159-
160-
### Functions
161-
162-
#### `get-color($key)`
163-
164-
Function tries to match the passed `$key` with the `$stalfos-colors` map. Returns null if it can’t find a match.
165-
166-
#### `get-config-value($key, $group)`
167-
168-
Returns back a 1 dimensional (key value pair) config value if available.
169-
170-
#### `get-size($ratio-key)`
171-
172-
Function tries to match the passed `$ratio-key` with the `$stalfos-size-scale`. Returns null if it can’t find a match.
173-
174-
### Mixins
175-
176-
#### `apply-utility($key, $value-key)`
177-
178-
Grabs the property and value of one of the `$stalfos-config utilities` that the generator will generate a class for.
179-
180-
#### `media-query($key)`
181-
182-
Pass in the key of one of your breakpoints set in `$stalfos-config['breakpoints']` and this mixin will generate the `@media` query with your configured value.
183-
184-
## CMS
185-
186-
Hylia has [Netlify CMS](https://www.netlifycms.org/) pre-configured as standard. You can customise the configuration by editing [`src/admin/config.yml`](https://github.com/hankchizljaw/hylia/blob/master/src/admin/config.yml).
187-
188-
### Content that you can edit
189-
190-
The basic CMS setup allows you to edit the following:
191-
192-
- **Home page**: Edit the content on your homepage
193-
- **Posts**: Create and edit blog posts
194-
- **Generic pages**: Create generic pages that use a similar layout to posts
195-
- **Global site data**: Various bits of global site data such as your url, title, posts per page and author details
196-
- **Navigation**: Edit your primary navigation items
197-
- **Theme**: Edit the design tokens that power the site’s theme
198-
199-
## Get involved
200-
201-
This project is _super_ early and feedback is very much welcome. In order to keep things running smooth, please consult the [contribution guide and code of conduct](https://github.com/hankchizljaw/hylia/blob/master/contributing.md).
202-
203-
The stuff that I need the most help with is:
204-
205-
- Documentation
206-
- [Webmentions](https://www.w3.org/TR/webmention/)
207-
- Performance
208-
209-
[deploy-to-netlify]: https://app.netlify.com/start/deploy?repository=https://github.com/hankchizljaw/hylia&stack=cms

packages/docs/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
12
{
23
"name": "patternlab-website",
3-
"version": "0.5.1",
4-
"description": "A simple Eleventy starter kit to help you have a blog of your own",
4+
"version": "0.1.0",
5+
"description": "The website for patternlab.io",
56
"main": "index.js",
67
"dependencies": {
78
"@11ty/eleventy": "^0.8.3",
@@ -39,13 +40,13 @@
3940
},
4041
"repository": {
4142
"type": "git",
42-
"url": ""
43+
"url": "git+https://github.com/bradfrost/pl-website-eleventy.git"
4344
},
4445
"keywords": [],
4546
"author": "",
46-
"license": "",
47+
"license": "MIT",
4748
"bugs": {
48-
"url": ""
49+
"url": "https://github.com/bradfrost/pl-website-eleventy/issues"
4950
},
50-
"homepage": ""
51+
"homepage": "https://github.com/bradfrost/pl-website-eleventy/#readme"
5152
}

packages/docs/src/_data/site.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"showThemeCredit": true,
33
"name": "Pattern Lab",
4-
"shortDesc": "Pattern Lab is a lightweight Eleventy starter kit to help you to create your own blog or personal website.",
4+
"shortDesc": "Pattern Lab is a frontend workshop environment that helps you build, view, test, and showcase your design system's UI components.",
55
"url": "https://patternlab.io/",
66
"authorEmail": "[email protected]",
77
"authorHandle": "@bradfrost",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% extends 'layouts/base.njk' %}
2+
{% set pageType = 'Post Archive' %}
3+
4+
{# Intro content #}
5+
{% set introHeading = title %}
6+
{% set introSummary %}{{ content | safe }}{% endset %}
7+
8+
{# Post list content #}
9+
{% set demoListItems = collections.demos %}
10+
11+
{% block content %}
12+
<main id="main-content">
13+
<div class="l-container">
14+
{% include "components/page-header.njk" %}
15+
16+
<h2 class="c-section-header">In the wild</h2>
17+
{% set demoListCategory = 'example' %}
18+
{% include "partials/components/demo-list.njk" %}
19+
20+
<h2 class="c-section-header">Starterkits</h2>
21+
{% set demoListCategory = 'starterkit' %}
22+
{% include "partials/components/demo-list.njk" %}
23+
</div>
24+
</main>
25+
{% endblock %}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% if demoListItems.length %}
2+
3+
<ol class="c-demo-list">
4+
{% for item in demoListItems %}
5+
6+
{% if item.data.category == demoListCategory %}
7+
<li class="c-demo-list__item">
8+
9+
<a href="{{ item.data.url }}" target="_blank" class="c-stacked-block">
10+
<img src="{{item.data.image}}" alt="{{item.data.title}}" class="c-stacked-block__image">
11+
<h3 class="c-stacked-block__title">
12+
{{ item.data.title }}
13+
</h3>
14+
<p class="c-stacked-block__description">
15+
{{ item.data.description}}
16+
</p>
17+
</a>
18+
19+
</li>
20+
{% endif %}
21+
22+
{% endfor %}
23+
</ol>
24+
25+
{% endif %}

0 commit comments

Comments
 (0)