Skip to content

Commit

Permalink
revert_last_10_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg committed Jul 16, 2024
1 parent 7af37b2 commit 702684b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 144 deletions.
23 changes: 1 addition & 22 deletions reader/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from rest_framework.permissions import IsAuthenticated
from django.template.loader import render_to_string
from django.shortcuts import render, redirect
from django.http import Http404, QueryDict, HttpResponse
from django.http import Http404, QueryDict
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.encoding import iri_to_uri
Expand Down Expand Up @@ -120,27 +120,6 @@
server_coordinator.connect()
# # #

def sitemap(request):
# Define the path to the sitemap.xml file
filepath = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'sitemap.xml')
try:
with open(filepath, 'r') as f:
sitemap_content = f.read()
return HttpResponse(sitemap_content, content_type='application/xml')
except FileNotFoundError:
return HttpResponse("Sitemap not found", status=404, content_type='text/plain')


def robot(request):
# Define the path to the robots.txt file
filepath = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'robots.txt')
try:
with open(filepath, 'r') as f:
robots_content = f.read()
return HttpResponse(robots_content, content_type='text/plain')
except FileNotFoundError:
return HttpResponse("robots.txt not found", status=404, content_type='text/plain')


def render_template(request, template_name='base.html', app_props=None, template_context=None, content_type=None, status=None, using=None):
"""
Expand Down
18 changes: 0 additions & 18 deletions robots.txt

This file was deleted.

2 changes: 0 additions & 2 deletions sefaria/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

# App Pages
urlpatterns = [
url(r'^robots.txt$', reader_views.robot, name='robots_txt'),
url(r'^sitemap\.xml$', reader_views.sitemap, name='sitemap'),
url(r'^$', reader_views.home, name="home"),
url(r'^texts/?$', reader_views.texts_list, name="table_of_contents"),
url(r'^texts/saved/?$', reader_views.saved),
Expand Down
82 changes: 0 additions & 82 deletions sitemap.xml

This file was deleted.

32 changes: 12 additions & 20 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,18 @@
<head>
<title>{% block title %}{{ title|striptags }}{% endblock %}</title>
<meta charset="utf-8"/>
<meta name="title" content="Pecha - A Living Library of Buddhist Text">
<meta name="description" content="{% block description %}{{ desc|striptags }}{% endblock %}"/>
<!-- Additional SEO Tags -->
<meta name="keywords" content="Tibetan Buddhism, Buddhist texts, Buddhist wisdom, Pecha, Tibetan teachings, ཀུན་དུ་བཟང་པོ་, prayer">
<meta name="author" content="Pecha.org">
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="7 days">

<!-- {% if noindex or DEBUG %}
{% if noindex or DEBUG %}
<meta name="robots" content="noindex, nofollow">
{% endif %} -->
{% endif %}

<!-- <link rel="search" type="application/opensearchdescription+xml" title="Sefaria Search" href="{% static 'files/opensearch.xml' %}" /> -->
<link rel="search" type="application/opensearchdescription+xml" title="Sefaria Search" href="{% static 'files/opensearch.xml' %}" />

{% if SITE_SETTINGS.TORAH_SPECIFIC %}
<link rel="alternate" href="https://pecha.org{{ request.path }}" hreflang="en" />
<link rel="alternate" href="https://pecha.org{{ request.path }}" hreflang="he" />
{% endif %} -->
<link rel="alternate" href="https://www.sefaria.org{{ request.path }}" hreflang="en" />
<link rel="alternate" href="https://www.sefaria.org.il{{ request.path }}" hreflang="he" />
{% endif %}

{% if canonical_url %}
<link rel="canonical" href="{{canonical_url}}" />
Expand All @@ -36,18 +30,18 @@
{% endblock %}

{% block ogimage %}
<meta property="og:description" content="{% block fb_description %}{{ desc|striptags }}{% endblock %}"/>
<meta property="og:image" content="{% static 'img/pecha-icon.png' %}" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:description" content="{% block fb_description %}{{ desc|striptags }}{% endblock %}"/>
<meta property="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:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
{% endblock %}

<meta property="og:title" content="{{title|striptags}}" />
<meta property="og:url" content="https://{{ request.get_host }}{{ request.get_full_path }}" />

<meta name="twitter:card" content="summary_large_image" />
<!-- <meta name="twitter:site" content="@sefariaproject" /> -->
<meta name="twitter:site" content="@sefariaproject" />
<meta name="twitter:title" content="{{title|striptags}}" />
<meta name="twitter:description" content="{% block soc_description %}{{ desc|striptags }}{% endblock %}" />
<meta name="twitter:image" content="https://{{ request.get_host }}/api/img-gen{{ request.path }}?lang={{request.GET.lang}}&platform=twitter&ven={{request.GET.ven}}&vhe={{request.GET.vhe}}" />
Expand Down Expand Up @@ -157,8 +151,6 @@
</script>
{% endif %}

<meta name="google-site-verification" content="IQIF71Vtc74ylIZ1EWMuaQTsk6CyjXLosHkyDNIASic" />


</head>

Expand Down

0 comments on commit 702684b

Please sign in to comment.