mcmillanmajora commited on
Commit
c98bb79
1 Parent(s): d71f3be

Update app.py

Browse files

Forgot import statement and updated render_page function

Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import re
3
  from pathlib import Path
 
4
 
5
  import yaml
6
 
@@ -21,10 +22,8 @@ def render_preview(image, title, description):
21
 
22
 
23
  def render_page(post_path: Path):
24
- text = post_path.read_text()
25
- match = REGEX_YAML_BLOCK.search(text)
26
- page_content = match.group(2) if match else text
27
- st.markdown(page_content, unsafe_allow_html=True)
28
 
29
 
30
  def get_page_data(post_path: Path):
 
1
  import streamlit as st
2
  import re
3
  from pathlib import Path
4
+ import importlib
5
 
6
  import yaml
7
 
 
22
 
23
 
24
  def render_page(post_path: Path):
25
+ mod = importlib.import_module(str(post_path))
26
+ mod.run_article()
 
 
27
 
28
 
29
  def get_page_data(post_path: Path):