Skip to content

Instantly share code, notes, and snippets.

View catherineriver's full-sized avatar
➡️

Ekaterina Baliasnikova catherineriver

➡️
View GitHub Profile
# To remove only some text on a content
@remove: //p[self::p/strong[contains(text(), "Articles liés")]]
@remove: //iframe[contains(@src,"https://urlsomething")]
# To deal with fucking error of <img> is not supported in blabla
@before_el(./..): //a/img
@before_el(./..): //p/img
@catherineriver
catherineriver / index.jsx
Created June 23, 2023 07:43
OG image generator usage
// define layout
import css from './OgImageEditor.module.css';
import { Logo } from './Logo';
import {useFormValue} from 'sanity'
import imageUrlBuilder from '@sanity/image-url';
import {useSanityClient} from "../hooks/useSanityClient";
import '@fontsource/montserrat/600.css';
import '@fontsource/unbounded/700.css';
const Component = ({
~version: "2.1"
@before_el(./..): //a/img
@before_el(./..): //p/img
<div>: //p[descendant::iframe]
channel: "@doxajournal"
site_name: "DOXA"
# variable
$body: //div[@class="article__body"]
$cards: //div[has-class("article__cards")]
@catherineriver
catherineriver / index.js
Created February 1, 2023 13:59
How to use emoji instead icons in Sanity
import S from '@sanity/desk-tool/structure-builder';
import React from "react"
const emoji = emoji => {
return () => (
<span role="img" style={{ fontSize: "1rem", border: 'none' }}>
{emoji}
</span>
)
}
@catherineriver
catherineriver / README.md
Created September 18, 2020 09:45 — forked from joyrexus/README.md
RAF replacements for setTimeout and setInterval

Drop in replace functions for setTimeout and setInterval that make use of requestAnimationFrame.

See overview article and Paul Irish's earlier post.

Courtesty of Joe Lambert

Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php