Skip to content

Commit fb47f26

Browse files
authored
Add Docs Site Scaffold (#236)
1 parent 5b5ad72 commit fb47f26

Some content is hidden

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

49 files changed

+5279
-48
lines changed

modules/docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
node_modules
3+
resources
4+
public
5+
hugo_stats.json

modules/docs/.hugo_build.lock

Whitespace-only changes.

modules/docs/.prettierrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"printWidth": 90,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"bracketSpacing": false,
6+
"quoteProps": "consistent",
7+
"trailingComma": "none",
8+
"arrowParens": "always",
9+
"plugins": ["prettier-plugin-go-template"],
10+
"overrides": [
11+
{
12+
"files": ["*.html"],
13+
"options": {
14+
"parser": "go-template"
15+
}
16+
}
17+
]
18+
}

modules/docs/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Hugo Starter Site
2+
3+
This is my favorite way to code static websites. It's a Hugo site with the following front-end technologies built in.
4+
5+
### CUBE CSS
6+
7+
I copied much of the inspiring [cube-boilerplate](https://github.com/Set-Creative-Studio/cube-boilerplate/tree/main) into this Hugo enviroment. I've modified it to use the [utopia-core](https://github.com/trys/utopia-core) functions for font sizes and spacing.
8+
9+
The boilerplate uses a modified tailwindcss config. In order to get tailwindy behavior in Hugo, I followed this [hugo-starter-tailwind-basic](https://github.com/bep/hugo-starter-tailwind-basic) from [bep](https://github.com/bep).
10+
11+
### Hotwired Turbo
12+
13+
I use [@hotwired/turbo](https://github.com/hotwired/turbo) to speed everything up for free.
14+
15+
## Installation
16+
17+
```sh
18+
19+
git clone https://github.com/jameskerr/hugo-starter
20+
21+
mv hugo-starter my-cool-site # rename to something you want
22+
23+
cd my-cool-site
24+
25+
yarn
26+
27+
hugo server
28+
```
29+
30+
## CSS Instructions
31+
32+
Add your own CSS files anywhere in these directories to have them automatically included.
33+
34+
- `assets/css/blocks/`
35+
- `assets/css/compositions/`
36+
- `assets/css/utilities/`
37+
38+
Take a look at `assets/css/main.css` for how it all is stitched together. Also visit the docs for [CUBE CSS](https://cube.fyi/) and [Utopia](https://utopia.fyi/).
39+
40+
## JS Instructions
41+
42+
Add your JavaScript files to `assets/js`, then import then into `assets/js/main.js`. These will get build using Hugo's [js.Build pipe](https://gohugo.io/hugo-pipes/js/).
43+
44+
Enjoy!
45+
46+
Authored by [James Kerr](http://jameskerr.blog)

modules/docs/archetypes/default.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+++
2+
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
3+
date = {{ .Date }}
4+
draft = true
5+
+++
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const slugify = require('slugify');
2+
3+
const nameSlug = (text) => {
4+
return slugify(text, {lower: true});
5+
};
6+
7+
/**
8+
* Converts human readable tokens into tailwind config friendly ones
9+
*
10+
* @param {array} tokens {name: string, value: any}
11+
* @return {object} {key, value}
12+
*/
13+
const tokensToTailwind = (tokens, options = {slugify: true}) => {
14+
let response = {};
15+
16+
tokens.forEach(({name, value}) => {
17+
const key = options.slugify ? nameSlug(name) : name;
18+
response[key] = value;
19+
});
20+
21+
return response;
22+
};
23+
24+
module.exports = tokensToTailwind;

modules/docs/assets/css/blocks/code-example.css

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.prose {
2+
--flow-space: var(--space-m);
3+
}
4+
5+
.prose p {
6+
max-inline-size: var(--measure);
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
CLUSTER
3+
More info: https://every-layout.dev/layouts/cluster/
4+
A layout that lets you distribute items with consitent
5+
spacing, regardless of their size
6+
7+
CUSTOM PROPERTIES AND CONFIGURATION
8+
--gutter (var(--space-s-m)): This defines the space
9+
between each item.
10+
11+
--cluster-horizontal-alignment (flex-start) How items should align
12+
horizontally. Can be any acceptable flexbox aligmnent value.
13+
14+
--cluster-vertical-alignment How items should align vertically.
15+
Can be any acceptable flexbox alignment value.
16+
*/
17+
18+
.cluster {
19+
display: flex;
20+
flex-wrap: wrap;
21+
gap: var(--gutter, var(--space-s-m));
22+
justify-content: var(--cluster-horizontal-alignment, flex-start);
23+
align-items: var(--cluster-vertical-alignment, center);
24+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
FLOW COMPOSITION
3+
Like the Every Layout stack: https://every-layout.dev/layouts/stack/
4+
Info about this implementation: https://piccalil.li/quick-tip/flow-utility/
5+
*/
6+
.flow > * + * {
7+
margin-top: var(--flow-space, 1em);
8+
}

0 commit comments

Comments
 (0)