Commit graph

53 commits

Author SHA1 Message Date
Yax
3b7484fbe6 Replace JSON config with .env files
- Add python-dotenv dependency for environment variable loading
- Replace params.json and params-local.json with .env files
- Add --local and --local-stacosys flags to makesite.py
- Update Makefile to auto-detect stacosys availability
- Document configuration and usage in README.md
2026-01-10 16:03:53 +01:00
Yax
3297ce5e67 Improve slugify function, add tests, and enhance Makefile
Applied improvements from feature-code-quality branch:
- Refactored slugify() for better readability with inline comments
- Renamed log() parameter *args to *log_args (avoid shadowing built-in)
- Added comprehensive unit tests for slugify function
- Enhanced Makefile with typecheck and test targets
- Updated build target to run type checks and tests before Docker build

All tests pass and type checking succeeds.
2026-01-07 14:12:12 +01:00
Yax
13d3d653de Make internal helper functions private
Added underscore prefix to functions used only internally:
- _strip_tags_and_truncate (used only in parse_post_file)
- _parse_headers (used only in parse_post_file)
- _rfc_2822_format (used only in parse_post_file)
- _make_links_absolute (used only in parse_post_file)
- _strip_html_tags (used only in parse_post_file)
- _get_friendly_date (used only in _setup_page_params)
- _exit_program (used only in monitor.py main loop)

This improves encapsulation by clearly marking implementation details.
2026-01-07 13:42:43 +01:00
Yax
424ea20bcf Refactor function names for clarity and accuracy
Renamed functions to better reflect their actual behavior:
- truncate → strip_tags_and_truncate (does both operations)
- fix_relative_links → make_links_absolute (converts, not fixes)
- clean_html_tag → strip_html_tags (more explicit)
- clean_site → rebuild_site_directory (removes and recreates)
- read_headers → parse_headers (parses, not just reads)
- read_content → parse_post_file (full processing pipeline)
- get_nb_of_comments → get_comment_count (removes French abbreviation)
2026-01-07 13:42:43 +01:00
Yax
f5df515d2b Add comprehensive docstrings to all functions
Added Google-style docstrings to all functions and classes in makesite.py and monitor.py with descriptions, argument types, and return values.
2026-01-07 13:42:43 +01:00
Yax
9853ed4327 Refactor make_posts() 2026-01-06 21:06:47 +01:00
Yax
5993ec498c Add TODO to externalize config some day... 2025-09-28 11:47:18 +02:00
Yax
65bf5524a2 Refactoring: split big main function 2025-09-27 16:05:25 +02:00
Yax
9a7312c585 CQ 2025-09-24 18:51:49 +02:00
Yax
e961eeb5eb Fix regexp. use raw-strings 2025-09-24 18:35:47 +02:00
Yax
89176d7eab Fix relative URL in HREF 2025-09-24 13:11:29 +02:00
Yax
3911e59d93 Fix RSS format 2025-09-24 13:05:03 +02:00
Yax
a6136abba7 Format french dates without OS locales 2025-06-21 17:05:01 +02:00
Yax
fccf551e60 Force french locale to render dates 2025-06-21 16:39:29 +02:00
Yax
8c15dadbb1 Rye migration. Mistune upgrade 2023-11-19 16:26:42 +01:00
Yax
d85b70f63f lite CSS: use system fonts 2023-08-01 22:31:40 +02:00
Yax
c82cdf719a create index.xml 2023-03-29 19:04:18 +02:00
Yax
ae83dbaf80 make compliant with mistune update 2022-07-30 17:16:35 +02:00
Yax
a0846b387a add notes 2022-07-19 19:02:25 +02:00
Yax
5b7b4c4617 use poetry dependencies 2022-02-19 12:29:55 +01:00
Yax
0c16e578e5 dependency diff. Try to fix mistune 2022-02-19 12:22:26 +01:00
Yax
40d1c7a867 configure local testing 2021-12-12 04:21:51 +01:00
Yax
27ed99e06e remove token 2021-07-31 13:51:34 +02:00
Yax
1f030c6ff1 add trailing slash to relative links 2021-02-02 19:01:32 +01:00
Yax
f8a10d9b70 page comment option 2019-09-01 14:38:47 +02:00
Yax
6469c911cd comment site 2019-08-31 18:09:15 +02:00
Yax
7fa100db51 comment 2019-08-31 17:17:12 +02:00
Yax
6852d8774b RSS tags 2019-08-30 13:15:00 +02:00
Yax
baabb81958 fix summary 2019-08-28 13:11:04 +02:00
Yax
7c56fb8381 clean code 2019-08-27 12:54:33 +02:00
Yax
6d02bd6c92 highlight 2019-08-27 12:51:22 +02:00
Yax
0e1c2f0199 clean html 2019-08-26 23:41:38 +02:00
Yax
abc2bb243c markdown with mistune 2019-08-26 23:18:55 +02:00
Yax
184b04a857 comment 2019-08-25 18:35:42 +02:00
Yax
d9a5a5bc00 stacosys 2019-08-25 16:34:47 +02:00
Yax
0ee840ac81 knacss 2019-08-25 13:41:08 +02:00
Yax
64ce3132a6 paging 2019-08-25 11:29:46 +02:00
Yax
24f3390ba4 page 2019-08-24 19:16:47 +02:00
Yax
9b0fb75043 RSS 2019-08-24 09:39:49 +02:00
Yax
d18e556f2d sitemap 2019-08-23 20:42:26 +02:00
Yax
f8ddfb09e2 rss feed 2019-08-23 13:24:19 +02:00
Yax
05d4d2891e cat 2019-08-21 19:29:21 +02:00
Yax
c82ac0397d meta 2019-08-21 18:50:07 +02:00
Yax
445a797c9a cat 2019-08-20 20:32:38 +02:00
Yax
0bcf5cdce7 draft category 2019-08-20 13:18:30 +02:00
Yax
b767174f17 banner 2019-08-20 12:56:18 +02:00
Yax
d269fe2612 python3 2019-08-19 13:42:09 +02:00
Yax
e3bcc4e49b style 2019-08-18 19:36:51 +02:00
Yax
2ffeb6be03 style 2019-08-18 18:11:11 +02:00
Yax
9d58aec4b2 style 2019-08-18 15:19:28 +02:00