Kaynağa Gözat

Provide a site title

master
Marien Fressinaud 5 yıl önce
ebeveyn
işleme
c7b812c9f4
4 değiştirilmiş dosya ile 15 ekleme ve 6 silme
  1. 4
    2
      Herisson/gallery.html.j2
  2. 3
    1
      Herisson/index.html.j2
  3. 7
    3
      boop.py
  4. 1
    0
      configuration.py

+ 4
- 2
Herisson/gallery.html.j2 Dosyayı Görüntüle

@@ -4,10 +4,12 @@
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0" />
<link rel="stylesheet" href="style/main.css">
<title>{{ gallery.name }} · Boop</title>
<title>{{ gallery.name }} · {{ site_title }}</title>
</head>
<body>
<h1>{{ gallery.name }}</h1>
<h1><a href="index.html">{{ site_title }}</a></h1>
<h2>{{ gallery.name }}</h2>

{% for photo in gallery.photos %}
<img src="{{ photo.url }}" alt="" />
<p>{{ photo.name }}</p>

+ 3
- 1
Herisson/index.html.j2 Dosyayı Görüntüle

@@ -4,9 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0" />
<link rel="stylesheet" href="style/main.css">
<title>Boop</title>
<title>{{ site_title }}</title>
</head>
<body>
<h1><a href="">{{ site_title }}</a></h1>

{% for gallery in galleries -%}
<div class="gallery">
<a href="{{ gallery.url }}.html">

+ 7
- 3
boop.py Dosyayı Görüntüle

@@ -6,7 +6,7 @@ import re

from jinja2 import Environment, PackageLoader, select_autoescape

from configuration import THEME
from configuration import SITE_TITLE, THEME


PICTURES_DIR_NAME = "photos"
@@ -65,7 +65,9 @@ def generate_index(output_path, galleries):
index_template = jinja_env.get_template("index.html.j2")

with open(index_path, "w") as index_file:
index_file.write(index_template.render(galleries=galleries))
index_file.write(
index_template.render(galleries=galleries, site_title=SITE_TITLE)
)


def generate_gallery(output_path, gallery):
@@ -83,7 +85,9 @@ def generate_gallery_index(output_path, gallery):
gallery_template = jinja_env.get_template("gallery.html.j2")

with open(gallery_index_path, "w") as gallery_file:
gallery_file.write(gallery_template.render(gallery=gallery))
gallery_file.write(
gallery_template.render(gallery=gallery, site_title=SITE_TITLE)
)


def generate_gallery_dir(output_path, gallery):

+ 1
- 0
configuration.py Dosyayı Görüntüle

@@ -1 +1,2 @@
SITE_TITLE = "Balades européennes"
THEME = "Herisson"

Loading…
İptal
Kaydet