1
0
mirror of https://gitlab.com/MisterBiggs/blog-static.git synced 2025-09-19 12:12:48 +00:00

added buy me a coffee link to all pages

This commit is contained in:
2020-05-21 00:59:32 -07:00
parent 5f8007d791
commit 48b90fc4e9
25 changed files with 10715 additions and 0 deletions

20
coffee.py Normal file
View File

@@ -0,0 +1,20 @@
import os
import glob
widget = """
<script data-name="BMC-Widget" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" data-id="Anson" data-description="Support my work on Buy me a coffee!" data-message="Please consider donating if you enjoy my content!" data-color="#5F7FFF" data-position="right" data-x_margin="18" data-y_margin="18"></script>
</head>
"""
# Add widget to all posts
for filename in glob.glob("*/index.html", recursive=True):
print(filename)
with open(filename, "r+", encoding="utf-8") as f:
f.writelines(f.read().replace("</head>", widget))
# print(f.read())
# Add widget to home page
with open("index.html", "r+", encoding="utf-8") as f:
f.writelines(f.read().replace("</head>", widget))
#