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 Tutorial search scrolling #140

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove all punctuation
  • Loading branch information
TuanaCelik committed Jun 2, 2023
commit c2ac56e4e7f4c87e0cbdd06148968b35aae7cd99
2 changes: 1 addition & 1 deletion themes/haystack/layouts/_default/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h2>{{ .Params.contribute.title }}</h2>
const card = document.createElement("a");
card.classList.add("search-modal-card");
const headline = doc.meta.headlines[0]?.headline;
card.href = `/tutorials/${doc.meta.file_name.toLowerCase().replace(".txt", "")}${headline ? `#${headline.toLowerCase().trim().replace(/ /g, "-").replace(")", "").replace("!", "")}` : "" }`;
card.href = `/tutorials/${doc.meta.file_name.toLowerCase().replace(".txt", "")}${headline ? `#${headline.toLowerCase().trim().replace(/ /g, "-").replace(/[.,\/!$%\^&\*;:{}=()]/g, "")}` : "" }`;
card.innerHTML = `
<svg
width="32"
Expand Down