crieur 1.0.4__tar.gz → 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crieur might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crieur
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: A Static Revue Generator.
5
5
  Project-URL: Homepage, https://gitlab.huma-num.fr/ecrinum/crieur
6
6
  Project-URL: Issues, https://gitlab.huma-num.fr/ecrinum/crieur/-/issues
@@ -1,4 +1,4 @@
1
1
  from pathlib import Path
2
2
 
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  ROOT_DIR = Path(__file__).parent
@@ -20,19 +20,21 @@ class Numero(YAMLWizard):
20
20
 
21
21
  loaded_articles = []
22
22
  for article in self.articles:
23
+ article_slug = slugify(article["article"]["title"])
23
24
  article_folder = (
24
- yaml_path.parent
25
- / f"{article['article']['title']}-{article['article']['_id']}"
25
+ yaml_path.parent / f"{article_slug}-{article['article']['_id']}"
26
26
  )
27
- article_yaml_path = article_folder / f"{article['article']['title']}.yaml"
27
+ article_yaml_path = article_folder / f"{article_slug}.yaml"
28
28
  try:
29
29
  loaded_article = Article.from_yaml_file(article_yaml_path)
30
30
  except ComposerError:
31
31
  loaded_article = Article.from_yaml(
32
32
  article_yaml_path.read_text().split("---")[1]
33
33
  )
34
+ if not loaded_article.id:
35
+ loaded_article.id = article_slug
34
36
  loaded_article.content_md = (
35
- article_folder / f"{article['article']['title']}.md"
37
+ article_folder / f"{article_slug}.md"
36
38
  ).read_text()
37
39
  loaded_article.images_path = (
38
40
  article_folder / "images"
@@ -46,10 +48,10 @@ class Numero(YAMLWizard):
46
48
 
47
49
  @dataclass
48
50
  class Article(YAMLWizard):
49
- id: str
50
51
  title: str
51
52
  title_f: str
52
53
  date: Optional[DatePattern["%Y/%m/%d"]] # noqa: F722
54
+ id: str = ""
53
55
  subtitle: str = ""
54
56
  subtitle_f: str = ""
55
57
  content_md: str = ""
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes