change project structure

This commit is contained in:
ge 2022-09-30 01:23:56 +03:00
parent e73b957161
commit da516c96bd
2 changed files with 5 additions and 2 deletions

View File

@ -43,13 +43,14 @@ This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. There is NO WARRANTY, to the extent permitted by law.
""" """
__version__ = '0.1.0' __version__ = '0.1.1'
import os import os
import sys import sys
import shutil import shutil
import datetime import datetime
import logging import logging
import importlib.resources
import toml import toml
import jinja2 import jinja2
@ -350,7 +351,7 @@ def build(config: dict):
write_to_file(html_file_path, html_page) write_to_file(html_file_path, html_page)
# Copy additional files to build_dir # Copy additional files to build_dir
log.info("Copy static files from '{}' and '{}' to '{}'".format( log.info("Copying static files from '{}' and '{}' to '{}'".format(
config['dirs']['static_dir'], config['dirs']['static_dir'],
config['dirs']['content_dir'], config['dirs']['content_dir'],
config['dirs']['build_dir'])) config['dirs']['build_dir']))
@ -377,6 +378,8 @@ def init(dirname: str = '.', no_makefile: bool = False):
# Make Makefile # Make Makefile
if not no_makefile: if not no_makefile:
makefile = render_template('Makefile.jinja2', makefile = render_template('Makefile.jinja2',
templates_dir = os.path.dirname(
importlib.resources.path('rsw', 'Makefile.jinja2')),
content_dir = DEFAULT_CONFIG['dirs']['content_dir'], content_dir = DEFAULT_CONFIG['dirs']['content_dir'],
static_dir = DEFAULT_CONFIG['dirs']['static_dir'], static_dir = DEFAULT_CONFIG['dirs']['static_dir'],
build_dir = DEFAULT_CONFIG['dirs']['build_dir'], build_dir = DEFAULT_CONFIG['dirs']['build_dir'],