Feature/add json ld schema#293
Open
ArnabNath1 wants to merge 3 commits into
Open
Conversation
|
@ArnabNath1 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
@ArnabNath1 kindly resolve the merge conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary [required]
This PR adds a JSON-LD structured data block to the project details template (
templates/project.html). By marking up the project with theLearningResourceschema type, this change allows search engines to better understand the rich, structured information on the page (title, description, skills, difficulty) and surface it in organic search rich results. It also includes tests to assert the JSON-LD is correctly served, alongside a minor bug fix for a previously failing test fixture in the test suite.Related Issue [required]
Closes #97
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
templates/project.html<script type="application/ld+json">inside the<head>dynamically populated with project attributes.tests/test_basic.pytest_project_detail_json_ld_presentto verify the schema is rendered. Fixedtest_health_checkto useget_client()instead of relying on a missing fixture.How to Test This PR [required]
git checkout feature/add-json-ld-schemapip install -r requirements.txtpython app.pyhttp://127.0.0.1:5000/project/1and inspect the page source to verify the<script type="application/ld+json">tag exists in the<head>.python tests/test_basic.pyExpected test output:
Test Results [required]
PASS test_projects_json_loads PASS test_each_project_has_required_fields PASS test_find_project_by_id_found PASS test_find_project_by_id_missing PASS test_parse_skills_basic PASS test_parse_skills_empty_string PASS test_parse_skills_single_entry PASS test_score_single_project_full_match PASS test_score_single_project_no_match PASS test_get_recommendations_returns_results PASS test_get_recommendations_max_three PASS test_get_recommendations_no_match_returns_empty PASS test_get_recommendations_result_format PASS test_validate_all_valid PASS test_validate_missing_skills PASS test_validate_missing_level PASS test_validate_missing_interest PASS test_validate_missing_time PASS test_validate_all_missing PASS test_home_route PASS test_recommend_api_valid PASS test_recommend_api_missing_field PASS test_recommend_api_empty_body PASS test_project_detail_found PASS test_project_detail_not_found PASS test_project_detail_json_ld_present PASS test_internal_server_error_page PASS test_view_code_found PASS test_download_code_found PASS test_health_check PASS test_scoring_weights_has_all_keys
31 passed, 0 failed out of 31 tests
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 31 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
Note: I updated the
test_health_checkfunction intests/test_basic.pyto instantiate the test client manually viaget_client()rather than expecting it as a fixture since it was causing the direct test script execution to fail