Switch to gunicorn , need to add config file and proper password loading
All checks were successful
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 16s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 28s

This commit is contained in:
2025-02-28 23:23:16 -05:00
parent c5caa0848b
commit 4d79f86df4
7 changed files with 429 additions and 28 deletions

View File

@ -1,10 +1,9 @@
from dataclasses import dataclass
from src.config.config import Configuration
from src.rendering import GENERIC_FILE_MAPPING
from src.rendering.markdown import render_markdown
from src.rendering.markdown import render_markdown, read_raw_markdown, rendered_markdown_to_plain_text
from enum import Enum
from thumbhash import image_to_thumbhash
from PIL import Image
from datetime import datetime
import frontmatter
@ -78,9 +77,9 @@ class TemplateHelpers:
ret.typeMeta = MarkdownMetadata({}, "", "")
ret.typeMeta.fontmatter = frontmatter.load(file_path)
ret.typeMeta.content = render_markdown(file_path)
ret.typeMeta.preview = ret.typeMeta.content[:100]
if "#" in ret.typeMeta.preview:
ret.typeMeta.preview = ret.typeMeta.preview.split("#")[0]
ret.typeMeta.rawContent = read_raw_markdown(file_path)
ret.typeMeta.rawText = rendered_markdown_to_plain_text(ret.typeMeta.content)
ret.typeMeta.preview = ret.typeMeta.rawText[:500] + "..."
return ret
return None