Skip to content

Commit

Permalink
minor README fix about rename from jssg to jfmengine
Browse files Browse the repository at this point in the history
  • Loading branch information
lebouquetin committed Oct 10, 2024
1 parent 8a7dbb1 commit f44e426
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions jssg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

from django.core.management.commands.runserver import Command as runserver
# from django.core.management.commands.runserver import Command as runserver

from os import environ
from pathlib import Path
Expand All @@ -40,24 +40,39 @@

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = environ.get("DJANGO_DEBUG", "false") == "true"

ALLOWED_HOSTS = ["example.org", "localhost"]
DEBUG = False
if environ.get("DJANGO_DEBUG"):
DEBUG = True
ALLOWED_HOSTS = ["exemple.org", "localhost"]
# runserver.default_port = '8000'
# runserver.default_addr = '127.0.0.1'

# JSSG
JFME_DOMAIN = "www.exemple.com"
JFME_CONTENT_DIRS = [BASE_DIR / "example-content"] + [BASE_DIR / "content"]
if environ.get("WEBSITE_DIR") ==None :
raise Exception("Please define WEBSITE_DIR env var. See Readme of algoo/websites repo")
website_dir = Path(environ.get("WEBSITE_DIR")).resolve()
if website_dir.stem == "algoo":
JFME_DOMAIN = "www.algoo.fr"
JFME_CONTENT_DIRS = [website_dir] + [BASE_DIR / "../websites/common-content"] # + [BASE_DIR / "content"]
JFME_INDEX_PAGE = "fr/accueil"
JFME_ADDITIONAL_JINJA2_FILTERS = {"base64encode": "jssg.templatetags.filter_base_64.base64encode"}
elif website_dir.stem == "galae":
JFME_DOMAIN = "www.galae.net"
JFME_CONTENT_DIRS = [website_dir] + [BASE_DIR / "../websites/common-content"] + [BASE_DIR / "content"]
JFME_INDEX_PAGE = "fr/index"
JFME_ADDITIONAL_JINJA2_FILTERS = {}


JFME_PAGES_DIRS = [path / "pages" for path in JFME_CONTENT_DIRS]
JFME_POSTS_DIRS = [path / "posts" for path in JFME_CONTENT_DIRS]
JFME_TEMPLATES_DIRS = [path / "templates" for path in JFME_CONTENT_DIRS]
JFME_STATIC_DIRS = [path / "static" for path in JFME_CONTENT_DIRS]
JFME_DEFAULT_METADATA_DICT = {"slug": "index", } # The order of include is : JFME_DEFAULT_METADATA_DICT then JFME_DEFAULT_METADATA_FILEPATH then page metadata
JFME_DEFAULT_METADATA_FILEPATH = BASE_DIR / "jssg" / "default_metadata.txt" # If a metadata is specified more than once, the last included is retained
JFME_NUMBER_OF_POSTS_BY_PAGE = 3 # no pagination of posts if set to 0 or -1
JFME_DEFAULT_METADATA_DICT = {}
JFME_DEFAULT_METADATA_FILEPATH = BASE_DIR / "jssg" / "default_metadata.txt"
JFME_NUMBER_OF_POSTS_BY_PAGE = -1
JFME_CONTENT_REQUIRED_METADATA = ["title", "slug", "lang", "description"]
JFME_SITEMAP_LASTMOD_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z" # strftime format, see https://docs.python.org/fr/3.6/library/datetime.html#strftime-and-strptime-behavior, see https://www.sitemaps.org/protocol.html#lastmoddef for allowed datetime formats
JFME_INDEX_PAGE = "en/home"
JFME_SITEMAP_LASTMOD_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
JFME_ADDITIONAL_JINJA2_FUNCTIONS = {}
JFME_ADDITIONAL_JINJA2_FILTERS = {}

#Django sites and sitemap app
SITE_ID = 1
Expand Down Expand Up @@ -168,3 +183,7 @@
DJANGO_VITE_PLUGIN = {
"MANIFEST": VITE_MANIFEST_FILE,
}

# import re
# from django.template import base
# base.tag_re = re.compile(base.tag_re.pattern, re.DOTALL)

0 comments on commit f44e426

Please sign in to comment.