Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add meta tags #42

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/courses/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DESCRIPTION = (
"Buscador de ramos para la Universidad Católica, "
"ideal para planificar tu horario y encontrar electivos. "
"Una alternativa a Buscacursos UC."
)

IMG_PATH = "/dist/favicon.ico"


def defaults(_request):
"Loads the default template variables"
return {"fallback_description": DESCRIPTION, "fallback_img_path": IMG_PATH}
11 changes: 10 additions & 1 deletion front/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{% endblock %} - RamosUC</title>

<title>{% if page_title %}{{ page_title }} - {% endif %}RamosUC</title>
<meta property="og:title" content="{% if page_title %}{{ page_title }} - {% endif %}RamosUC" />
<meta property="og:description" content="{% firstof page_description fallback_description %}"/>
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ request.path }}" />
<meta property="og:image" content="{% firstof page_img_path fallback_img_path %}" />
<meta name="author" content="Nicolas Mc Intyre">
<meta name="keywords" content="UC, Buscacursos, Ramos, Universidad Catolica, horario, ramos uc, buscador, cursos, banner uc">
<meta name="description" content="{% firstof page_description fallback_description %}">

{% if GA_CODE %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ GA_CODE }}"></script>
Expand Down
1 change: 1 addition & 0 deletions ramosuc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"apps.google_analytics.context_processors.ga_code",
"apps.courses.context_processors.defaults",
],
},
},
Expand Down