Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduy1407 committed Dec 13, 2022
0 parents commit 361877a
Show file tree
Hide file tree
Showing 138 changed files with 32,774 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "kdu-js"
}
}
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Note
====
This repository is for Kdu 2.x only. Issues and pull requests related to 3.x are managed in the v3 doc repo: https://github.com/kdujs/docs.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/
src/_drafts
package-lock.json
.firebase
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021-present NKDuy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# kdu2-docs

> Important: This repository is for Kdu 2.x only. Issues and pull requests related to 3.x are managed in the [v3 doc repo](https://github.com/kdujs/docs).
This site is built with [hexo](http://hexo.io/). Site content is written in Markdown format located in `src`. Pull requests welcome!

## Developing

``` bash
$ npm install
$ npm start # dev server at http://localhost:4000
```
181 changes: 181 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Hexo Configuration
## Docs: https://hexo.io/docs/
## Source: https://github.com/hexojs/hexo

# Site
title: Kdu.js
subtitle:
description: "The Kdu Framework"
author: NKDuy
email:
language:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://kdujs-v2.web.app
root: /
permalink: :year/:month/:day/:title/
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code

# Directory
source_dir: src
public_dir: public

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
auto_spacing: false # Add spaces between asian characters and western characters
titlecase: false # Transform title into titlecase
external_link:
enable: true # Open external links in new tab
max_open_file: 100
multi_thread: true
filename_case: 0
render_drafts: false
post_asset_folder: false
highlight:
enable: true
line_number: false
tab_replace:
hljs: true

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 0
category: 0
tag: 0

# Server
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
logger: false
logger_format:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: MMM D YYYY
time_format: H:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Disqus
disqus_shortname:

# Include/Exclude Files/Folders
exclude:
## Exclude example code from Nunjucks
- "v2/examples/kdu-20-*/*"

# Extensions
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins
## Themes: https://github.com/hexojs/hexo/wiki/Themes
theme: kdu
exclude_generator:

# Markdown
## https://github.com/chjj/marked
markdown:
gfm: true
pedantic: false
sanitize: false
tables: true
breaks: true
smartLists: true
smartypants: true

# Offline
## Config passed to sw-precache
## https://github.com/JLHwung/hexo-offline
# offline:
# maximumFileSizeToCacheInBytes: 10485760
# staticFileGlobs:
# - public/**/*.{js,html,css,png,jpg,jpeg,gif,svg,eot,ttf,woff,woff2,json,xml}
# stripPrefix: public
# verbose: true
# runtimeCaching:
# # Ad Sources - should be networkFirst
# - urlPattern: /*
# handler: networkFirst
# options:
# origin: sendgrid.sp1.convertro.com
# - urlPattern: /*
# handler: networkFirst
# options:
# origin: ad.doubleclick.net
# # CDNs - should be cacheFirst, since they should be used specific versions so should not change
# - urlPattern: /*
# handler: cacheFirst
# options:
# origin: cdn.jsdelivr.net
# - urlPattern: /*
# handler: cacheFirst
# options:
# origin: fonts.googleapis.com
# - urlPattern: /*
# handler: cacheFirst
# options:
# origin: fonts.gstatic.com
# - urlPattern: /*
# handler: cacheFirst
# options:
# origin: cdnjs.cloudflare.com
# - urlPattern: /*
# handler: cacheFirst
# options:
# origin: maxcdn.bootstrapcdn.com

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repository: [email protected]:kdujs/kdu2-docs.git

feed:
type: atom
path: atom.xml
limit: 20

alias:
api/index.html: v2/api/index.html
guide/class-and-style.html: v2/guide/class-and-style.html
guide/comparison.html: v2/guide/comparison.html
guide/components.html: v2/guide/components.html
guide/computed.html: v2/guide/computed.html
guide/conditional.html: v2/guide/conditional.html
guide/custom-directive.html: v2/guide/custom-directive.html
guide/deployment.html: v2/guide/deployment.html
guide/events.html: v2/guide/events.html
guide/forms.html: v2/guide/forms.html
guide/index.html: v2/guide/index.html
guide/installation.html: v2/guide/installation.html
guide/instance.html: v2/guide/instance.html
guide/join.html: v2/guide/join.html
guide/list.html: v2/guide/list.html
guide/mixins.html: v2/guide/mixins.html
guide/plugins.html: v2/guide/plugins.html
guide/reactivity.html: v2/guide/reactivity.html
guide/render-function.html: v2/guide/render-function.html
guide/routing.html: v2/guide/routing.html
guide/single-file-components.html: v2/guide/single-file-components.html
guide/ssr.html: v2/guide/ssr.html
guide/state-management.html: v2/guide/state-management.html
guide/syntax.html: v2/guide/syntax.html
guide/transitioning-state.html: v2/guide/transitioning-state.html
guide/transitions.html: v2/guide/transitions.html
59 changes: 59 additions & 0 deletions _scripts/pre-deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// udpate to latest built files of Kdu
const fs = require('fs')
const zlib = require('zlib')
const axios = require('axios')
const execSync = require('child_process').execSync

const themeconfPath = 'themes/kdu/_config.yml'
const installPath = 'src/v2/guide/installation.md'
const themeconfig = fs.readFileSync(themeconfPath, 'utf-8')
const installation = fs.readFileSync(installPath, 'utf-8')

// get latest Kdu version
console.log(`Checking latest Kdu version...`)
const localVersion = themeconfig.match(/kdu_version: (.*)/)[1]
const version = execSync('npm view kdu@v2-latest version').toString().trim()

if (localVersion === version) {
console.log(`Version is up-to-date.`)
process.exit(0)
}

console.log(`Latest version: ${version}. Downloading dist files...`)

// replace version in theme config
fs.writeFileSync(
themeconfPath,
themeconfig.replace(/kdu_version: .*/, 'kdu_version: ' + version)
)

// grab it from unpkg
Promise.all([download(`kdu.js`), download(`kdu.min.js`)])
.then(([devSize, prodSize]) => {
// replace installation page version and size
fs.writeFileSync(
installPath,
installation
.replace(/kdu_version: .*/, 'kdu_version: ' + version)
.replace(/gz_size:.*/g, `gz_size: "${prodSize}"`)
.replace(/\/kdu@[\d\.]+/g, `/kdu@${version}`)
)
console.log(
`\nSuccessfully updated Kdu version (${version}) and gzip file size (${prodSize}kb).\n`
)
})
.catch((err) => {
console.error(err)
process.exit(1)
})

function download(file) {
return axios({
url: `http://unpkg.com/kdu@${version}/dist/${file}`,
method: 'get'
}).then((res) => {
fs.writeFileSync(`themes/kdu/source/js/${file}`, res.data)
const zipped = zlib.gzipSync(Buffer.from(res.data))
return (zipped.length / 1024).toFixed(2)
})
}
11 changes: 11 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hosting": {
"site": "kdujs-v2",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "docs",
"private": true,
"hexo": {
"version": "6.2.0"
},
"scripts": {
"dev": "hexo server",
"build": "node _scripts/pre-deploy.js && hexo clean && hexo generate",
"deploy": "npm run build && firebase deploy"
},
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"axios": "^0.27.2",
"hexo": "^6.2.0",
"hexo-generator-alias": "git+https://github.com/khanhduy1407/kdujs-hexo-generator-alias.git",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-marked": "^0.3.2",
"hexo-renderer-stylus": "^2.1.0",
"hexo-server": "^3.0.0",
"hoek": "^6.1.2",
"js-yaml": "^4.1.0"
}
}
Empty file added src/_posts/index.md
Empty file.
45 changes: 45 additions & 0 deletions src/coc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Code Of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
Binary file added src/images/components.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 src/images/data.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 src/images/dom-tree.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 src/images/props-events.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 src/images/search-by-algolia.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 src/images/state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
index: true
---
Loading

0 comments on commit 361877a

Please sign in to comment.