Skip to content

Instantly share code, notes, and snippets.

View mornir's full-sized avatar
🎮
Gaming

Jérôme Pott mornir

🎮
Gaming
  • Vereinigung Kantonaler Gebäudeversicherungen
  • Bern, Switzerland
View GitHub Profile
const blocks = `blocks[] {
...,
photos[] {
...,
"metadata": asset->metadata,
},
markDefs[] {
...,
_type == "internalLink" => {
"slug": @->slug.current,
@mornir
mornir / Gate.astro
Last active February 24, 2026 10:46
Very Basic Gated Content with Alpine.js
<div
x-cloak
x-data="{ showGate: $persist(true), password: '', showError: false }"
x-show="showGate"
class="absolute inset-0 z-20 bg-white"
x-trap.noscroll="showGate"
>
<div class="mx-auto prose px-4 pt-12">
<h1>Projekt Digitale BSV 2026</h1>
<form
@mornir
mornir / custom_fn.groq
Created July 12, 2025 16:00
GROQ custom function
fn utils::expandLink($lang) = $lang[]{
...,
markDefs[]{
...,
_type == "internalLink" => {
"slug": @.reference->number,
"type": @.reference->_type,
}
}
};
@mornir
mornir / netlify.toml
Created July 20, 2025 07:07
Prefix default locale Netlify
[[redirects]]
from = "/"
to = "/fr/"
status = 302
conditions = { Language = ["fr"] }
[[redirects]]
from = "/"
to = "/de/"
status = 302
@mornir
mornir / art.astro
Created December 29, 2025 14:28
BSV Article
---
import type {
GetArticleQueryResult,
BlockContent,
} from '../sanity/sanity.types'
import RichText from '@/components/portable-text/RichText.astro'
import { Icon } from 'astro-icon/components'
interface Props {
<h2
class="mb-3 scroll-mt-24"
id={`art-${number}`}
x-intersect:enter="$store.scrollSpy.activeId = 'art-'+number"
>
<span class="mb-1 block font-mono text-sm text-slate-600"
>Artikel {number}</span
>
<a class="block text-xl font-semibold hover:underline" href={url}>{name}</a>
</h2>