diff options
author | James Addison <55152140+jayaddison@users.noreply.github.com> | 2023-04-07 18:07:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 18:07:15 +0100 |
commit | 5d13215b58f93c6be8255ef2e3e20836508c7d47 (patch) | |
tree | b4931c69671bccf91184eec381d0e5c54f44cfe9 /sphinx/cmd/quickstart.py | |
parent | f82c3c99126e644125d243ba0d0788197401e416 (diff) | |
download | sphinx-git-5d13215b58f93c6be8255ef2e3e20836508c7d47.tar.gz |
Support and prefer ``.jinja`` to ``_t`` for static templates (#11165)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Diffstat (limited to 'sphinx/cmd/quickstart.py')
-rw-r--r-- | sphinx/cmd/quickstart.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 6122ddd98..580fa7d6d 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -370,29 +370,29 @@ def generate( if 'quiet' not in d: print(__('File %s already exists, skipping.') % fpath) - conf_path = os.path.join(templatedir, 'conf.py_t') if templatedir else None + conf_path = os.path.join(templatedir, 'conf.py.jinja') if templatedir else None if not conf_path or not path.isfile(conf_path): - conf_path = os.path.join(package_dir, 'templates', 'quickstart', 'conf.py_t') + conf_path = os.path.join(package_dir, 'templates', 'quickstart', 'conf.py.jinja') with open(conf_path, encoding="utf-8") as f: conf_text = f.read() write_file(path.join(srcdir, 'conf.py'), template.render_string(conf_text, d)) masterfile = path.join(srcdir, d['master'] + d['suffix']) - if template._has_custom_template('quickstart/master_doc.rst_t'): + if template._has_custom_template('quickstart/master_doc.rst.jinja'): msg = ('A custom template `master_doc.rst_t` found. It has been renamed to ' '`root_doc.rst_t`. Please rename it on your project too.') print(colorize('red', msg)) - write_file(masterfile, template.render('quickstart/master_doc.rst_t', d)) + write_file(masterfile, template.render('quickstart/master_doc.rst.jinja', d)) else: - write_file(masterfile, template.render('quickstart/root_doc.rst_t', d)) + write_file(masterfile, template.render('quickstart/root_doc.rst.jinja', d)) if d.get('make_mode') is True: - makefile_template = 'quickstart/Makefile.new_t' - batchfile_template = 'quickstart/make.bat.new_t' + makefile_template = 'quickstart/Makefile.new.jinja' + batchfile_template = 'quickstart/make.bat.new.jinja' else: - makefile_template = 'quickstart/Makefile_t' - batchfile_template = 'quickstart/make.bat_t' + makefile_template = 'quickstart/Makefile.jinja' + batchfile_template = 'quickstart/make.bat.jinja' if d['makefile'] is True: d['rsrcdir'] = 'source' if d['sep'] else '.' |