Skip to content

Commit

Permalink
Merge pull request #756 from arXiv/ARXIVCE-77-improve-abs-head
Browse files Browse the repository at this point in the history
add meta description
  • Loading branch information
kyokukou authored Oct 3, 2024
2 parents f832bd6 + 83603e6 commit 65a709a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

0 comments on commit 65a709a

Please sign in to comment.