This document provides comprehensive rules for creating WordPress Gutenberg blocks in the Example project.
Every Gutenberg block follows this basic structure:
import { registerBlockType } from '@wordpress/blocks';| { | |
| "files.autoSave": "off", | |
| "terminal.integrated.fontSize": 16, | |
| "scm.inputFontSize": 18, | |
| "chat.editor.fontSize": 18, | |
| "chat.editor.lineHeight": 22, | |
| "workbench.settings.useSplitJSON": true, | |
| "window.zoomLevel": 2, | |
| "editor.fontFamily": "'Cascadia Mono',Consolas, monospace", | |
| "editor.fontSize": 16, |
| window.scrollToSection = function(where) { | |
| const headerHeight = document.getElementById('header-navigation').offsetHeight, | |
| offsetTop = document.getElementById(where).offsetTop, | |
| scrollDistance = offsetTop - headerHeight; | |
| window.scrollTo({top: scrollDistance, behavior: 'smooth' }); | |
| }; |
| {% layout none -%}"id","item_group_id","title","description","link","image_link","price","availability","condition"{{- '' }} | |
| {%- paginate collections.all.products by 2000 -%} | |
| {%- for product in collections.all.products -%} | |
| {%- for variant in product.variants -%} | |
| "{{ variant.id }}","{{ product.id }}","{{ product.title | strip_html | strip_newlines | escape -}}{%- if product.variants.size > 1 %} - {{ variant.title | strip_html | strip_newlines | escape }}{% endif %}","{{- product.description | strip_html | strip_newlines -}}","{{ shop.url -}}{{- variant.url }}","https:{{- variant.featured_image | default: product.featured_image | img_url: '400x' -}}","{{ product.price | money_without_currency | replace: "TL", "TRY" }}","{%- if product.available -%}in stock{%- else -%}out of stock{%- endif -%}","new"{{- '' }} | |
| {%- endfor -%} | |
| {%- endfor -%} | |
| {%- endpaginate -%} | |
| {% comment %} | |
| https://auglio.com/en/knowledge-base/article/20-xml-product-feed-for-shopify-stores |
| function () { | |
| if (!document.querySelector('#telefon') || 0 === document.querySelector('#telefon').value.length) { | |
| return null; | |
| } | |
| var phone = '+90' + document.querySelector('#telefon').value.replace(/[\(|\)|\s]/g,''); | |
| //+905551234567 -> 13 karakter | |
| if (13 < phone.length) { | |
| return null; | |
| } | |
| return phone; |
| -- vim: set autoindent expandtab shiftwidth=2 tabstop=2: | |
| -- :PlugInstall | |
| -- vim-plug https://github.com/junegunn/vim-plug | |
| local vim = vim | |
| local Plug = vim.fn['plug#'] | |
| local PlugBegin = vim.fn['plug#begin'] | |
| local PlugEnd = vim.fn['plug#end'] | |
| vim.cmd [[language en]] |
| const { PurgeCSSPlugin } = require("purgecss-webpack-plugin"); | |
| const glob = require("glob-all"); | |
| // https://stackoverflow.com/a/77249323/181295 | |
| module.exports = { | |
| plugins: [ | |
| new PurgeCSSPlugin({ | |
| defaultExtractor: (content) => { | |
| const defaultSelectors = content.match(/[A-Za-z0-9_-]+/g) || []; | |
| const extendedSelectors = content.match(/[^<>"=\s]+/g) || []; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <configuration> | |
| <system.webServer> | |
| <rewrite> | |
| <rules> | |
| <clear /> | |
| <rule name="Redirect to www" stopProcessing="true"> | |
| <match url=".*" /> | |
| <conditions logicalGrouping="MatchAny"> | |
| <add input="{HTTPS}" pattern="off" ignoreCase="true" /> |
| <!doctype html> | |
| <html lang="tr" itemscope itemtype="https://schema.org/FAQPage"> | |
| <body> | |
| <div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"> | |
| <h2 itemprop="name">Sample Question 1?</h2> | |
| <div itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer"> | |
| <div itemprop="text"> | |
| <p>Answer example 1</p> | |
| </div> | |
| </div> |
| ::-webkit-scrollbar { | |
| width: 5px; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background-color: black; | |
| } | |
| ::-webkit-scrollbar-track { | |
| box-shadow: inset 0 0 2px gray; |