Commit dbab1e1078ab24827b5f426a8184797e1ae7dccf
WIP: try to use hashes as post URLs
Still need to make links in content relative to the site's root, rather than relative to the current page, because some hashes include slashes. Alternatively, could substitute slashes with another character; would have to do the same substitution in links in content. Ideally, I'd prefer not to alter post content if it's avoidable.Greg K Nicholson committed on 10/15/2017, 9:35:39 PM
Parent: 3e4995ca4388b536ae7820c7655650720bb45e8c
Files changed
scuttleblog.py | changed |
scuttleblog.py | |||
---|---|---|---|
@@ -85,10 +85,9 @@ | |||
85 | 85 … | return content | |
86 | 86 … | ||
87 | 87 … | def define_post_filename(post): | |
88 | 88 … | folder = 'hugo/content/posts' | |
89 | - #slug = post['key'].replace('+','-').replace('/','_').replace('=.sha256','') | ||
90 | - slug = str(post['frontmatter']['sequence']) | ||
89 … | + slug = str(post['frontmatter']['key']) | ||
91 | 90 … | filetype = 'md' | |
92 | 91 … | return folder + '/' + slug + '.' + filetype | |
93 | 92 … | ||
94 | 93 … | def write_post_file(post): | |
@@ -118,8 +117,10 @@ | |||
118 | 117 … | def build_hugo_config(m): | |
119 | 118 … | hugo_config = {} | |
120 | 119 … | hugo_config['baseurl'] = conf.hugo_baseurl | |
121 | 120 … | hugo_config['theme'] = conf.hugo_theme | |
121 … | + hugo_config['permalinks'] = {} | ||
122 … | + hugo_config['permalinks']['post'] = '/:filename/' | ||
122 | 123 … | if 'name' in m['value']['content']: | |
123 | 124 … | hugo_config['title'] = m['value']['content']['name'] | |
124 | 125 … | hugo_config['params'] = {} | |
125 | 126 … | if 'description' in m['value']['content']: |
Built with git-ssb-web