Automattic / Automattic/jetpack

Check for existence of related posts target element before JS runs

Open
#2,223 3 comments 0 reactions 0 assignees View on GitHub
[Feature] Related Posts Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Right now we assume the related posts JS file is only loaded on pages where we want to attempt to query for related post content. Some people may want to concat the related post JS file along with their other scripts for better cache-ability. We should add some checking to allow for this use case.

Contributor guide

Open the contributing guide

Research direction

Start by locating the related posts JS file and the target element it queries. Check how the script behaves when that element is absent, then verify that loading it on pages without related-post content no longer causes problems while existing related-post behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.