Skip to content

Commit

Permalink
Add simple analytics
Browse files Browse the repository at this point in the history
Using lukehog.com and its magic pixel for now.
  • Loading branch information
puf committed Aug 10, 2024
1 parent 41d63d9 commit 76393fb
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ pnpm-debug.log*
# jetbrains setting folder
.idea/
notes/.obsidian/workspace.json

# secrets
lukehog-SPkg2l.json
File renamed without changes.
Empty file.
3 changes: 3 additions & 0 deletions src/layouts/NotePost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import FormattedDate from '../components/FormattedDate.astro';
import StarRating from '../components/StarRating.astro';
import { getTypeForNote } from '../components/Notes.astro';
import AlsoOn from '../components/AlsoOn.astro';
import { getSlugForNote } from '../components/Notes.astro';
type Props = CollectionEntry<'blog'>['data'] & {
frontmatter: {
Expand All @@ -27,6 +28,7 @@ const { title, description, pubDate, updatedDate, heroImage, frontmatter } = Ast
const note = Astro.props
const type = getTypeForNote(Astro.props)
const typeurl = "/"+type
const slug = getSlugForNote(note);
---

<html lang="en">
Expand Down Expand Up @@ -114,6 +116,7 @@ const typeurl = "/"+type
</div>
<slot />
</div>
<img src={`https://api.lukehog.com/pixel/SPkg2lfB1sOiE4z2/pageview?slug=${slug}&debug=false`} alt="Magic pixel" />
<nav>Back to all <a href={typeurl}>{type}</a></nav>
</article>
</main>
Expand Down

0 comments on commit 76393fb

Please sign in to comment.