Switch to gunicorn , need to add config file and proper password loading
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user