Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
NeptuneZhao committed May 21, 2024
1 parent e654ff7 commit 1db710d
Show file tree
Hide file tree
Showing 55 changed files with 9,469 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
42 changes: 42 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: GitHub Pages

on:
push:
branches:
# The branch where the project source code resides
# 项目源代码所在的分支
- main
- master
- valaxy

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [lts/*]
os: [ubuntu-latest]
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- name: 📦 Install Dependencies
run: npm i

- name: 🌌 Build Valaxy Blog
run: npm run build

- name: 🪤 Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# valaxy

valaxy-fuse-list.json

# vite-ssg

.vite-ssg-dist
.vite-ssg-temp

temp/

.DS_Store
*.local
dist
dist-ssr
node_modules
.idea/
*.log

components.d.ts
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# for pnpm
shamefully-hoist=true
strict-peer-dependencies=false
38 changes: 38 additions & 0 deletions .valaxy/typed-router.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️
// It's recommended to commit this file.
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry.

declare module 'vue-router/auto-routes' {
import type {
RouteRecordInfo,
ParamValue,
ParamValueOneOrMore,
ParamValueZeroOrMore,
ParamValueZeroOrOne,
} from 'unplugin-vue-router/types'

/**
* Route name map generated by unplugin-vue-router
*/
export interface RouteNamedMap {
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
'/[...path]': RouteRecordInfo<'/[...path]', '/:path(.*)', { path: ParamValue<true> }, { path: ParamValue<false> }>,
'/404': RouteRecordInfo<'/404', '/404', Record<never, never>, Record<never, never>>,
'/about/': RouteRecordInfo<'/about/', '/about', Record<never, never>, Record<never, never>>,
'/about/site': RouteRecordInfo<'/about/site', '/about/site', Record<never, never>, Record<never, never>>,
'/archives/': RouteRecordInfo<'/archives/', '/archives', Record<never, never>, Record<never, never>>,
'/categories/': RouteRecordInfo<'/categories/', '/categories', Record<never, never>, Record<never, never>>,
'/friends/': RouteRecordInfo<'/friends/', '/friends', Record<never, never>, Record<never, never>>,
'/girls/': RouteRecordInfo<'/girls/', '/girls', Record<never, never>, Record<never, never>>,
'/links/': RouteRecordInfo<'/links/', '/links', Record<never, never>, Record<never, never>>,
'/page/[page]': RouteRecordInfo<'/page/[page]', '/page/:page', { page: ParamValue<true> }, { page: ParamValue<false> }>,
'/posts/hello-valaxy': RouteRecordInfo<'/posts/hello-valaxy', '/posts/hello-valaxy', Record<never, never>, Record<never, never>>,
'/posts/physics-research': RouteRecordInfo<'/posts/physics-research', '/posts/physics-research', Record<never, never>, Record<never, never>>,
'/posts/run-blog': RouteRecordInfo<'/posts/run-blog', '/posts/run-blog', Record<never, never>, Record<never, never>>,
'/tags/': RouteRecordInfo<'/tags/', '/tags', Record<never, never>, Record<never, never>>,
'/zhihu/': RouteRecordInfo<'/zhihu/', '/zhihu', Record<never, never>, Record<never, never>>,
}
}
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"antfu.iconify",
"antfu.unocss",
"csstools.postcss",
"dbaeumer.vscode-eslint",
"vue.volar",
"lokalise.i18n-ally",
"YunYouJun.valaxy"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"cSpell.words": ["valaxy", "valaxyjs"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.keystyle": "nested",
"i18n-ally.localesPaths": "locales",
"i18n-ally.sortKeys": true,
"prettier.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": false,
"files.associations": {
"*.css": "postcss"
},
"svg.preview.background": "editor"
}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:16-alpine as build-stage

WORKDIR /app
RUN corepack enable

COPY .npmrc package.json ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install

COPY . .
RUN pnpm build

FROM nginx:stable-alpine as production-stage

COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# create-valaxy

Example: [valaxy.site](https://valaxy.site)

## Usage

```bash
# install
npm i
# or pnpm i

# start
npm run dev
# or pnpm dev
```

See `http://localhost:4859/`, have fun!

### Config

Modify `valaxy.config.ts` to custom your blog.

English & Chinese Docs is coming!

> Wait a minute.
### Docker

```bash
docker build . -t your-valaxy-blog-name:latest
```

## Structure

In most cases, you only need to work in the `pages` folder.

### Main folders

- `pages`: your all pages
- `posts`: write your posts here, will be counted as posts
- `styles`: override theme styles, `index.scss`/`vars.csss`/`index.css` will be loaded automatically
- `components`: custom your vue components (will be loaded automatically)
- `layouts`: custom layouts (use it by `layout: xxx` in md)
- `locales`: custom i18n

### Other

- `.vscode`: recommend some useful plugins & settings, you can preview icon/i18n/class...
- `.github`: GitHub Actions to auto build & deploy to GitHub Pages
- `netlify.toml`: for [netlify](https://www.netlify.com/)
- `vercel.json`: for [vercel](https://vercel.com/)
7 changes: 7 additions & 0 deletions components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Components

Components in this dir will be auto-registered and on-demand, powered by [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components).

## Icons

You can use icons from almost any icon sets by the power of [Iconify](https://iconify.design/).
3 changes: 3 additions & 0 deletions layouts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# layouts

You can override valaxy/theme layouts here.
3 changes: 3 additions & 0 deletions locales/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# locales

You can custom i18n here.
4 changes: 4 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# you can custom locale
intro:
desc: Valaxy Template
hi: Hello, Valaxy!
4 changes: 4 additions & 0 deletions locales/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 你可以像这样自定义 i18n
intro:
desc: Valaxy 模版
hi: 你好,Valaxy
17 changes: 17 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[build]
publish = "dist"
command = "npm run build"

[build.environment]
NODE_VERSION = "16"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200

[[headers]]
for = "/manifest.webmanifest"

[headers.values]
Content-Type = "application/manifest+json"
Loading

0 comments on commit 1db710d

Please sign in to comment.