Skip to content

Instantly share code, notes, and snippets.

View AlissonSteffens's full-sized avatar
👨‍💻
Working from home

Alisson Steffens AlissonSteffens

👨‍💻
Working from home
View GitHub Profile
@AlissonSteffens
AlissonSteffens / getDocBySlug.js
Created October 5, 2022 02:33
NextJS get markdown files in folder as data (properties) and content
export function getDocBySlug(dir, slug, fields = []) {
const realSlug = slug.replace(/\.md$/, '');
const fullPath = join('/base/', `${realSlug}.md`);
const fileContents = fs.readFileSync(fullPath, 'utf8');
const { data, content } = matter(fileContents);
console.log(data, content);
const items = {};
// Ensure only the minimal needed data is exposed
fields.forEach((field) => {
@AlissonSteffens
AlissonSteffens / HoverableShadow.scss
Last active October 10, 2022 14:11
Hoverable Shadow
.hoverable-shadow {
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.1) 0px 2px 4px -2px;
transition-duration: 0.5s;
transition-property: color, background-color, border-color,
text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter,
backdrop-filter, -webkit-backdrop-filter;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
&:hover {