Skip to content

Commit 9310716

Browse files
author
zangchao
committed
提交hexo
1 parent d7e7cc2 commit 9310716

File tree

282 files changed

+30498
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+30498
-1
lines changed

CODE_OF_CONDUCT.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or
22+
advances of any kind
23+
* Trolling, insulting or derogatory comments, and personal or political attacks
24+
* Public or private harassment
25+
* Publishing others' private information, such as a physical or email
26+
address, without their explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a
28+
professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33+
34+
Community leaders 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, and will communicate reasons for moderation decisions when appropriate.
35+
36+
## Scope
37+
38+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39+
40+
## Enforcement
41+
42+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at report@hexo.io. All complaints will be reviewed and investigated promptly and fairly.
43+
44+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45+
46+
## Enforcement Guidelines
47+
48+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49+
50+
### 1. Correction
51+
52+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53+
54+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55+
56+
### 2. Warning
57+
58+
**Community Impact**: A violation through a single incident or series of actions.
59+
60+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61+
62+
### 3. Temporary Ban
63+
64+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65+
66+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67+
68+
### 4. Permanent Ban
69+
70+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71+
72+
**Consequence**: A permanent ban from any sort of public interaction within the project community.
73+
74+
## Attribution
75+
76+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78+
79+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80+
81+
[homepage]: https://www.contributor-covenant.org
82+
83+
For answers to common questions about this code of conduct, see the FAQ at
84+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
85+

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2012-present Tommy Chen
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.

README.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,102 @@
1-
# codeaike.github.io
1+
<img src="https://raw.githubusercontent.com/hexojs/logo/master/hexo-logo-avatar.png" alt="Hexo logo" width="100" height="100" align="right" />
2+
3+
# Hexo
4+
5+
> A fast, simple & powerful blog framework, powered by [Node.js](https://nodejs.org).
6+
7+
[Website](https://hexo.io) |
8+
[Documentation](https://hexo.io/docs/) |
9+
[Installation Guide](https://hexo.io/docs/#Installation) |
10+
[Contribution Guide](https://hexo.io/docs/contributing) |
11+
[Code of Conduct](CODE_OF_CONDUCT.md) |
12+
[API](https://hexo.io/api/) |
13+
[Twitter](https://twitter.com/hexojs)
14+
15+
[![NPM version](https://badge.fury.io/js/hexo.svg)](https://www.npmjs.com/package/hexo)
16+
![Required Node version](https://img.shields.io/node/v/hexo)
17+
[![Build Status](https://github.com/hexojs/hexo/workflows/Tester/badge.svg)](https://github.com/hexojs/hexo/actions?query=workflow%3ATester)
18+
[![dependencies Status](https://img.shields.io/librariesio/release/npm/hexo)](https://libraries.io/npm/hexo)
19+
[![Coverage Status](https://coveralls.io/repos/hexojs/hexo/badge.svg?branch=master)](https://coveralls.io/r/hexojs/hexo?branch=master)
20+
[![Gitter](https://badges.gitter.im/hexojs/hexo.svg)](https://gitter.im/hexojs/hexo)
21+
[![Discord Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/teM2Anj)
22+
[![Telegram Chat](https://img.shields.io/badge/chat-on%20telegram-32afed.svg)](https://t.me/hexojs)
23+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhexojs%2Fhexo.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fhexojs%2Fhexo?ref=badge_shield)
24+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
25+
26+
## Features
27+
28+
- Blazing fast generating
29+
- Support for GitHub Flavored Markdown and most Octopress plugins
30+
- One-command deploy to GitHub Pages, Heroku, etc.
31+
- Powerful API for limitless extensibility
32+
- Hundreds of [themes](https://hexo.io/themes/) & [plugins](https://hexo.io/plugins/)
33+
34+
## Quick Start
35+
36+
**Install Hexo**
37+
38+
``` bash
39+
$ npm install hexo-cli -g
40+
```
41+
42+
Install with [brew](https://brew.sh/) on macOS and Linux:
43+
44+
```bash
45+
$ brew install hexo
46+
```
47+
48+
**Setup your blog**
49+
50+
``` bash
51+
$ hexo init blog
52+
$ cd blog
53+
```
54+
55+
**Start the server**
56+
57+
``` bash
58+
$ hexo server
59+
```
60+
61+
**Create a new post**
62+
63+
``` bash
64+
$ hexo new "Hello Hexo"
65+
```
66+
67+
**Generate static files**
68+
69+
``` bash
70+
$ hexo generate
71+
```
72+
73+
## More Information
74+
75+
- Read the [documentation](https://hexo.io/)
76+
- Visit the [Awesome Hexo](https://github.com/hexojs/awesome-hexo) list
77+
- Find solutions in [troubleshooting](https://hexo.io/docs/troubleshooting.html)
78+
- Join discussion on [Google Group](https://groups.google.com/group/hexo), [Discord](https://discord.gg/teM2Anj), [Gitter](https://gitter.im/hexojs/hexo) or [Telegram](https://t.me/hexojs)
79+
- See the [plugin list](https://hexo.io/plugins/) and the [theme list](https://hexo.io/themes/) on wiki
80+
- Follow [@hexojs](https://twitter.com/hexojs) for latest news
81+
82+
## Contributing
83+
84+
We welcome you to join the development of Hexo. Please see [contributing document](https://hexo.io/docs/contributing). 🤗
85+
86+
Also, we welcome PR or issue to [official-plugins](https://github.com/hexojs).
87+
88+
## Contributors
89+
90+
[![](https://opencollective.com/Hexo/contributors.svg?width=890)](https://github.com/hexojs/hexo/graphs/contributors)
91+
92+
## Backers
93+
94+
[![Backers](https://opencollective.com/hexo/tiers/backers.svg?avatarHeight=36&width=600)](https://opencollective.com/hexo)
95+
96+
## Sponsors
97+
98+
[![Sponsors](https://opencollective.com/hexo/tiers/sponsors.svg?width=600)](https://opencollective.com/hexo)
99+
100+
## License
101+
102+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhexojs%2Fhexo.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fhexojs%2Fhexo?ref=badge_large)

bin/hexo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
require('hexo-cli')();

lib/box/file.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import type Promise from 'bluebird';
2+
import { readFile, readFileSync, stat, statSync, type ReadFileOptions } from 'hexo-fs';
3+
import type fs from 'fs';
4+
5+
class File {
6+
public source: string;
7+
public path: string;
8+
public params: any;
9+
public type: string;
10+
static TYPE_CREATE: 'create';
11+
static TYPE_UPDATE: 'update';
12+
static TYPE_SKIP: 'skip';
13+
static TYPE_DELETE: 'delete';
14+
15+
constructor({ source, path, params, type }) {
16+
this.source = source;
17+
this.path = path;
18+
this.params = params;
19+
this.type = type;
20+
}
21+
22+
read(options?: ReadFileOptions): Promise<string> {
23+
return readFile(this.source, options) as Promise<string>;
24+
}
25+
26+
readSync(options?: ReadFileOptions): string {
27+
return readFileSync(this.source, options) as string;
28+
}
29+
30+
stat(): Promise<fs.Stats> {
31+
return stat(this.source);
32+
}
33+
34+
statSync(): fs.Stats {
35+
return statSync(this.source);
36+
}
37+
}
38+
39+
File.TYPE_CREATE = 'create';
40+
File.TYPE_UPDATE = 'update';
41+
File.TYPE_SKIP = 'skip';
42+
File.TYPE_DELETE = 'delete';
43+
44+
export = File;

0 commit comments

Comments
 (0)