From d79ade134aaad168073d23b0ff58cd48dfccb538 Mon Sep 17 00:00:00 2001 From: tangsanzang8888 <126276517+tangsanzang8888@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:40:03 +0800 Subject: [PATCH] Initial commit --- .github/dependabot.yml | 7 ++ .github/workflows/auto-merge.yml | 17 +++++ .github/workflows/gh-pages.yml | 27 ++++++++ .gitignore | 10 +++ LICENSE | 21 ++++++ README.md | 92 ++++++++++++++++++++++++++ _config.landscape.yml | 0 _config.yml | 107 +++++++++++++++++++++++++++++++ package.json | 27 ++++++++ scaffolds/draft.md | 4 ++ scaffolds/page.md | 4 ++ scaffolds/post.md | 5 ++ source/_posts/hello-template.md | 89 +++++++++++++++++++++++++ themes/.gitkeep | 0 14 files changed, 410 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/auto-merge.yml create mode 100644 .github/workflows/gh-pages.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 _config.landscape.yml create mode 100644 _config.yml create mode 100644 package.json create mode 100644 scaffolds/draft.md create mode 100644 scaffolds/page.md create mode 100644 scaffolds/post.md create mode 100644 source/_posts/hello-template.md create mode 100644 themes/.gitkeep diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cd44b57 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000..7b63cbc --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,17 @@ +name: Dependabot Auto Merge +on: + pull_request: + types: [ labeled, edited ] + +jobs: + dependabot: + name: 'Dependabot' + runs-on: ubuntu-latest + permissions: write-all + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..a086fba --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,27 @@ +name: GitHub Pages - CI +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Install and Build 🔧 + run: | + npm install + npm run build + env: + CI: false + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: public # The folder the action should deploy. \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b8ad8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +Thumbs.db +db.json +*.log +node_modules/ +public/ +.deploy*/ +_multiconfig.yml +package-lock.json +yarn.lock \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9239bb8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 JiJi + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d3312f --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +Hexo logo + +# Hexo Template + +> A fast, simple & powerful blog framework, powered by [Node.js](https://nodejs.org). Here is the template of it. + +[Demo](https://mmdjiji.github.io/hexo-template) | +[Official Website](https://hexo.io) | +[Documentation](https://hexo.io/docs/) | +[GitHub](https://github.com/mmdjiji/hexo-template) + +## CI/CD + +This repository uses GitHub Actions for CI/CD. You don't need to build your documents manually. Just commit your documents (then run `git push`), and then turn on the GitHub Pages in the settings to access your online documents. (For this demo is https://mmdjiji.github.io/hexo-template) + +## !!! Attention !!! + +There are two lines to modify in `_config.yml`: + +1. (At line 16) Set your site url here. For example, if you use GitHub Page, set url as `https://username.github.io/project`: +```yml +url: https://jiji.pro/hexo-template +``` + +2. (At line 107) Set your project name here, if your project name is `username` or `username.github.io`, just remove it at the end of `_config.yml`: +```yml +root: /hexo-template +``` + +**If you would not like to do so, it cannot work correctly.** + +## Hexo Features + +- Blazing fast generating +- Support for GitHub Flavored Markdown and most Octopress plugins +- One-command deploy to GitHub Pages, Heroku, etc. +- Powerful API for limitless extensibility +- Hundreds of [themes](https://hexo.io/themes/) & [plugins](https://hexo.io/plugins/) + +## Commands + +**Install Hexo** + +``` bash +$ npm install hexo-cli -g +``` + +Install with [brew](https://brew.sh/) on macOS and Linux: + +```bash +$ brew install hexo +``` + +**Setup your blog** + +``` bash +$ hexo init blog +$ cd blog +``` + +**Start the server** + +``` bash +$ hexo server +``` + +**Create a new post** + +``` bash +$ hexo new "Hello Hexo" +``` + +**Generate static files** + +``` bash +$ hexo generate +``` + +## More Information + +- Read the [documentation](https://hexo.io/) +- Visit the [Awesome Hexo](https://github.com/hexojs/awesome-hexo) list +- Find solutions in [troubleshooting](https://hexo.io/docs/troubleshooting.html) +- 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) +- See the [plugin list](https://hexo.io/plugins/) and the [theme list](https://hexo.io/themes/) on wiki +- Follow [@hexojs](https://twitter.com/hexojs) for latest news + +## License + +Follows [hexojs/hexo](https://github.com/hexojs/hexo) , use [MIT License](LICENSE). + +[![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) diff --git a/_config.landscape.yml b/_config.landscape.yml new file mode 100644 index 0000000..e69de29 diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..e9188ef --- /dev/null +++ b/_config.yml @@ -0,0 +1,107 @@ +# Hexo Configuration +## Docs: https://hexo.io/docs/configuration.html +## Source: https://github.com/hexojs/hexo/ + +# Site +title: Hexo Template +subtitle: '' +description: '' +keywords: +author: JiJi +language: en +timezone: '' + +# URL +## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' +url: https://jiji.pro/hexo-template +permalink: :title/ +permalink_defaults: +pretty_urls: + trailing_index: true # Set to false to remove trailing 'index.html' from permalinks + trailing_html: true # Set to false to remove trailing '.html' from permalinks + +# Directory +source_dir: source +public_dir: public +tag_dir: tags +archive_dir: archives +category_dir: categories +code_dir: downloads/code +i18n_dir: :lang +skip_render: + +# Writing +new_post_name: :title.md # File name of new posts +default_layout: post +titlecase: false # Transform title into titlecase +external_link: + enable: true # Open external links in new tab + field: site # Apply to the whole site + exclude: '' +filename_case: 0 +render_drafts: false +post_asset_folder: false +relative_link: false +future: true +highlight: + enable: true + line_number: true + auto_detect: false + tab_replace: '' + wrap: true + hljs: false +prismjs: + enable: false + preprocess: true + line_number: true + tab_replace: '' + +# Home page setting +# path: Root path for your blogs index page. (default = '') +# per_page: Posts displayed per page. (0 = disable pagination) +# order_by: Posts order. (Order by date descending by default) +index_generator: + path: '' + per_page: 10 + order_by: -date + +# Category & Tag +default_category: uncategorized +category_map: +tag_map: + +# Metadata elements +## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta +meta_generator: true + +# 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: YYYY-MM-DD +time_format: HH:mm:ss +## updated_option supports 'mtime', 'date', 'empty' +updated_option: 'mtime' + +# Pagination +## Set per_page to 0 to disable pagination +per_page: 10 +pagination_dir: page + +# Include / Exclude file(s) +## include:/exclude: options only apply to the 'source/' folder +include: +exclude: +ignore: + +# Extensions +## Plugins: https://hexo.io/plugins/ +## Themes: https://hexo.io/themes/ +theme: landscape + +# Deployment +## Docs: https://hexo.io/docs/one-command-deployment +deploy: + type: '' + +root: /hexo-template diff --git a/package.json b/package.json new file mode 100644 index 0000000..2bc167e --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "hexo-template", + "version": "1.0.0", + "private": true, + "scripts": { + "build": "hexo generate", + "clean": "hexo clean", + "deploy": "hexo deploy", + "server": "hexo server" + }, + "hexo": { + "version": "6.1.0" + }, + "dependencies": { + "hexo": "^6.0.0", + "hexo-deployer-git": "^4.0.0", + "hexo-generator-archive": "^2.0.0", + "hexo-generator-category": "^2.0.0", + "hexo-generator-index": "^3.0.0", + "hexo-generator-tag": "^2.0.0", + "hexo-renderer-ejs": "^2.0.0", + "hexo-renderer-marked": "^6.0.0", + "hexo-renderer-stylus": "^3.0.0", + "hexo-server": "^3.0.0", + "hexo-theme-landscape": "^1.0.0" + } +} diff --git a/scaffolds/draft.md b/scaffolds/draft.md new file mode 100644 index 0000000..498e95b --- /dev/null +++ b/scaffolds/draft.md @@ -0,0 +1,4 @@ +--- +title: {{ title }} +tags: +--- diff --git a/scaffolds/page.md b/scaffolds/page.md new file mode 100644 index 0000000..f01ba3c --- /dev/null +++ b/scaffolds/page.md @@ -0,0 +1,4 @@ +--- +title: {{ title }} +date: {{ date }} +--- diff --git a/scaffolds/post.md b/scaffolds/post.md new file mode 100644 index 0000000..1f9b9a4 --- /dev/null +++ b/scaffolds/post.md @@ -0,0 +1,5 @@ +--- +title: {{ title }} +date: {{ date }} +tags: +--- diff --git a/source/_posts/hello-template.md b/source/_posts/hello-template.md new file mode 100644 index 0000000..fdd6f78 --- /dev/null +++ b/source/_posts/hello-template.md @@ -0,0 +1,89 @@ +--- +title: Hexo Template +--- + +> A fast, simple & powerful blog framework, powered by [Node.js](https://nodejs.org). Here is the template of it. + +[Demo](https://mmdjiji.github.io/hexo-template) | [Official Website](https://hexo.io) | [Documentation](https://hexo.io/docs/) | [GitHub](https://github.com/mmdjiji/hexo-template) + +## CI/CD + +This repository uses GitHub Actions for CI/CD. You don't need to build your documents manually. Just commit your documents (then run `git push`), and then turn on the GitHub Pages in the settings to access your online documents. (For this demo is https://mmdjiji.github.io/hexo-template) + +## !!! Attention !!! + +There are two lines to modify in `_config.yml`: + +1. (At line 16) Set your site url here. For example, if you use GitHub Page, set url as `https://username.github.io/project`: +```yml +url: https://jiji.pro/hexo-template +``` + +2. (At line 107) Set your project name here, if your project name is `username` or `username.github.io`, just remove it at the end of `_config.yml`: +```yml +root: /hexo-template +``` + +**If you would not like to do so, it cannot work correctly.** + +## Hexo Features + +- Blazing fast generating +- Support for GitHub Flavored Markdown and most Octopress plugins +- One-command deploy to GitHub Pages, Heroku, etc. +- Powerful API for limitless extensibility +- Hundreds of [themes](https://hexo.io/themes/) & [plugins](https://hexo.io/plugins/) + +## Commands + +**Install Hexo** + +``` bash +$ npm install hexo-cli -g +``` + +Install with [brew](https://brew.sh/) on macOS and Linux: + +```bash +$ brew install hexo +``` + +**Setup your blog** + +``` bash +$ hexo init blog +$ cd blog +``` + +**Start the server** + +``` bash +$ hexo server +``` + +**Create a new post** + +``` bash +$ hexo new "Hello Hexo" +``` + +**Generate static files** + +``` bash +$ hexo generate +``` + +## More Information + +- Read the [documentation](https://hexo.io/) +- Visit the [Awesome Hexo](https://github.com/hexojs/awesome-hexo) list +- Find solutions in [troubleshooting](https://hexo.io/docs/troubleshooting.html) +- 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) +- See the [plugin list](https://hexo.io/plugins/) and the [theme list](https://hexo.io/themes/) on wiki +- Follow [@hexojs](https://twitter.com/hexojs) for latest news + +## License + +Follows [hexojs/hexo](https://github.com/hexojs/hexo) , use [MIT License](LICENSE). + +[![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) diff --git a/themes/.gitkeep b/themes/.gitkeep new file mode 100644 index 0000000..e69de29