Skip to content

Commit f1687c0

Browse files
committed
Update examples in docs and bump version to 24.10
1 parent 86faff8 commit f1687c0

File tree

5 files changed

+54
-38
lines changed

5 files changed

+54
-38
lines changed

docs/example.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/examples.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Examples
2+
========
3+
4+
Examples are available on `GitHub <https://github.com/wigging/genja>`_ in the Genja repository. See the sections below for more information about each example.
5+
6+
Directory website
7+
-----------------
8+
9+
The ``directory-website`` example uses the ``website`` directory for the generated output. The ``_mdcontent`` directory contains the Markdown files used by Genja to generate the HTML files. The ``_templates`` directory contains the Jinja2 templates.
10+
11+
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.
12+
13+
.. code:: text
14+
15+
cd examples/directory-website
16+
genja serve
17+
18+
Use the commands shown below to build the example website without starting a local server.
19+
20+
.. code:: text
21+
22+
cd examples/directory-website
23+
genja build
24+
25+
Top-level output
26+
----------------
27+
28+
The ``toplevel-output`` example uses the top-level directory for the generated output. The ``_notes`` directory contains the Markdown files used by Genja to generate the HTML files. The ``_templates`` directory contains the Jinja2 templates.
29+
30+
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.
31+
32+
.. code:: text
33+
34+
cd examples/toplevel-output
35+
genja serve
36+
37+
Use the commands shown below to build the example website without starting a local server.
38+
39+
.. code:: text
40+
41+
cd examples/toplevel-output
42+
genja build

docs/getstarted.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,24 @@ Check the installed version from the command line:
2828
Usage
2929
-----
3030

31-
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.
31+
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.toml** defines the URLs and directories for the project.
3232

3333
.. code:: text
3434
3535
myproject/
3636
├── content/
3737
├── templates/
3838
├── docs/
39-
└── config.json
39+
└── config.toml
4040
41-
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.
41+
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.
4242

43-
.. code:: json
43+
.. code:: toml
4444
45-
{
46-
"base_url": "https://example.com/mywebsite",
47-
"input_dir": "content",
48-
"output_dir": "docs"
49-
}
45+
base_url = "https://example.com/mywebsite"
46+
markdown_dir = "content"
47+
template_dir = "templates"
48+
output_dir = "docs"
5049
5150
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.
5251

docs/index.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
Genja documentation
1+
Genja Documentation
22
===================
33

4-
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.
4+
Genja is a simple static website generator for GitHub Pages. It is a command line tool built in Python that generates HTML files and a JSON feed from Markdown content.
55

66
.. toctree::
77
:maxdepth: 2
88
:caption: Contents:
99

1010
getstarted
11-
example
12-
13-
Indices and tables
14-
==================
15-
16-
* :ref:`genindex`
17-
* :ref:`modindex`
18-
* :ref:`search`
11+
examples

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "genja"
7-
version = "24.3"
7+
version = "24.10"
88
authors = [{name = "Gavin Wiggins"}]
99
description = "Static site generator for GitHub Pages"
1010
readme = "README.md"

0 commit comments

Comments
 (0)