don't require the host to be in the Image tag

now that we know our base host via config, we can stop hardcoding it in
each Image tag

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
2025-03-18 08:13:18 -05:00
parent abc05ee4e8
commit 6d7987cfae
4 changed files with 16 additions and 3 deletions

View File

@@ -63,3 +63,16 @@ def test_figures_are_rendered():
'<span></span></figure>') in data
assert '<figure><img alt="just a logo" src="bss-square-no-bg.png" /></figure>' in data
os.chdir(HERE)
def test_og_image():
"""Test that the og:image meta tag is present as expected."""
with tempfile.TemporaryDirectory() as tmpdir:
src_dir = os.path.join(HERE, 'instance')
ssg = StaticSiteGenerator(src_dir, tmpdir)
os.chdir(os.path.join(src_dir, 'pages'))
ssg.build_file_in_destination(os.path.join(HERE, 'instance', 'pages'), '', 'more-metadata.md', tmpdir, True)
with open(os.path.join(tmpdir, 'more-metadata.html'), 'r') as graphviz_output:
data = graphviz_output.read()
assert ('<meta property="og:image" content="http://example.org/test.img') in data

View File

@@ -1,6 +1,6 @@
Title: title for the page
Description: description of this page
made even longer
Image: http://buh.com/test.img
Image: /test.img
hello