git ssb

0+

Grey the earthling / scuttleblog



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.pychanged
scuttleblog.pyView
@@ -85,10 +85,9 @@
8585 return content
8686
8787 def define_post_filename(post):
8888 folder = 'hugo/content/posts'
89- #slug = post['key'].replace('+','-').replace('/','_').replace('=.sha256','')
90- slug = str(post['frontmatter']['sequence'])
89 + slug = str(post['frontmatter']['key'])
9190 filetype = 'md'
9291 return folder + '/' + slug + '.' + filetype
9392
9493 def write_post_file(post):
@@ -118,8 +117,10 @@
118117 def build_hugo_config(m):
119118 hugo_config = {}
120119 hugo_config['baseurl'] = conf.hugo_baseurl
121120 hugo_config['theme'] = conf.hugo_theme
121 + hugo_config['permalinks'] = {}
122 + hugo_config['permalinks']['post'] = '/:filename/'
122123 if 'name' in m['value']['content']:
123124 hugo_config['title'] = m['value']['content']['name']
124125 hugo_config['params'] = {}
125126 if 'description' in m['value']['content']:

Built with git-ssb-web