Skip to content

Commit

Permalink
api/img_reduntant_removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg committed Nov 21, 2024
1 parent 813e539 commit 4779969
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions sefaria/image_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ def make_img_http_response(text, category, ref_str, lang, platform):
# subprocess.run(["/home/lungsang/Project/Pecha.org/env/bin/python3", "sefaria/pecha_text_image.py", "output.png"], env=env)

# for production
# Dynamically resolve the Python path
python_path = os.path.join(env.get("VIRTUAL_ENV", "/env"), "bin", "python3")

# Run the script
subprocess.run([python_path, "sefaria/pecha_text_image.py", "output.png"], env=env)
subprocess.run(["/env/bin/python3", "sefaria/pecha_text_image.py", "output.png"], env=env)


img = Image.open("output.png")
Expand Down
8 changes: 4 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
{% endblock %}

{% block ogimage %}
<meta property="og:title" content="Tashi Delek" />
<meta property="og:description" content="{% block fb_description %}{{ desc|striptags }}{% endblock %}"/>
<meta property="og:image" content="og:image" content="https://{{ request.get_host }}/api/img-gen{{ request.path }}?lang={{request.GET.lang}}&platform=facebook&ven={{request.GET.ven}}&vhe={{request.GET.vhe}}" />
<meta property="og:title" content="Pecha - A Living Library of Buddhist Text" />
<meta property="og:description" content="The largest free library of Buddhist texts available to read online in Tibetan, English, and Chinese including Sutras, Tantras, Abhidharma, Vinaya, commentaries and more."/>
<meta property="og:image" content="https://{{ request.get_host }}{{ request.path }}?lang={{ request.GET.lang }}&platform=facebook&ven={{ request.GET.ven| }}&vhe={{ request.GET.vhe }}" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<!-- Debugging: Display the og:image URL -->
<p>Debug: og:image = https://{{ request.get_host }}/api/img-gen{{ request.path }}?lang={{ request.GET.lang|default:'he' }}&platform=facebook&ven={{ request.GET.ven|default:'' }}&vhe={{ request.GET.vhe|default:'' }}</p>
<p>Debug: og:image = https://{{ request.get_host }}{{ request.path }}?lang={{ request.GET.lang|default:'he' }}&platform=facebook&ven={{ request.GET.ven|default:'' }}&vhe={{ request.GET.vhe|default:'' }}</p>
{% endblock %}


Expand Down

0 comments on commit 4779969

Please sign in to comment.