Commit 280029273cb8a3ad87628f4959116723aeab2681
Only insert user profile data if it exists
Users may not have a name or description.Greg K Nicholson committed on 10/15/2017, 1:16:21 PM
Parent: 87a38977d66c2c45e62e7e26637ac063bd217ee4
Files changed
scuttleblog.py | changed |
scuttleblog.py | ||
---|---|---|
@@ -98,12 +98,14 @@ | ||
98 | 98 … | return user_metadata |
99 | 99 … | |
100 | 100 … | def build_hugo_config(m): |
101 | 101 … | hugo_config = {} |
102 | - hugo_config['title'] = m['value']['content']['name'] | |
102 … | + if 'name' in m['value']['content']: | |
103 … | + hugo_config['title'] = m['value']['content']['name'] | |
103 | 104 … | hugo_config['theme'] = conf.hugo_theme |
104 | 105 … | hugo_config['params'] = {} |
105 | - hugo_config['params']['subtitle'] = m['value']['content']['description'].replace('\n', ' ') | |
106 … | + if 'description' in m['value']['content']: | |
107 … | + hugo_config['params']['subtitle'] = m['value']['content']['description'].replace('\n', ' ') | |
106 | 108 … | return (hugo_config) |
107 | 109 … | |
108 | 110 … | def write_hugo_config_from_user(userid): |
109 | 111 … | metadata = get_user_metadata(userid) |
Built with git-ssb-web