Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Jul 11, 2024
1 parent 70c4bda commit a1f47df
Show file tree
Hide file tree
Showing 47 changed files with 784 additions and 1,079 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ RUN pip install -Ur requirements.txt \
COPY manage.py tsconfig.json vite.config.ts ./
COPY jssg/ jssg/
COPY content/ content/
COPY common-content/ common-content/
COPY galae-content/ galae-content/

# Build
RUN npm run build \
Expand Down
76 changes: 66 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# JSSG - Jtremesay's Static Site Generator

[![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).
# JFM-Engine

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

## Bootstrap

```shell
$ git clone https://github.com/jtremesay/jtremesay.org.git
$ cd jtremesay.org
$ git clone https://github.com/algoo/jssg.git
$ cd jssg
$ python3.9 -m venv env/
$ source env/bin/activate
$ direnv allow
Expand Down Expand Up @@ -44,9 +40,69 @@ $ ./manage.py distill-local --collectstatic --force dist
Or, if you prefer docker:

```shell
$ docker build -t jssg .
$ sudo docker build -t jssg .
$ sudo docker network create traefik_public
$ sudo docker compose up
```

## Others
## Config

### `settings.py` :
For django settings, see https://docs.djangoproject.com/en/5.0/ref/settings/

This repo is a fork of https://github.com/jtremesay/jssg.git for algoo websites use cases.
Otherwise, you have to configure the following settings :
- `JFME_DOMAIN` : the domain name of your website, for instance `"https://www.example.com"` (used in sitemap file)
- `JFME_CONTENT_DIRS` : 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 `JFME_CONTENT_DIRS`

### `views.py` :
- In the `get_object` method of `IndexView`, set the `self.kwargs["slug"]` to the slug of your index page which is sent at the root of your site

## Usage

Each directory defined in `JFME_CONTENT_DIRS` has the following structure :
```
Content-dir/
|-- templates/
| |-- django/
| | |-- blocks/
| | |-- widgets/
| |-- jinja2/
| |-- blocks/
| |-- widgets/
| |-- base.html
| |-- page.html
| |-- post.html
| |-- sitemap.html
|-- pages/
|-- posts/
|-- static/
```

### 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. By default, they extend the `base.html` template.

### Pages :
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. Other metadata can be useful, like `slug`, `lang`, `template_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 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 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 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

JFM-Engine is a friendly fork of [JSSG](https://github.com/jtremesay/jssg/) made in agreement with the JSSG developer because of different goals. \
See the [issue #21](https://github.com/jtremesay/jssg/issues/21).
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<div class="col-lg-3 h-100 text-center text-lg-start my-auto">
<ul class="list-unstyled mb-0">
<li class="list-item me-4">
<a href="{{ url_abs('en/index') }}">Home</a>
<a href="{{ url('index') }}">Home</a>
</li>
<li class="list-item me-4">
<a href="{{ url_slug('temoignages-clients') }}">Customer testimonials (FR)</a>
<a href="{{ url('page', args=['temoignages-clients']) }}">Customer testimonials (FR)</a>
</li>
<li class="list-item me-4">
<a href="{{ static('assets/docs/galae_price_list.pdf') }}" target="_blank">Download the price
Expand All @@ -41,7 +41,7 @@
<a href="https://mail.galae.net/" target="_blank">Account management</a>
</li>
<li class="list-item me-4">
<a href="{{ url_slug('generateur-enregistrements-dns') }}">DNS record generator (FR)</a>
<a href="{{ url('page', args=['generateur-enregistrements-dns']) }}">DNS record generator (FR)</a>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<div class="col-lg-3 h-100 text-center text-lg-start my-auto">
<ul class="list-unstyled mb-0">
<li class="list-item me-4">
<a href="{{ url_abs('fr/index') }}">Accueil</a>
<a href="{{ url('index') }}">Accueil</a>
</li>
<li class="list-item me-4">
<a href="{{ url_slug('temoignages-clients') }}">Témoignages clients</a>
<a href="{{ url('page', args=['temoignages-clients']) }}">Témoignages clients</a>
</li>
<li class="list-item me-4">
<a href="{{ static('assets/docs/grille_tarifaire_galae.pdf') }}" target="_blank">Télécharger la
Expand All @@ -42,7 +42,7 @@
<a href="https://mail.galae.net/" target="_blank">Gestion de mon compte</a>
</li>
<li class="list-item me-4">
<a href="{{ url_slug('generateur-enregistrements-dns') }}">Générateur d'enregistrements DNS</a>
<a href="{{ url('page', args=['generateur-enregistrements-dns']) }}">Générateur d'enregistrements DNS</a>
</li>
</ul>
</div>
Expand Down
6 changes: 0 additions & 6 deletions common-content/templates/jinja2/blocks/header.en.html

This file was deleted.

6 changes: 0 additions & 6 deletions common-content/templates/jinja2/blocks/header.fr.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{% macro page_block_h2_with_ul_content_and_image_right(
IMAGE_URL = '',
TITLE = '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
)
%}

<!-- Icons Grid-->
<!-- Icons Grid -->
<section class="features-icons text-bg-light light text-center ">
<div class="container">
<div class="container-fluid">
<div class="row mb-5">
<div class="col-12">
<h3>Plus de 200 clients nous font déjà confiance, pourquoi pas vous ?</h3>
</div>
</div>

<div class="row" title="ils nous font confiance">
<div class="col-lg-12">
{% for reference in REFERENCES %}
<img style="height: 2em; margin: 1em;" src="{{ static(reference.logo_url) }}"
alt="ils utilisent le service email galae: {{ reference.name }}"/>
<img class="img-client-reference" src="{{ static(reference.logo_url) }}" alt="ils utilisent le service email galae: {{ reference.name }}"/>
{% endfor %}
</div>
</div>
Expand Down
42 changes: 28 additions & 14 deletions common-content/templates/jinja2/widgets/testimonials.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
{% macro testimonials(
PERSONS = []
)
)
%}

<!-- Testimonials-->
<section class="testimonials text-center bg-light">
<section class="testimonials text-center bg-dark">
<div class="container">
<h2 class="mb-5">Ce qu'en disent nos clients ...</h2>
<div class="row">
{% for reference in PERSONS %}
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="{{ static(reference.img_url)}}" alt="" />
<h5>{{reference.name}}</h5>
<h6>{{reference.fonction}}</h6>
<p class="font-weight-light mb-0">
«&nbsp;{{reference.testimonial}}&nbsp;»
</p>

<div class="row text-left">
{% for reference in PERSONS %}
<div class="col-md-12 col-sm-12 col-12 col-lg-6 col-xl-4 mb-4">
<div class="card testimonial-card">
<div class="card-body">
<img class="img-fluid rounded-circle mb-3" style="max-width: 8em; float:right;" src="{{ static(reference.img_url)}}" alt="" />
<h5 class="card-title">{{ reference.name }}</h5>
<h6 class="card-subtitle mb-2">{{ reference.job }}</h6>
{% for text in reference.testimonial %}
<p class="card-text lead">
{{ text|safe }}
</p>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
</div>

<div class="row text-center">
<p class="col-12 mt-4">
<a href="https://pay.galae.net/" target="_blank" class="btn btn-primary btn-lg">
Je suis convaincu, je veux souscrire maintenant&nbsp;!
<i class="bi-rocket"></i>
</a>
</p>
</div>

</div>
</section>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% load static %}
{% macro testimonials_quotes(
PERSONS = []
)
%}

<!-- Testimonials-->
<section class="testimonials text-center bg-light">
Expand All @@ -8,16 +11,17 @@ <h2 class="mb-5">Ce qu'en disent nos clients ...</h2>
{% for reference in PERSONS %}
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="{% static reference.img_url %}" alt="" />
<img class="img-fluid rounded-circle mb-3" src="{{ static(reference.img_url)}}" alt="" />
<h5>{{reference.name}}</h5>
<h6>{{reference.fonction}}</h6>
<h6>{{reference.job}}</h6>
<p class="font-weight-light mb-0">
«&nbsp;{{reference.testimonial}}&nbsp;»
«&nbsp;{{reference.testimonial|safe}}&nbsp;»
</p>
</div>
</div>
{% endfor %}

</div>
</div>
</div>
</section>
</section>

{% endmacro %}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a1f47df

Please sign in to comment.