mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-23 01:30:01 +01:00
switch to gatsby-plugin-svgr
This commit is contained in:
parent
bf25fe9ad5
commit
6c8dc9855f
@ -78,6 +78,12 @@ module.exports = {
|
|||||||
includePaths: [`${__dirname}/node_modules`, `${__dirname}/src/styles`]
|
includePaths: [`${__dirname}/node_modules`, `${__dirname}/src/styles`]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resolve: 'gatsby-plugin-svgr',
|
||||||
|
options: {
|
||||||
|
icon: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
resolve: 'gatsby-plugin-lunr',
|
resolve: 'gatsby-plugin-lunr',
|
||||||
options: {
|
options: {
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run svg && gatsby develop",
|
"start": "gatsby develop",
|
||||||
"build": "npm run svg && gatsby build",
|
"build": "gatsby build",
|
||||||
"format": "prettier --write 'src/**/*.{js,jsx}'",
|
"format": "prettier --write 'src/**/*.{js,jsx}'",
|
||||||
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
|
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
|
||||||
"lint:js": "eslint ./gatsby-*.js && eslint ./src/**/*.jsx",
|
"lint:js": "eslint ./gatsby-*.js && eslint ./src/**/*.jsx",
|
||||||
"lint:css": "stylelint ./src/**/*.{css,scss}",
|
"lint:css": "stylelint ./src/**/*.{css,scss}",
|
||||||
"lint:md": "markdownlint ./content/posts/**/*.md && markdownlint ./README.md",
|
"lint:md": "markdownlint ./content/posts/**/*.md && markdownlint ./README.md",
|
||||||
"lint": "npm run svg && npm run lint:md && npm run lint:js && npm run lint:css",
|
"lint": "npm run lint:md && npm run lint:js && npm run lint:css",
|
||||||
"test": "npm run lint",
|
"test": "npm run lint",
|
||||||
"deploy": "./scripts/deploy.sh",
|
"deploy": "./scripts/deploy.sh",
|
||||||
"svg": "./scripts/svg.sh",
|
"svg": "./scripts/svg.sh",
|
||||||
@ -39,6 +39,7 @@
|
|||||||
"gatsby-plugin-sass": "^2.0.1",
|
"gatsby-plugin-sass": "^2.0.1",
|
||||||
"gatsby-plugin-sharp": "^2.0.5",
|
"gatsby-plugin-sharp": "^2.0.5",
|
||||||
"gatsby-plugin-sitemap": "^2.0.1",
|
"gatsby-plugin-sitemap": "^2.0.1",
|
||||||
|
"gatsby-plugin-svgr": "^2.0.0-alpha",
|
||||||
"gatsby-redirect-from": "^0.1.1",
|
"gatsby-redirect-from": "^0.1.1",
|
||||||
"gatsby-remark-autolink-headers": "^2.0.6",
|
"gatsby-remark-autolink-headers": "^2.0.6",
|
||||||
"gatsby-remark-copy-linked-files": "^2.0.5",
|
"gatsby-remark-copy-linked-files": "^2.0.5",
|
||||||
@ -69,7 +70,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/node": "^7.0.0",
|
"@babel/node": "^7.0.0",
|
||||||
"@babel/preset-env": "^7.1.0",
|
"@babel/preset-env": "^7.1.0",
|
||||||
"@svgr/cli": "^2.4.1",
|
|
||||||
"babel-eslint": "^9.0.0",
|
"babel-eslint": "^9.0.0",
|
||||||
"eslint": "^5.6.0",
|
"eslint": "^5.6.0",
|
||||||
"eslint-config-prettier": "^3.1.0",
|
"eslint-config-prettier": "^3.1.0",
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SRC='./src/images'
|
|
||||||
OUT='./src/components/svg'
|
|
||||||
|
|
||||||
printf "Creating SVG components...\\n\\n"
|
|
||||||
|
|
||||||
# Usage: svgr [-d out-dir] [src-dir]
|
|
||||||
./node_modules/@svgr/cli/bin/svgr --icon -d $OUT $SRC
|
|
||||||
|
|
||||||
printf "\\n🎉 Successfully created SVG components\\n\\n"
|
|
@ -3,8 +3,8 @@ import PropTypes from 'prop-types'
|
|||||||
import ModalThanks from '../molecules/ModalThanks'
|
import ModalThanks from '../molecules/ModalThanks'
|
||||||
import styles from './PostActions.module.scss'
|
import styles from './PostActions.module.scss'
|
||||||
|
|
||||||
import Twitter from '../svg/Twitter'
|
import { ReactComponent as Twitter } from '../../images/twitter.svg'
|
||||||
import Bitcoin from '../svg/Bitcoin'
|
import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
|
||||||
|
|
||||||
export default class PostActions extends PureComponent {
|
export default class PostActions extends PureComponent {
|
||||||
state = {
|
state = {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import Forward from '../svg/Forward'
|
import { ReactComponent as Forward } from '../../images/forward.svg'
|
||||||
import Infinity from '../svg/Infinity'
|
import { ReactComponent as Infinity } from '../../images/infinity.svg'
|
||||||
import styles from './PostLinkActions.module.scss'
|
import styles from './PostLinkActions.module.scss'
|
||||||
import stylesPostMore from './PostMore.module.scss'
|
import stylesPostMore from './PostMore.module.scss'
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import styles from './PostMore.module.scss'
|
import styles from './PostMore.module.scss'
|
||||||
import Caret from '../svg/ChevronRight'
|
import { ReactComponent as Caret } from '../../images/chevron-right.svg'
|
||||||
|
|
||||||
const PostMore = ({ to, children }) => (
|
const PostMore = ({ to, children }) => (
|
||||||
<Link className={styles.postMore} to={to}>
|
<Link className={styles.postMore} to={to}>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import Forward from '../svg/Forward'
|
import { ReactComponent as Forward } from '../../images/forward.svg'
|
||||||
import styles from './PostTitle.module.scss'
|
import styles from './PostTitle.module.scss'
|
||||||
|
|
||||||
const PostTitle = ({ type, slug, linkurl, title }) => {
|
const PostTitle = ({ type, slug, linkurl, title }) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import SearchIcon from '../svg/MagnifyingGlass'
|
import { ReactComponent as SearchIcon } from '../../images/magnifying-glass.svg'
|
||||||
import styles from './SearchButton.module.scss'
|
import styles from './SearchButton.module.scss'
|
||||||
|
|
||||||
const SearchButton = props => (
|
const SearchButton = props => (
|
||||||
|
@ -2,11 +2,11 @@ import React from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import styles from './IconLinks.module.scss'
|
import styles from './IconLinks.module.scss'
|
||||||
|
|
||||||
import Twitter from '../svg/Twitter'
|
import { ReactComponent as Twitter } from '../../images/twitter.svg'
|
||||||
import Github from '../svg/Github'
|
import { ReactComponent as Github } from '../../images/github.svg'
|
||||||
import Facebook from '../svg/Facebook'
|
import { ReactComponent as Facebook } from '../../images/facebook.svg'
|
||||||
import Rss from '../svg/Rss'
|
import { ReactComponent as Rss } from '../../images/rss.svg'
|
||||||
import Jsonfeed from '../svg/Jsonfeed'
|
import { ReactComponent as Jsonfeed } from '../../images/jsonfeed.svg'
|
||||||
|
|
||||||
const NetworkIcon = ({ link }) => {
|
const NetworkIcon = ({ link }) => {
|
||||||
let Icon
|
let Icon
|
||||||
|
@ -4,7 +4,7 @@ import { QRCode } from 'react-qr-svg'
|
|||||||
import Clipboard from 'react-clipboard.js'
|
import Clipboard from 'react-clipboard.js'
|
||||||
|
|
||||||
import Modal from '../atoms/Modal'
|
import Modal from '../atoms/Modal'
|
||||||
import IconClipboard from '../svg/Clipboard'
|
import { ReactComponent as IconClipboard } from '../../images/clipboard.svg'
|
||||||
import styles from './ModalThanks.module.scss'
|
import styles from './ModalThanks.module.scss'
|
||||||
|
|
||||||
const query = graphql`
|
const query = graphql`
|
||||||
|
@ -6,8 +6,8 @@ import Vcard from '../molecules/Vcard'
|
|||||||
import Subscribe from '../molecules/Subscribe'
|
import Subscribe from '../molecules/Subscribe'
|
||||||
import ModalThanks from '../molecules/ModalThanks'
|
import ModalThanks from '../molecules/ModalThanks'
|
||||||
|
|
||||||
import Github from '../svg/Github'
|
import { ReactComponent as Github } from '../../images/github.svg'
|
||||||
import Bitcoin from '../svg/Bitcoin'
|
import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
|
||||||
|
|
||||||
import styles from './Footer.module.scss'
|
import styles from './Footer.module.scss'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user