Skip to content

Commit 86faff8

Browse files
committed
Rename examples directories and update readme
1 parent 3b4bfb6 commit 86faff8

File tree

27 files changed

+32
-31
lines changed

27 files changed

+32
-31
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to the genja project are documented in this file. The format of this changelog is based on [Keep a Changelog](https://keepachangelog.com). This project adheres to [Calendar Versioning](https://calver.org) based on `YY.MM.MICRO`.
44

5+
## Genja v24.10
6+
7+
#### Added
8+
9+
- Require Python version 3.12 or higher
10+
- Improve the `genja clean` command to remove all generated files
11+
- Add `template_dir` in config file
12+
- Put examples into subdirectories
13+
14+
#### Changed
15+
16+
- Use TOML instead of JSON for config file
17+
- Change `input_dir` to `markdown_dir` in config file
18+
519
## Genja v24.3
620

721
#### Added

README.md

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,61 @@
11
# Genja
22

3-
Genja is a simple static site generator for GitHub Pages. It is a command line tool built in Python that generates HTML files and a JSON feed from Markdown content.
3+
Genja is a simple static website generator. It is a command line tool built in Python that generates HTML files and a JSON feed from Markdown content.
44

55
## Installation
66

7-
Download and install Python from [python.org](https://www.python.org) or from [Anaconda](https://www.anaconda.com). Next, install genja from [PyPI](https://pypi.org) using the following command:
7+
Download and install Python from [python.org](https://www.python.org) or from [Anaconda](https://www.anaconda.com). Next, install Genja from [PyPI](https://pypi.org) using the following command:
88

9-
```
9+
```text
1010
pip install genja
1111
```
1212

1313
Check the installed version from the command line:
1414

15-
```
15+
```text
1616
genja --version
1717
```
1818

1919
## Usage
2020

21-
Before running genja, create a project structure as shown below. The `content` directory contains Markdown files that are used to generate HTML files. The `templates` directory contains [Jinja](https://jinja.palletsprojects.com/) templates that are used to render the HTML pages. The `docs` directory contains the built website which can be hosted with GitHub Pages. Lastly, the `config.json` defines the URLs and directories for the project.
21+
Before running Genja, create a project structure as shown below. The `content` directory contains Markdown files that are used to generate HTML files. The `templates` directory contains [Jinja2](https://jinja.palletsprojects.com/) templates that are used to render the HTML pages. The `docs` directory contains the generated website which can be hosted with GitHub Pages. Lastly, the `config.toml` defines the base URL and directories for the project.
2222

23-
```
23+
```text
2424
mywebsite/
2525
|- content/
2626
|- templates/
2727
|- docs/
28-
|- config.json
28+
|- config.toml
2929
```
3030

31-
The items in the `config.json` are shown below. The `base_url` is the URL for the homepage of the website. Markdown files that are parsed by genja are located in the `input_dir` directory. The HTML files generated from genja are located in the `output_dir` directory. Static content such as images and CSS files should go in the output directory.
31+
The items in the `config.toml` are shown below. The `base_url` is the URL for the homepage of the website. Markdown files that are parsed by Genja are located in the `markdown_dir` directory. The Jinja2 templates used by Genja are located in the `template_dir` directory. The HTML files generated from Genja are located in the `output_dir` directory. Static content such as images and CSS files should go in the output directory.
3232

33-
```json
34-
{
35-
"base_url": "https://example.com/mywebsite",
36-
"input_dir": "content",
37-
"output_dir": "docs"
38-
}
33+
```toml
34+
base_url = "https://example.com/mywebsite"
35+
markdown_dir = "content"
36+
template_dir = "templates"
37+
output_dir = "docs"
3938
```
4039

4140
Use the serve command to build the website and start a local server. This will automatically open the default web browser to view the website. The website will automatically reload when changes are saved to the Markdown files.
4241

43-
```
42+
```text
4443
genja serve
4544
```
4645

4746
Use the build command to build the website without running a local server.
4847

49-
```
48+
```text
5049
genja build
5150
```
5251

53-
## Example
54-
55-
To run the example, go to the `example` directory in this repository. The `mdcontent` folder is the input directory containing the Mardkown files. The `website` folder is the output directory containing the built HTML files. Use the commands shown below to build the website and run a local server to view the website in the default web browser. The website will automatically reload in the web browser when changes are saved to the Markdown files.
56-
57-
```
58-
cd example
59-
genja serve
60-
```
61-
62-
Use the commands shown below to build the example website without starting a local server.
52+
## Examples
6353

64-
```
65-
cd example
66-
genja build
67-
```
54+
See the `examples` directory in this repository for two example projects that can be built with Genja. The `directory-website` example uses the `website` directory for the generated output. The `toplevel-output` example uses the top-level of the project for the generated output.
6855

6956
## Contributing
7057

71-
Clone this repository and use the conda environment file to create a Python environment for developing genja. This environment uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting along with [pytest](https://docs.pytest.org) for running tests. Genja is installed in editable mode within the environment.
58+
Clone this repository and use the conda environment file to create a Python environment for developing Genja. This environment uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting along with [pytest](https://docs.pytest.org) for running tests. Genja is installed in editable mode within the environment.
7259

7360
```bash
7461
# Clone this project
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/website-directory/_mdcontent/fruits/crab-apple.md renamed to examples/directory-website/_mdcontent/fruits/crab-apple.md

File renamed without changes.

examples/website-directory/_mdcontent/fruits/orange.md renamed to examples/directory-website/_mdcontent/fruits/orange.md

File renamed without changes.

examples/website-directory/_mdcontent/fruits/watermelon.md renamed to examples/directory-website/_mdcontent/fruits/watermelon.md

File renamed without changes.

examples/website-directory/_mdcontent/veggies/broccoli.md renamed to examples/directory-website/_mdcontent/veggies/broccoli.md

File renamed without changes.

examples/website-directory/_mdcontent/veggies/carrots.md renamed to examples/directory-website/_mdcontent/veggies/carrots.md

File renamed without changes.

0 commit comments

Comments
 (0)