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 relative_path field in API response #521

Merged
merged 6 commits into from
Nov 11, 2019

Conversation

ashmaroli
Copy link
Member

For resources that respond to relative_path calls, expose the value after stripping away any leading slashes and special dirnames from them.

The rationale is that front end does not ever send a request to the URI containing a resource's special directory (where applicable). The sanitized relative path is either sent with the initial payload or constructed via front end logic.

This change normalizes the behavior for all resources and allows simplifying front end code.

ashmaroli and others added 5 commits October 20, 2019 18:39
For resources that respond to `relative_path` calls, expose the value
after stripping away any leading slashes and special dirnames from them

Refer private method `JekyllAdmin::APIable#relative_path_for_api` for
examples.
Copy link
Member

@mertkahyaoglu mertkahyaoglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ashmaroli ashmaroli added the api label Nov 11, 2019
@ashmaroli ashmaroli merged commit c202e5f into jekyll:master Nov 11, 2019
@ashmaroli ashmaroli deleted the expose-sanitized-relative-paths branch November 11, 2019 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants