diff --git a/devplacepy/static/css/base.css b/devplacepy/static/css/base.css index cda08a3..f318157 100644 --- a/devplacepy/static/css/base.css +++ b/devplacepy/static/css/base.css @@ -986,7 +986,8 @@ button.comment-form-submit:hover { flex-shrink: 0; } -.back-link { +.back-link, +.next-post-link { display: inline-flex; align-items: center; gap: 0.375rem; @@ -995,7 +996,8 @@ button.comment-form-submit:hover { margin-bottom: 1rem; } -.back-link:hover { +.back-link:hover, +.next-post-link:hover { color: var(--text-primary); } diff --git a/devplacepy/static/css/post.css b/devplacepy/static/css/post.css index bcbba95..1fb89fa 100644 --- a/devplacepy/static/css/post.css +++ b/devplacepy/static/css/post.css @@ -33,7 +33,8 @@ margin-bottom: 1rem; } -.post-nav-row .back-link { +.post-nav-row .back-link, +.post-nav-row .next-post-link { margin-bottom: 0; } diff --git a/devplacepy/templates/post.html b/devplacepy/templates/post.html index 2f6257d..5406780 100644 --- a/devplacepy/templates/post.html +++ b/devplacepy/templates/post.html @@ -60,7 +60,7 @@
← Back to Feed {% if next_post_url %} - + {% endif %}
diff --git a/pyproject.toml b/pyproject.toml index afe57f0..9a6cea7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "devplacepy" -version = "1.0.7" +version = "1.0.8" description = "DevPlace - The Developer Social Network" requires-python = ">=3.12" dependencies = [ diff --git a/tests/api/posts/nextpost.py b/tests/api/posts/nextpost.py index a33a091..bdc2191 100644 --- a/tests/api/posts/nextpost.py +++ b/tests/api/posts/nextpost.py @@ -55,7 +55,7 @@ def test_newer_post_links_to_the_next_older_post(app_server): assert r.json()["next_post_url"] == f"/posts/{older['slug']}" html = requests.get(f"{BASE_URL}/posts/{newer['slug']}") - assert f'href="/posts/{older["slug"]}" class="back-link next-post-link"' in html.text + assert f'href="/posts/{older["slug"]}" class="next-post-link"' in html.text assert f'' in html.text @@ -69,4 +69,4 @@ def test_next_post_link_is_absent_when_the_url_is_none(app_server): assert "next-post-link" not in html assert 'rel="next"' not in html else: - assert f'href="{data["next_post_url"]}" class="back-link next-post-link"' in html + assert f'href="{data["next_post_url"]}" class="next-post-link"' in html diff --git a/tests/e2e/posts/create.py b/tests/e2e/posts/create.py index 0ecdef2..c9ce2a1 100644 --- a/tests/e2e/posts/create.py +++ b/tests/e2e/posts/create.py @@ -245,7 +245,11 @@ def test_post_schema_has_date_modified(page, app_server): assert "dateModified" in text -def test_post_detail_has_no_rel_next(page, app_server): +def test_post_detail_rel_next_points_at_an_older_post(page, app_server): slug, _ = _seed_post_seo() page.goto(f"{BASE_URL}/posts/{slug}", wait_until="domcontentloaded") - assert page.locator('link[rel="next"]').count() == 0 + link = page.locator('link[rel="next"]') + if link.count() == 0: + return + assert "/posts/" in link.get_attribute("href") + assert page.locator(".next-post-link").count() == 1