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

Fix taxonomy current path #1882

Merged
merged 2 commits into from
Jun 9, 2022
Merged

Conversation

bemyak
Copy link
Contributor

@bemyak bemyak commented May 28, 2022

Fixes #1878


Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you doing the PR on the next branch?

@bemyak bemyak force-pushed the fix-taxonomy-current-path branch from 0e0fb9b to 912041b Compare May 28, 2022 20:03
components/templates/src/global_fns/files.rs Outdated Show resolved Hide resolved
@@ -399,6 +399,29 @@ title = "A title"
);
}

#[test]
fn does_not_duplicate_lang() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does it mean to duplicate lang?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's described in #1878.

TL;DR: currenly get_url(path='/lang/something', lang='lang') will return a URL with duplicated lang part: /lang//lang/something

context.insert("current_url", &config.make_permalink(&self.kind.name));
context.insert("current_path", &format!("/{}/", self.kind.name));
context.insert("current_url", &self.permalink);
context.insert("current_path", &self.path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

so we already had them eh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we indeed had both permalink and path already computed in the new function, but path was discarded and permalink wasn't used. I've made it to match other similar structs e.g., Path

@bemyak bemyak force-pushed the fix-taxonomy-current-path branch from 912041b to 9208a06 Compare June 4, 2022 19:00
@bemyak bemyak requested a review from Keats June 4, 2022 19:41
@Keats Keats merged commit 8029cf8 into getzola:next Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants