Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarchie committed Sep 2, 2023
1 parent 8dd8d55 commit aef47f8
Showing 1 changed file with 60 additions and 21 deletions.
81 changes: 60 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,72 @@
# Builder
# Builder: Static Site Generation Tool

This a site generation tool for me. I've designed based on convention over
configuration. I don't want to maintain anymore YAML files.
Builder is a streamlined static site generation tool designed with a focus on
convention over configuration. Say goodbye to maintaining endless YAML files and
embrace a more straightforward approach to building your website.

## Usage
## Features

- Download the binary from Releases.
- **No Configuration Files**: Avoid the hassle of managing configuration files.
- **Simple Directory Layout**: Organize your content easily with a
straightforward directory structure.
- **Markdown Support**: Write and organize your content in markdown format.
- **Asset Management**: Easily manage images, JavaScript, CSS, and other assets.
- **Server-Side Mermaid Rendering**: Integrated support for server-side mermaid
rendering.
- **HTML Minification**: Minimize the HTML output for smaller pages.

```bash
brew tap jtarchie/builder https://github.com/jtarchie/builder
brew install builder
npm install -g @mermaid-js/mermaid-cli # for server side mermaid
```
## Getting Started

- Create a project with the following directory layout:
### Installation

- `layout.html` the template to be used to render the content of the site.
- `public/` with all assets that will be copied over to the output directory.
Used for images, javascript, css, etc.
- `**/*.md` write your markdown files. Organize them in the directory layout
you'd like. They'll be rendered and copied to the corresponding place.
1. **Download Builder**:

```bash
builder --source-path <directory> --build-path <output-directory>
```
Using Homebrew:
```bash
brew tap jtarchie/builder https://github.com/jtarchie/builder
brew install builder
```

2. **Install Mermaid CLI** (for server-side mermaid rendering):

```bash
npm install -g @mermaid-js/mermaid-cli
```

### Setting Up Your Project

1. **Directory Structure**:

- `layout.html`: This is the main template used to render the content of your
site.
- `public/`: Place all your assets here (images, JavaScript, CSS, etc.).
These will be copied to the output directory during the build process.
- `**/*.md`: Write your content in markdown files. Organize them in any
directory structure you prefer. They will be rendered and placed in the
corresponding location in the output directory.

2. **Building Your Site**:

```bash
builder --source-path <source-directory> --build-path <output-directory>
```

### Example Directory Breakdown

To get a clearer idea, check out the `example/` directory:

### Example
- **`example`**: The root directory for the sample project.
- **`example/markdown.md`**: A sample markdown file showcasing content creation.
- **`example/posts`**: A directory for organizing blog posts or articles.
- **`example/posts/2023-01-01.md`**: A sample blog post dated January 1, 2023.
- **`example/layout.html`**: The main template file defining the site's
structure and appearance.
- **`example/public`**: A directory for static assets like images, stylesheets,
and scripts.
- **`example/public/404.html`**: A custom 404 error page for handling missing
pages.

See the `example/` for to see how it should look.
To run the example:

```bash
go run cmd/main.go --source-path ./example --build-path build/ --serve
Expand Down

0 comments on commit aef47f8

Please sign in to comment.