Skip to content

Commit

Permalink
update site structure, essential files docs
Browse files Browse the repository at this point in the history
  • Loading branch information
waldronmatt committed Oct 15, 2020
1 parent ff733b5 commit 87df9b3
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 70 deletions.
6 changes: 6 additions & 0 deletions docs/ejs-structure.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ permalink: /site-structure/ejs-structure
layouts/
partials/
templates/
default.ejs
favicons.ejs

**components** - markup that can be reused on your site

Expand All @@ -24,5 +26,9 @@ permalink: /site-structure/ejs-structure

**templates** - ejs calls to the main parts of your site (head, header, navigation, footer)

**default.ejs** - fallback page template

**favicons.ejs** - stores references to generated favicons

84 changes: 67 additions & 17 deletions docs/essential-files.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,21 @@ These files contain Bowman's webpack configuration files, HTML markup generator
Bowman's HTML generator looks for matching file names under **content/** and **data/** directories. A 1:1 relationship of content and data for a page must exist or the build process will fail.

You can structure your pages however you'd like; as long as the directory structure of **content/** matches **data/** and vice versa.

## site.json
## ejs/layouts/

src/
static/
json/
site.json
ejs/
layouts/
foot.ejs
footer.ejs
head.ejs
header.ejs

<br>
ejs files inside layouts/ contains the global includes fed into templates/default.ejs. You can choose to include directly in default.ejs.

{
"title": "Bowman",
"description": "Simple static site generator powered by Node.js and Webpack",
"keywords" : "bowman, static site generator, nodejs, javascript, webpack, browsersync"
}

<br>
site.json supplies metadata shared by pages in your project. Edit scripts/utils/config.js if you want to customize how this data is handled.

## default.ejs

src/
Expand Down Expand Up @@ -74,11 +70,43 @@ default.ejs is the fallback page template option for Bowman's HTML markup genera
// render template
const template = pageContent.attributes.template || 'default';

## ignore.js
## favicons.ejs

Bowman uses a webpack prebuild script to generate a manifest file containing site assets before static assets are compiled in the main webpack configuration. This is useful for situation where you want to reference the manifest file in your js scripts.
src/
static/
ejs/
favicons.ejs

<br>
favicons.ejs stores references to generated favicons. This file is injected into layouts/head.ejs via prod builds.

Because webpack mandates an entrypoint, a placeholder file (ignore.js) is used in the webpack prebuild script. More information can be found in ignore.js.
## logo.png

dist/
scripts/
src/
logo.png

<br>
The webpack favicon plugin will look to the root directory for logo.png to generate the favicons via prod builds.

## site.json

src/
static/
json/
site.json

<br>

{
"title": "Bowman",
"description": "Simple static site generator powered by Node.js and Webpack",
"keywords" : "bowman, static site generator, nodejs, javascript, webpack, browsersync"
}

<br>
site.json supplies metadata shared by pages in your project. Edit scripts/utils/config.js if you want to customize how this data is handled.

## app.js, app.scss

Expand Down Expand Up @@ -114,4 +142,26 @@ app.scss
<br>
You can safely rename ***app.js** and **app.scss** to something more suitable for your project, however, it is not recommended removing these files entirely.

You can create **additional** files without underscores to signify assets you want imported separately from your main entry points. [Click here](/bowman/faq) to read more.
You can create **additional** files without underscores to signify assets you want imported separately from your main entry points. [Click here](/bowman/faq) to read more.

## critical.scss

src/
static/
scss/
critical.scss

<br>
critical.scss contains scss imports you want inlined for quicker rendering. This file is injected into layouts/head.ejs via prod builds.

## ignore.js

dist/
scripts/
src/
ignore.js

<br>
Bowman uses a webpack prebuild script to generate a manifest file containing site assets before static assets are compiled in the main webpack configuration. This is useful for situation where you want to reference the manifest file in your js scripts.

Because webpack mandates an entrypoint, a placeholder file (ignore.js) is used in the webpack prebuild script. More information can be found in ignore.js.
11 changes: 10 additions & 1 deletion docs/faq.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@ permalink: /faq
...
static/
ejs/
layouts/
foot.ejs
footer.ejs
head.ejs
header.ejs
templates/
default.ejs
favicons.ejs
js/
app.js
json/
site.json
scss/
app.scss
critical.scss
.babelrc
.editorconfig
.eslintignore
.eslintrc
.prettierrc.json
.stylelintignore
.stylelintrc.json
ignore.js
logo.png
package.json
package-lock.json
## How do I set up additional entry points?

Expand Down
34 changes: 0 additions & 34 deletions docs/js-structure.markdown

This file was deleted.

4 changes: 2 additions & 2 deletions docs/json-structure.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ permalink: /site-structure/json-structure

**components** - data specific to components

**layouts** - data specific to site layouts (head, header, navigation, footer)
**layouts** - data specific to site layouts (head, header, navigation, footer, etc.)

**site.json** - data shared across the entire site (title, description, keywords, etc)
**site.json** - data shared across the entire site (title, description, keywords, etc.)
23 changes: 14 additions & 9 deletions docs/scss-structure.markdown → docs/script-structure.markdown
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
---
layout: default
title: SCSS Structure
title: JS Structure
nav_order: 1
parent: Site Structure
permalink: /site-structure/scss-structure
permalink: /site-structure/script-structure
---

# JS Structure

src/
static/
js/
.../
app.js

**app.js** - js entrypoint for your site

# SCSS Structure

Bowman's default scss structure is based on Hugo Giraudel's SCSS 7-1 architecture pattern. [Click here](https://sass-guidelin.es/#architecture) to learn more.

src/
static/
scss/
abstracts/
base/
components/
layouts/
pages/
vendors/
.../
app.scss
critical.scss

**app.scss** - css entrypoint for your site

**critical.scss** - critical css to be inlined for improved page load performance
**critical.scss** - critical css to be inlined for improved page load performance
8 changes: 1 addition & 7 deletions docs/site-structure.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ permalink: /site-structure/
src/
static/
docs/
ejs/
favicons/
fonts/
images/
img/
js/
json/
scss/
favicon

0 comments on commit 87df9b3

Please # to comment.