update so that urls are nicer
This commit is contained in:
		
							parent
							
								
									7d9ae22f6c
								
							
						
					
					
						commit
						84c4fce3ff
					
				| @ -7,3 +7,7 @@ Okay this has been updated towards being statically generated and served by ngin | ||||
| ic web server you like). I have made a fancy schmancy STATIC SITE GENERATOR in `generate.ignore.py` | ||||
| , which basically just renders jinja templates for appropriate files! it's pretty self-explanatory, | ||||
|  use -h to get help on the args, it's a great time. | ||||
| 
 | ||||
| shooflenet.service is no longer necessary because this is all run through nginx | ||||
| 
 | ||||
| nginx needs to be updated to handle -/_ inconsistencies in file names | ||||
|  | ||||
| @ -28,14 +28,19 @@ for path_to_source in source.glob("**/*"): | ||||
|      | ||||
|     if ".ignore" in str(rel_path):  | ||||
|         continue | ||||
|     if ".git" in str(rel_path): | ||||
|         continue | ||||
| 
 | ||||
|     if path_to_source.is_dir(): | ||||
|         pass | ||||
| 
 | ||||
|     elif ".article.html" in str(path_to_source): | ||||
|         path_to_output = path_to_output.parent / path_to_output.name.replace(".article","") | ||||
|         folder_name = path_to_output.parent / path_to_output.name.replace(".article.html","") | ||||
|         os.makedirs(folder_name, exist_ok=True) # make the folder /var/www/shoofle.net/articles/circle_script | ||||
|          | ||||
|         path_to_output = folder_name / "index.html" | ||||
| 
 | ||||
|         with open(path_to_output, "w") as output_file: | ||||
|             os.makedirs(path_to_output.parent, exist_ok=True) | ||||
|             output_file.write(article_template.render(title="Article", target=str(rel_path))) | ||||
| 
 | ||||
|     elif ".renderme" in str(path_to_source): | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user