Skip to content

Commit

Permalink
Rename JFME_DEFAULT_METADATA_PATH to JFME_DEFAULT_METADATA_FILEPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Jul 24, 2024
1 parent 8e01bea commit ad96389
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Otherwise, you have to configure the following settings :
- `JFME_CONTENT_DIRS` : a list of directories where to look for the site content

Other useful settings :
- Default metadata : `JFME_DEFAULT_METADATA_DICT` and `JFME_DEFAULT_METADATA_PATH` allow to set default metadata for pages and posts. The first one is a python dictionary and the second one is a Path to a file having the same format as metadata section in pages.
The order, from less to most priority is : `JFME_DEFAULT_METADATA_DICT` then `JFME_DEFAULT_METADATA_PATH` then page matadata.
- Default metadata : `JFME_DEFAULT_METADATA_DICT` and `JFME_DEFAULT_METADATA_FILEPATH` allow to set default metadata for pages and posts. The first one is a python dictionary and the second one is a Path to a file having the same format as metadata section in pages.
The order, from less to most priority is : `JFME_DEFAULT_METADATA_DICT` then `JFME_DEFAULT_METADATA_FILEPATH` then page matadata.

### `Dockerfile` :
- In the `# Copy source dir` section, add `COPY <content-dir>/ <content-dir>/` for each content directory in `JFME_CONTENT_DIRS`
Expand Down
2 changes: 1 addition & 1 deletion jssg/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def load(cls, path: Path) -> "Document":
json_data = ""
content = StringIO()

with settings.JFME_DEFAULT_METADATA_PATH.open() as f:
with settings.JFME_DEFAULT_METADATA_FILEPATH.open() as f:
for line in f :
try :
# Parse a metadata key value pair
Expand Down
4 changes: 2 additions & 2 deletions jssg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
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_PATH then page metadata
JFME_DEFAULT_METADATA_PATH = BASE_DIR / "jssg" / "default_metadata.txt" # If a metadata is specified more than once, the last included is retained
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


# Application definition
Expand Down

0 comments on commit ad96389

Please sign in to comment.