Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tookit committed Sep 13, 2020
0 parents commit e5c3f7b
Show file tree
Hide file tree
Showing 55 changed files with 21,707 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# VuePress build output
docs/.vuepress/dist/
.aliossrc
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"arrowParens": "always",
"singleQuote": true
}
40 changes: 40 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
"prettier/prettier": [
"error",
{
"endOfLine": "lf"
}
],
"prettier.semi": true,
"prettier.singleQuote": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
},
"prettyhtml": {
"printWidth": 200,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": true
}
},
"vetur.format.defaultFormatter.ts": "vscode-typescript",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# blog
Tookit's personal blog
Binary file added docs/.vuepress/.DS_Store
Binary file not shown.
77 changes: 77 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
module.exports = {
title: 'Tookit',
description: "📦 🎨 Tookit's blog",
// theme: 'vuepress-theme-neptune',
theme: require.resolve('../../theme-neptune'), // 使用本地主题
themeConfig: {
nav: {
'/': [
{ text: 'Home', link: '/' },
{ text: 'Vue', link: '/_posts/vue' }
],
'/zh/': [
{ text: '首页', link: '/zh' },
{ text: 'Vue', link: '/zh/_post/vue' }
]
},
sidebar: {
'/': [
{
header: 'Categories'
},
{
text: 'Vue',
icon: 'mdi-vuejs',
path: '/posts/categories/vue',
to: '/posts/categories/vue.html'
}
],
'/zh/': [
{
header: '分类'
}
// {
// text: 'Blog',
// path: '/blog/',
// to: '/blog/',
// children: [
// {
// text: 'Vuepress theme with vuetify',
// path: '/build-a-vuepress-theme-with-vuetify',
// to: 'build-a-vuepress-theme-with-vuetify'
// }
// ]
// }
]
},
valine: {
appId: 'dFNEgQoCyMKnaV5FIR137JsC-gzGzoHsz',
appKey: '38ehraSP02NclWAHpTIpVl77'
}
},
locales: {
'/': {
lang: 'en',
name: 'English',
title: 'Tookit',
description: 'Tookit personal blog',
flag: '/img/en.png'
},
'/zh/': {
lang: 'zh',
name: '简体中文',
title: 'Tookit',
description: 'Tookit 个人站点',
flag: '/img/zh.png'
}
},

plugins: [
[
'@vuepress/google-analytics',
{
ga: 'UA-3881136-7'
}
]
]
}
Binary file added docs/.vuepress/public/img/en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/img/zh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
home: true
---
4 changes: 4 additions & 0 deletions docs/_posts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: category
title: category
---
6 changes: 6 additions & 0 deletions docs/_posts/laravel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Laravel"
lang: en-US
category: Laravel
layout: Category
---
47 changes: 47 additions & 0 deletions docs/_posts/laravel/create-a-laravel-8-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
category: Laravel
title: Create a rest api by laravel 8
layout: Article
image: https://lh3.googleusercontent.com/DAeLGsE71e2dNbcIr51s4ZGr-Z_CnrhW-wa50u8H2vO_jJ6zYovMU-RIR7bgKYz4Q3ru_L5qmp6rHfThDj9mktyZvGwTM6i3LA5dAg=w760-h360
---


## Init Project

``` javascript{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```

## Create database vma and update env


## Add some awesome package

- tymon/jwt-auth (JWT authenticate)
- spatie/laravel-permission (ACL/Access control)
- spatie/laravel-query-builder( Build generic api query)
- spatie/laravel-valuestore (for general setting)

``` bash
composer require tymon/jwt-auth
composer require spatie/laravel-permission
composer require spatie/laravel-query-builder
composer require spatie/laravel-valuestore

```

## configure package

```bash
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan vendor:publish --provider="Spatie\QueryBuilder\QueryBuilderServiceProvider"


```
6 changes: 6 additions & 0 deletions docs/_posts/laravel/learn-laravel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Laravel
title: Learn Laravel
layout: Article
---

5 changes: 5 additions & 0 deletions docs/_posts/rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: Category
category: Rust
title: Rust
---
7 changes: 7 additions & 0 deletions docs/_posts/vue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Vue"
lang: en-US
category: Vue
date: "2019-12-12"
layout: Category
---
114 changes: 114 additions & 0 deletions docs/_posts/vue/build-a-vuepress-theme-with-vuetify-ep1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: 'Build a vuepress theme with vuetify'
lang: en-US
category: Vue
layout: Article
date: '2019-12-12'
---

If we want to integrate vuetify with vuepress, we need configure vupress webpack-chain to enable load vuetiy's sass/scss file.

More details please check
([Vuetify quick start](https://vuetifyjs.com/en/getting-started/quick-start/))

## Requirement
- sass
- sass-loader
- fibers

## Theme Structure

Just follow the offical doc, how to [Writing a them](https://vuepress.vuejs.org/theme/writing-a-theme.html)

``` bash
theme
├── `global-components`
│ └── xxx.vue
├── `components`
│ └── xxx.vue
├── `layouts`
│ ├── Layout.vue _(**Mandatory**)_
│ └── 404.vue
├── `styles`
│ ├── index.styl
│ └── palette.styl
├── `templates`
│ ├── dev.html
│ └── ssr.html
├── `index.js`
├── `enhanceApp.js`
└── package.json
```
## Key Point

The main issue is to configure webpack-chain to load `sass/scss` file

```javascript
// theme/index.js
const path = require('path')
// Theme API.
module.exports = (options, ctx) => {
return {
chainWebpack: config => {
config.module
.rule('sass')
.oneOf('normal')
.use('sass-loader')
.loader('sass-loader')
.options({
implementation: require('sass'),
sassOptions: {
fiber: require('fibers'),
indentedSyntax: true, // optional
},
})
.end()
},
...
}
}

```

## Import vuetify

Import the vuetify components/directives that which we need in the theme

```javascript
import Vuetify, {
VApp,
VNavigationDrawer,
...
} from 'vuetify/lib'
import './style/theme.sass'
import { Ripple, Scroll } from 'vuetify/lib/directives'
import zhHans from 'vuetify/es5/locale/zh-Hans'
import en from 'vuetify/es5/locale/en'
import postsMixin from '@theme/mixins/posts'

export default ({
Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance
router, // the router instance for the app
siteData, // site metadata
}) => {
Vue.use(Vuetify, {
components: {
VApp,
VNavigationDrawer,
...
},
directives: {
Ripple,
Scroll,
},
})
options.vuetify = new Vuetify({
lang: {
locales: { zhHans, en },
current: 'en',
},
})
}
```

Loading

0 comments on commit e5c3f7b

Please sign in to comment.