Skip to content

Commit

Permalink
stats
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichmax committed Jan 25, 2024
1 parent c062d16 commit a16cc47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/data/external/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export async function getMatomoTopPageUrls() {
const res = await fetch(
`${
process.env.NEXT_PUBLIC_MATOMO_URL
}?module=API&method=Actions.getPageUrls&segment=pageUrl=@/&flat=1&idSite=${
}?module=API&method=Actions.getPageUrls&segment=pageUrl=@/articles/&flat=1&idSite=${
process.env.NEXT_PUBLIC_MATOMO_SITE_ID
}&period=range&date=2018-02-01,${new Date()
.toISOString()
Expand Down
7 changes: 4 additions & 3 deletions src/utils/getToc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ export function getToc(markdown) {
const regexReplaceCode = /(```.+?```)/gms
const regexRemoveLinks = /\[(.*?)\]\(.*?\)/g

const markdownWithoutLinks = markdown.replace(regexRemoveLinks, "")
const markdownWithoutCodeBlocks = markdownWithoutLinks.replace(
const markdownWithoutLinks = markdown.replaceAll(regexRemoveLinks, "")
const markdownWithoutCodeBlocks = markdownWithoutLinks.replaceAll(
regexReplaceCode,
""
)

const titles = markdownWithoutCodeBlocks.match(regXHeader)

const toc = []
let globalID = 0

if (titles) {
titles.map((tempTitle, i) => {
titles.map((tempTitle) => {
const level = tempTitle.match(/#/g).length - 1
const title = tempTitle.replace(/#/g, "").trim("")
const anchor = `#${title.replace(/ /g, "-").toLowerCase()}`
Expand Down

0 comments on commit a16cc47

Please sign in to comment.