使用 tailwindcss + typescript + gatsby 搭建的 Blog
- [✅] 归档添加切换动画
- [✅] 归档页添加懒加载过渡元素
- [✅] 拆分 layout 组件到免卸载单位
- [✅] 增加 pageloading 效果
- [❌] 使用 tailwind 和 @emotion 重写 css https://tjaddison.com/blog/2019/06/create-react-app-emotion-and-tailwind-css-starter-app/
- [❌] 抽离 layout 组件中的 graphql 查询
- [✅] 记录滚动位置
- [✅] react-lazyload 懒加载
- [❌] 压缩向页面传递的 json 大小
测试网站性能
-
[❌] css-doodle 文档
-
[❌] 手写 bind 实现
-
[❌] 手写 apply 实现
-
[❌] 手写 promise 实现
-
[❌] js 贪心算法
-
[❌] 前端 10 算法
-
[❌] git 克隆仓库内的一个文件夹
-
[❌] 有必要上 ssr 吗
GITALK ✅
-
nginx 使用 lua 脚本向 kfuka 写入数据
- 代码缩进
- 添加文件类型显示 ✅
- 添加文件名显示 ✅
-
https://www.gatsbyjs.com/plugins/gatsby-remark-code-repls/?=gatsby-remark-code
-
https://www.gatsbyjs.com/plugins/gatsby-plugin-paginated-collection/
rm -rf ./node_modules
node -v
npm -v
npm config set registry https://registry.npm.taobao.org
npm config set sha rp_binary_host "https://npm.taobao.org/mirrors/sharp"
npm config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
npm install
npm run build
- 或者使用 yarn
rm -rf ./node_modules
node -v
yarn -v
yarn config set registry https://registry.npm.taobao.org
yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
yarn install --pure-lockfile # 这个参数是在服务器install不生成yarn.lock,防止服务器和本地代码冲突
yarn run build
brew install pkg-config
brew install automake autoconf libtool dpkg pkgconfig nasm libpng
在 Vue 项目中使用 Eslint+Prettier+Stylelint
Vue 项目使用 eslint + prettier 规范代码风格
https://github.com/wangweianger/myblog
给 link 添加 ref 属性和增加属性
import React from 'react';
import { Link as GLink } from 'gatsby';
import type { GatsbyLinkProps } from 'gatsby';
import clx from 'classnames';
import styles from './Button.module.css';
interface CustomGatsbyLinkProps extends Omit<GatsbyLinkProps<Record<string, unknown>>, 'ref'> {
active?: boolean;
}
const Link: React.FC<CustomGatsbyLinkProps> = ({ className, children, ...props }) => (
<GLink className={clx(styles.link, className)} {...props}>
{children}
</GLink>
);
export default Link;