Skip to content

Commit

Permalink
Merge branch 'hugo' of github.com:michaelfromyeg/quartz into hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfromyeg committed Aug 1, 2023
2 parents 70bafd4 + 46ae7fb commit 4af319f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,9 +25,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]

**Additional context**
Add any other context about the problem here.
11 changes: 6 additions & 5 deletions assets/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ const highlight = (content, term) => {
})
.join(" ")
.replaceAll('</span> <span class="search-highlight">', " ");
return `${startIndex === 0 ? "" : "..."}${mappedText}${
endIndex === splitText.length ? "" : "..."
}`;
return `${startIndex === 0 ? "" : "..."}${mappedText}${endIndex === splitText.length ? "" : "..."
}`;
};

// Common utilities for search
Expand All @@ -116,9 +115,10 @@ const resultToHTML = ({ url, title, content }) => {
};

const redir = (id, term) => {
const shouldTrim = PRODUCTION && SEARCH_ENABLED;
const baseURLPrefix = shouldTrim ? "" : BASE_URL.replace(/\/$/g, "");
// Remove the trailing slash from the base URL; `id` is already prefixed with a slash
const baseURLPrefix = BASE_URL.replace(/\/$/g, "");
const urlString = `${baseURLPrefix}${id}#:~:text=${encodeURIComponent(term)}`;

window.Million.navigate(new URL(urlString), ".singlePage");
closeSearch();
plausible("Search", {
Expand Down Expand Up @@ -216,6 +216,7 @@ const displayResults = (term, finalResults, extractHighlight = false) => {
}

const anchors = [...document.getElementsByClassName("result-card")];

anchors.forEach((anchor) => {
anchor.onclick = () => redir(anchor.id, term);
});
Expand Down
22 changes: 11 additions & 11 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
# joplin-garden-worker
engine = "hugo"
defaultFolder = "."
stripHtmlComments = true
includeTags = [
"quartz"
]
[hugoOptions]
outputAsFolder = false

# quartz
baseURL = "https://garden.michaeldemar.co/"
languageCode = "en-us"
relativeURLs = false
disablePathToLower = true
disablePathToLower = false
ignoreFiles = [
"/content/templates/*",
"/content/private/*",
Expand All @@ -21,6 +11,16 @@ summaryLength = 20
paginate = 10
enableGitInfo = true

# joplin-garden-worker
engine = "hugo"
defaultFolder = "."
stripHtmlComments = true
includeTags = [
"quartz"
]
[hugoOptions]
outputAsFolder = false

[markup]
[markup.tableOfContents]
endLevel = 3
Expand Down

0 comments on commit 4af319f

Please sign in to comment.