npm init -y && npm install @11ty/eleventy
Update scripts in package.json
"scripts": {
"develop": "eleventy --serve",
"build": "eleventy"| import React, { useEffect, useImperativeHandle, useState, forwardRef, useCallback } from 'react' | |
| import { createPortal } from 'react-dom' | |
| import './styles.css' | |
| const modalElement = document.getElementById('modal-root') | |
| export function Modal({ children, fade = false, defaultOpened = false }, ref) { | |
| const [isOpen, setIsOpen] = useState(defaultOpened) | |
| const close = useCallback(() => setIsOpen(false), []) |
| .ellipsis { | |
| position: relative; | |
| } | |
| .ellipsis:before { | |
| content: ' '; | |
| visibility: hidden; | |
| } | |
| .ellipsis span { |
Reasons:
Multiple newlines at the file end are also redundant as well as spaces at the end of line.
| import { useRef, useState, useEffect } from 'react'; | |
| // Usage | |
| function App() { | |
| const [hoverRef, isHovered] = useHover(); | |
| return ( | |
| <div ref={hoverRef}> | |
| {isHovered ? '😁' : '☹️'} | |
| </div> |
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| ExpiresDefault "access plus 1 month" | |
| # CSS | |
| ExpiresByType text/css "access plus 1 year" | |
| # Data interchange | |
| ExpiresByType application/atom+xml "access plus 1 hour" |
| {# Language switcher #} | |
| {# Loop through all of the site locales, except the current one #} | |
| {% set otherLocales = craft.i18n.getSiteLocaleIds()|without(craft.locale) %} | |
| {% for locale in otherLocales %} | |
| {# Is this an entry page? #} | |
| {% if entry is defined %} | |
| {# Find the current entry in the other locale #} | |
| {% set localeEntry = craft.entries.id(entry.id).locale(locale).first %} |