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

add meta description #756

Merged
merged 1 commit into from
Oct 3, 2024
Merged
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
3 changes: 2 additions & 1 deletion browse/templates/abs/abs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

{% block head %}
{{ super() -}}
<link rel="canonical" href="{{ url_for('browse.abstract', arxiv_id=abs_meta.arxiv_id) }}"/>
<link rel="canonical" href="{{ canonical_url(abs_meta.arxiv_id) }}"/>
<meta name="description" content="Abstract page for arXiv paper {{ requested_id }}: {{ abs_meta.title|tex2utf }}">
{{- generate_social_media_tags() }}
<link rel="stylesheet" media="screen" type="text/css" href="{{ url_for('static', filename='css/tooltip.css') }}"/>
{%- if config['LABS_ENABLED'] and config['LABS_BIBEXPLORER_ENABLED'] -%}
Expand Down
14 changes: 14 additions & 0 deletions tests/test_db_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ def test_basic_db_abs(dbclient):
assert 'Number Theory' in subjects.get_text()
assert 'math.NT' in subjects.get_text()

def test_abs_head(dbclient):
rt = dbclient.get('/abs/0906.2112')
assert rt.status_code == 200

html = BeautifulSoup(rt.data.decode('utf-8'), 'html.parser')
head = html.head
canonical_link = head.find('link', {'rel': 'canonical'})
assert canonical_link is not None
assert canonical_link['href'] == "https://arxiv.org/abs/0906.2112"

meta_description = head.find('meta', {'name': 'description'})
assert meta_description is not None
assert meta_description['content'] == "Abstract page for arXiv paper 0906.2112: Symmetric roots and admissible pairing"


def test_db_abs_history(dbclient):
rt = dbclient.get('/abs/0906.2112')
Expand Down
Loading