Replace image pipeline with profile-driven variants
- add image normalization profiles and thumbnail profiles - generate source, full-size variant, and thumbnail image artifacts - rewrite canonical image URLs through the first configured profile - emit explicit image Media RSS groups with named thumbnails - preserve legacy image paths when image conversion is disabled - cover cache-hit source paths, inline image handling, and thumbnail export
This commit is contained in:
parent
7316d4723f
commit
525393272e
13 changed files with 1299 additions and 124 deletions
|
|
@ -188,21 +188,31 @@ def build_feed_settings(
|
|||
video_dir = base_settings.get("REPUBLISHER_VIDEO_DIR", VIDEO_DIR)
|
||||
audio_dir = base_settings.get("REPUBLISHER_AUDIO_DIR", AUDIO_DIR)
|
||||
file_dir = base_settings.get("REPUBLISHER_FILE_DIR", FILE_DIR)
|
||||
image_normalize_enabled = convert_images and base_settings.getbool(
|
||||
"REPUBLISHER_IMAGE_NORMALIZE_ENABLED", True
|
||||
)
|
||||
image_thumbnails_enabled = image_normalize_enabled and base_settings.getbool(
|
||||
"REPUBLISHER_IMAGE_THUMBNAILS_ENABLED", True
|
||||
)
|
||||
item_pipelines = dict(base_settings.getdict("ITEM_PIPELINES"))
|
||||
item_pipelines.pop("repub.pipelines.ImagePipeline", None)
|
||||
item_pipelines.pop("repub.pipelines.ImageNormalizePipeline", None)
|
||||
item_pipelines.pop("repub.pipelines.ImageThumbnailPipeline", None)
|
||||
item_pipelines.pop("repub.pipelines.AudioPipeline", None)
|
||||
item_pipelines.pop("repub.pipelines.VideoPipeline", None)
|
||||
item_pipelines.pop("repub.pipelines.FilePipeline", None)
|
||||
item_pipelines.update(
|
||||
{
|
||||
"repub.pipelines.AudioPipeline": 2,
|
||||
"repub.pipelines.FilePipeline": 4,
|
||||
"repub.pipelines.AudioPipeline": 3,
|
||||
"repub.pipelines.FilePipeline": 5,
|
||||
}
|
||||
)
|
||||
if convert_images:
|
||||
item_pipelines["repub.pipelines.ImagePipeline"] = 1
|
||||
if image_normalize_enabled:
|
||||
item_pipelines["repub.pipelines.ImageNormalizePipeline"] = 1
|
||||
if image_thumbnails_enabled:
|
||||
item_pipelines["repub.pipelines.ImageThumbnailPipeline"] = 2
|
||||
if convert_video:
|
||||
item_pipelines["repub.pipelines.VideoPipeline"] = 3
|
||||
item_pipelines["repub.pipelines.VideoPipeline"] = 4
|
||||
settings = base_settings.copy()
|
||||
settings.setdict(
|
||||
{
|
||||
|
|
@ -219,6 +229,8 @@ def build_feed_settings(
|
|||
"LOG_FILE": str(out_dir / "logs" / f"{feed_slug}.log"),
|
||||
"HTTPCACHE_DIR": str(out_dir / "httpcache"),
|
||||
"REPUBLISHER_IMAGE_DIR": image_dir,
|
||||
"REPUBLISHER_IMAGE_NORMALIZE_ENABLED": image_normalize_enabled,
|
||||
"REPUBLISHER_IMAGE_THUMBNAILS_ENABLED": image_thumbnails_enabled,
|
||||
"REPUBLISHER_VIDEO_DIR": video_dir,
|
||||
"REPUBLISHER_AUDIO_DIR": audio_dir,
|
||||
"REPUBLISHER_FILE_DIR": file_dir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue