Skip to content

Commit

Permalink
Merge pull request #240 from beawitcht/development
Browse files Browse the repository at this point in the history
add shop banner to bottom of blogs
  • Loading branch information
beawitcht authored Sep 14, 2023
2 parents 4b79a42 + 350d61b commit 4f6bf66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Binary file added app/static/images/product.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions app/templates/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
{% endblock %}

{% block body %}
<div class="alert alert-info" role="alert">
If you found this blog useful please <a href="https://opencollective.com/beawitching/donate/" class="alert-link" target="_blank" >consider donating</a> so that we can maintain this service.
</div>
<a href="/"><img class="mx-auto d-block pt-3" src="/static/images/combinedlogo.png" alt="Beawitching Communities logo and link to home" width="330" height="130" ></a>
<header class="d-flex justify-content-center py-3">
<ul class="d-flex justify-content-center nav nav-pills">
Expand All @@ -29,6 +26,8 @@
<div class="blog-content">
<h1 class="text-center">{{blog.title}}</h1>
{{blog.content[0].value| stylish| safe}}
<hr>
<a href="https://ko-fi.com/beawitching_cic/shop" target="_blank"><img class="img-fluid rounded mx-auto d-block" src="/static/images/product.png" alt="Support us, Ethically sourced snake shed jewellery and more! All handmade by trans people. Click Here."> </a>
</div>
</div>
{% endblock %}
8 changes: 8 additions & 0 deletions app/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ def prepare_blogs(url):
tags += term['term'] + ','
item.tags = tags[:-1]

# format content
# remove tracking pixels from RSS
tracking_pixel = re.compile(r'<img[^>]*height="1"[^>]*>')
match = tracking_pixel.search(item.content[0].value)
while match:
item.content[0].value = item.content[0].value.replace(match.group(), '')
match = tracking_pixel.search(item.content[0].value)

return entries

0 comments on commit 4f6bf66

Please sign in to comment.