We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d4a980 commit e617a82Copy full SHA for e617a82
scripts/create_build_adoc.py
@@ -71,6 +71,12 @@ def check_no_markdown(filename):
71
m = re.match(r'^(include::)(.+)(\[\]\n?)$', line)
72
if m:
73
line = m.group(1) + os.path.join('{includedir}/{parentdir}', m.group(2)) + m.group(3)
74
+ # find all image references, append md5 hash at end to bust the cache if we change the image
75
+ m = re.match(r'^(image::)(.+)(\[(.+)]\n?)$', line)
76
+ if m:
77
+ directory = os.path.dirname(os.path.abspath(src_adoc))
78
+ image_hash = hashlib.md5(open(os.path.join(directory, m.group(2)),'rb').read()).hexdigest()
79
+ line = m.group(1) + m.group(2) + '?hash=' + image_hash + m.group(3) + "\n"
80
new_contents += line
81
82
with open(build_adoc, 'w') as out_fh:
0 commit comments