Skip to content

Commit fdb198c

Browse files
committed
Update readme
1 parent c077e19 commit fdb198c

File tree

5 files changed

+65
-19
lines changed

5 files changed

+65
-19
lines changed
318 KB
Loading
-135 KB
Binary file not shown.

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
---
1717

18-
![The preview image of the theme.](./.github/spruce-docs-preview-mockup.png)
18+
![The preview image of the theme.](./.github/spruce-docs-preview-mockup-2.png)
1919

20-
[![Netlify Status](https://api.netlify.com/api/v1/badges/b7560c95-7035-491b-8c3f-94c43bea761e/deploy-status)](https://app.netlify.com/sites/sprucecss-eleventy-documentation/deploys)
20+
21+
[![Github release](https://img.shields.io/github/v/release/conedevelopment/sprucecss-eleventy-documentation-template?color=2350f6&logo=github&logoColor=white&style=for-the-badge)](https://github.com/conedevelopment/sprucecss-eleventy-documentation-template/releases/latest)
22+
[![License](https://img.shields.io/badge/license-MIT-2350f6?style=for-the-badge)](https://github.com/conedevelopment/sprucecss-eleventy-documentation-template/blob/main/LICENSE)
2123

2224
A documentation template is always helpful. There are a lot of solutions to make one; we wanted to create our self-hosted version based on our favorite static site generator [Eleventy](https://www.11ty.dev/).
2325

@@ -42,6 +44,52 @@ The template is built on [Spruce CSS](https://sprucecss.com/), a small and custo
4244
- [svgIcon](https://github.com/conedevelopment/sprucecss-eleventy-documentation-template/blob/main/src/shortcodes/svg-icon.js) shortcode: render any SVG icon inline and add optional classes.
4345
- [markdownRenderer](https://github.com/conedevelopment/sprucecss-eleventy-documentation-template/blob/main/src/shortcodes/markdown-render.js): render any string (markdown) into HTML.
4446

47+
## Setup
48+
49+
1. **Clone the repository.**
50+
51+
2. **Install the dependencies.**
52+
53+
In the `package.json` file, you will find all of the dependencies (and scripts) to install them using the following command:
54+
55+
```shell
56+
npm install
57+
```
58+
59+
3. **Run the development mode**
60+
61+
To run the development mode, use the `npm script`. This script will also watch for changes.
62+
63+
```shell
64+
npm start
65+
```
66+
67+
4. **Run the production mode**
68+
69+
Before you go live, you should use the production script to compress the Sass files.
70+
71+
```shell
72+
npm run prod
73+
```
74+
75+
You can find some more npm scripts in the [package.json](https://github.com/conedevelopment/sprucecss-eleventy-documentation-template/blob/main/package.json) that can be helpful.
76+
77+
## Content Managment
78+
79+
Adding content to the template is easy as almost everything is in Eleventy.
80+
81+
### The Basic Structure
82+
83+
Our base folder for the documentation pages is the `posts` folder. You must follow the folder structure, which means the `category` here. If you create a folder, you must make a list page with the same name as the folder. You must also create another `posts` folder under the `category` folder where your posts go. You must create the `posts.json` file that will parameter your `layout` and `permalink` values.
84+
85+
### Eleventy Navigation
86+
87+
The theme utilizes the [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/), so you must explicitly set up the hierarchy. This is needed for the automatic sidebar navigation, the navigation order, and breadcrumb generation.
88+
89+
### Other Pages
90+
91+
To create simple pages, make a file directly under the `src` folder and configure it with the available front matter.
92+
4593
## Structure
4694

4795
```html
@@ -80,3 +128,5 @@ spruecss-eleventy-documentation-template/
80128
- **scss**: The Sass files.
81129
- **shortcodes**: The available shortcodes.
82130
- **transforms**: The transformations.
131+
132+
[![Netlify Status](https://api.netlify.com/api/v1/badges/b7560c95-7035-491b-8c3f-94c43bea761e/deploy-status)](https://app.netlify.com/sites/sprucecss-eleventy-documentation/deploys)

src/css/main.css

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,10 @@ samp {
11931193
inset-block-start: 3rem;
11941194
position: sticky;
11951195
}
1196-
.l-post .post-heading {
1197-
grid-column: 1/3;
1196+
@media (min-width: 80em) {
1197+
.l-post .post-heading {
1198+
grid-column: 1/3;
1199+
}
11981200
}
11991201

12001202
.l-list {
@@ -1203,24 +1205,13 @@ samp {
12031205
gap: 3rem;
12041206
grid-template-columns: var(--gtc);
12051207
}
1206-
@media (min-width: 64em) {
1207-
.l-list {
1208-
--gtc: minmax(0, 1fr) minmax(0, 15rem);
1209-
}
1210-
}
1211-
.l-list__inner {
1212-
grid-column: 1/3;
1213-
}
12141208
.l-list__inner--changelog > *, .l-list__inner--faq > * {
12151209
margin-block-end: 0;
12161210
margin-block-start: 0;
12171211
}
12181212
.l-list__inner--changelog > * + *, .l-list__inner--faq > * + * {
12191213
margin-block-start: 3rem;
12201214
}
1221-
.l-list .post-heading {
1222-
grid-column: 1/3;
1223-
}
12241215

12251216
.header {
12261217
align-items: center;
@@ -2095,10 +2086,16 @@ textarea.pagefind-ui__search-input {
20952086
}
20962087

20972088
.changelog-item {
2089+
--gtc: minmax(0, 1fr);
20982090
align-items: flex-start;
2099-
display: flex;
2100-
flex-wrap: wrap;
2091+
display: grid;
21012092
gap: 1.5rem 3rem;
2093+
grid-template-columns: var(--gtc);
2094+
}
2095+
@media (min-width: 64em) {
2096+
.changelog-item {
2097+
--gtc: minmax(0, 9rem) minmax(0, 1fr);
2098+
}
21022099
}
21032100
.changelog-item__date {
21042101
background-color: var(--spruce-btn-color-primary-background);
@@ -2107,6 +2104,7 @@ textarea.pagefind-ui__search-input {
21072104
display: inline-flex;
21082105
flex-shrink: 0;
21092106
font-weight: 700;
2107+
justify-self: start;
21102108
padding: 0.25rem 1rem;
21112109
}
21122110
.changelog-item ul p {

src/posts/getting-started/posts/setup.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ eleventyNavigation:
77
order: 4
88
---
99

10-
We use `eleventy --serve` and compile Sass with sass-cli with npm scripts.
11-
1210
## Clone the repository
1311

1412
Today more people and experts write about accessibility. For the better progression it is a good idea to read them.

0 commit comments

Comments
 (0)