mcmillanmajora commited on
Commit
d71f3be
1 Parent(s): 5d1a161

Changed posts from md files to py files

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -28,24 +28,24 @@ def render_page(post_path: Path):
28
 
29
 
30
  def get_page_data(post_path: Path):
31
- text = post_path.read_text()
32
- match = REGEX_YAML_BLOCK.search(text)
33
- if match:
34
- data = match.group(1)
35
- data = yaml.load(data, Loader=yaml.FullLoader)
36
- return data
37
- return {}
38
 
39
 
40
  def main():
41
  st.set_page_config(layout="wide")
42
- posts = ['posts/welcome.md',
43
- 'posts/context.md',
44
- 'posts/dataset_exploration.md',
45
- 'posts/model_exploration.md',
46
- 'posts/conclusion.md'
47
  ]
48
- page_to_show = 'posts/welcome.md'
49
  with st.sidebar:
50
 
51
  st.markdown('''
 
28
 
29
 
30
  def get_page_data(post_path: Path):
31
+ mod = importlib.import_module(str(post_path))
32
+ return {
33
+ "title": mod.title,
34
+ "description": mod.description,
35
+ "date": mod.date,
36
+ "thumbnail": mod.thumbnail,
37
+ }
38
 
39
 
40
  def main():
41
  st.set_page_config(layout="wide")
42
+ posts = ['posts.welcome',
43
+ 'posts.context',
44
+ 'posts.dataset_exploration',
45
+ 'posts.model_exploration',
46
+ 'posts.conclusion'
47
  ]
48
+ page_to_show = posts[0]
49
  with st.sidebar:
50
 
51
  st.markdown('''