Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Jul 5, 2024
1 parent 75f48ac commit bb9b888
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# JSSG - Jtremesay's Static Site Generator
# JFM-Engine

[![CI/CD](https://github.com/jtremesay/jssg/actions/workflows/main.yaml/badge.svg)](https://github.com/jtremesay/jssg/actions/workflows/main.yaml)

The thing that propulse [jtremesay.org](https://jtremesay.org).

Today, it's a django app that can generate a static website with Vite & Typescript integration.

Expand Down Expand Up @@ -44,8 +41,9 @@ $ ./manage.py distill-local --collectstatic --force dist
Or, if you prefer docker:

```shell
$ docker build -t jssg .
$ sudo docker run -p 8080:80 jssg:latest
$ sudo docker build -t jssg .
$ sudo docker network create traefik_public
$ sudo docker compose up
```

## Config
Expand All @@ -54,8 +52,8 @@ $ sudo docker run -p 8080:80 jssg:latest
For django settings, see https://docs.djangoproject.com/en/5.0/ref/settings/

Otherwise, you have to configure the following settings :
- `JSSG_DOMAIN` : the domain name of your website, for example `"https://www.example.com"` (used in sitemap file)
- `JSSG_CONTENT_DIR` : a list of directories where look for the site content
- `JSSG_DOMAIN` : the domain name of your website, for instance `"https://www.example.com"` (used in sitemap file)
- `JSSG_CONTENT_DIR` : a list of directories where to look for the site content

### `Dockerfile` :
- In the `# Copy source dir` section, add `COPY <content-dir>/ <content-dir>/` for each content directory in `JSSG_CONTENT_DIR`
Expand Down Expand Up @@ -85,24 +83,25 @@ Content-dir/
```

### Templates :
For Django engine : https://docs.djangoproject.com/en/5.0/ref/templates/language/ \
For Jinja2 engine : https://jinja.palletsprojects.com/en/2.11.x/templates/
For Django engine, see https://docs.djangoproject.com/en/5.0/ref/templates/language/ \
For Jinja2 engine, see https://jinja.palletsprojects.com/en/2.11.x/templates/

`page.html` and `post.html` are the firsts templates called to render a page or a post. In these templates, the content of a page is accessible by `object.content`. By default, they extend the `base.html` template.
`page.html` and `post.html` are the firsts templates called to render a page or a post. By default, they extend the `base.html` template.

### Pages :
Pages contain the content of each web page of the site at `pages/<slug>.html`. They are `.md` files and are structured in 3 sections separated by a line starting with `---` :
Pages contain the content of each web page of the site at url `pages/<slug>.html`. They are `.md` files and are structured in 3 sections separated by a line starting with `---` :

- **Metadata** provide some informartion about the page (description, language...). Each metadata is a key, some spaces, and a value. The `title` metadata is required for all pages. `slug`, `lang`, `engine` or open graph metadata can also be useful. Metadata are accessible by a dictionary in `object.metadata` in templates.
- **Metadata** provide some informartion about the page (description, language...). Each metadata is a key, some spaces, and a value. The `title` metadata is required for all pages. Other metadata can be useful, like `slug`, `lang`, `engine` or `og:<key>` (open graph). Metadata are accessible by a dictionary in `object.metadata` in templates.
- **Data** is a section which contains a JSON text. It is accessible by `object.data` in templates.
- **Body** : It is the concrete content of the page, that can be html or template content. For example, it is possible to use widgets or blocks in this section.
- **Body** : It is the concrete content of the page, that can be html or template content. For instance, it is possible to use widgets or blocks in this section. It is accessible by `object.content` in templates.

### Posts :
Like pages, they contain the content of each post at `posts/<slug>.html`. They require an additional metadata `date` in ISO format.
Like pages, they contain the content of each post at url `posts/<slug>.html`. They require an additional metadata `date` in ISO format

### Static :
This directory is for the static content, like images, CSS and JavaScript files ...
It is accessible in templates by the `static` function.
This directory is for the static content, like images, CSS and JavaScript files ... \
It is accessible in templates by the Jinja or Django `static` function. \
See the [Django doc](https://docs.djangoproject.com/en/5.0/howto/static-files/#configuring-static-files) for static files, or the [Jinja2 version](https://docs.djangoproject.com/en/5.0/topics/templates/#module-django.template.backends.django).

## Others

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
version: "3.8"
services:
jtremesay:
image: "killruana/jtremesay.org:main"
image: "jssg"
ports:
- 8003:80
networks:
Expand Down

0 comments on commit bb9b888

Please sign in to comment.