remove the broken/deprecated redirect tag support
when this project *wasn't* a SSG, it could serve up redirects, which is something that was only rarely needed, and looking now, I don't do it at all on any of my current sites, so I'm just going to remove the tiny bit of code for it that remained in the SSG project Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
@@ -135,11 +135,6 @@ def handle_markdown_file_path(path: str, pages_root: str) -> str:
|
||||
extra_footer = get_meta_str(md, 'footer') if md.Meta.get('footer') else None
|
||||
template_name = get_meta_str(md, 'template') if md.Meta.get('template') else 'base.html'
|
||||
|
||||
# check if this has a HTTP redirect
|
||||
redirect_url = get_meta_str(md, 'redirect') if md.Meta.get('redirect') else None
|
||||
if redirect_url:
|
||||
raise NotImplementedError("redirects in markdown are unsupported!")
|
||||
|
||||
template = jinja_env.get_template(template_name)
|
||||
return template.render(title=page_title,
|
||||
config=Config,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Redirect: http://www.google.com/
|
||||
@@ -103,12 +103,6 @@ def test_render_with_default_style_override():
|
||||
in handle_markdown_file_path('index.md', PAGES_DIR)
|
||||
|
||||
|
||||
def test_redirects_error_unsupported():
|
||||
"""Test that we throw a warning about the barely-used Markdown redirect tag, which we can't support via SSG."""
|
||||
with pytest.raises(NotImplementedError):
|
||||
handle_markdown_file_path('redirect.md', os.path.join(INSTANCE_DIR, 'broken'))
|
||||
|
||||
|
||||
def test_instance_resource_path_to_request_path_on_index():
|
||||
"""Test index.md -> /."""
|
||||
assert instance_resource_path_to_request_path('index.md') == '/'
|
||||
|
||||
Reference in New Issue
Block a user