Commit 8b2cfc6a3971d343006e0db90b5eab327c4d9692
Remove unmanaged hugo config files at runtime
Not at install time.Greg K Nicholson committed on 10/15/2017, 5:04:28 PM
Parent: 3e4cd5cd53d0b8d6f4964b7960386bb0b6763182
Files changed
install.sh | changed |
scuttleblog.py | changed |
install.sh | ||
---|---|---|
@@ -4,5 +4,4 @@ | ||
4 | 4 … | sbot invite.accept 'pub.hacky.af:30434:@VqbBx7dr72FQwO5ztq4FULpareSMFSwegY1Ruh7XpjA=.ed25519~fvs5DS7+n+WL0TjLCIZNBLgkLrI7JR8oP6zo0lp/+tc=' |
5 | 5 … | hugo new site hugo |
6 | 6 … | cd hugo |
7 | 7 … | git submodule add -f https://github.com/budparr/gohugo-theme-ananke.git themes/ananke |
8 | -rm config.toml |
scuttleblog.py | ||
---|---|---|
@@ -29,8 +29,10 @@ | ||
29 | 29 … | import subprocess |
30 | 30 … | |
31 | 31 … | import conf |
32 | 32 … | |
33 … | +scuttleblog_dir = os.path.dirname(__file__) | |
34 … | + | |
33 | 35 … | def run_sbot(): |
34 | 36 … | for attempt in range(100): |
35 | 37 … | try: |
36 | 38 … | subprocess.check_output(['sbot', 'status']) |
@@ -121,8 +123,11 @@ | ||
121 | 123 … | return (hugo_config) |
122 | 124 … | |
123 | 125 … | def write_hugo_config_from_user(ssb_userid): |
124 | 126 … | metadata = get_user_metadata(ssb_userid) |
127 … | + for file in ['hugo/config.toml', 'hugo/config.yaml']: | |
128 … | + if os.path.exists(file): | |
129 … | + os.remove(file) | |
125 | 130 … | with open('hugo/config.json', 'w') as f: |
126 | 131 … | f.write (json.dumps(build_hugo_config(metadata), indent = 4)) |
127 | 132 … | # TODO: add the user's image in the right place |
128 | 133 … |
Built with git-ssb-web