Compare commits

...
27 Commits
Author SHA1 Message Date
github-actions[bot] 0a89426c93 chore: release v2.7.2 2023-12-20 17:20:40 +00:00
qwqcode 7a026ef0e2 fix(sidebar): sidebar language switch and config save issue (#708) 2023-12-21 01:14:49 +08:00
qwqcode 855f6c261f docs(i18n): add translation for open button 2023-12-20 23:35:58 +08:00
qwqcode 7099598a92 fix(ui): add referrerpolicy attribute for iframe (#687) (#707) 2023-12-20 23:34:46 +08:00
qwqcode ad8851ea94 fix(ui/pagination): auto switch page by url hashtag issue (#693) 2023-12-20 21:44:06 +08:00
qwqcode def9dc2707 fix(ui/sidebar): refactor settings and fix save issue (#677) (#706) 2023-12-20 20:53:04 +08:00
Mr.Hopeandqwqcode 91228a9446 docs(refactor): organize the pkgs and fix some issues (#702)
* docs: rebuild docs

* chore: fix eslint

* ci: add docs build test

* update test-docs.yml

* fix script

* add netlify.toml

* fix docs:patch

---------

Co-authored-by: qwqcode <qwqcode@gmail.com>
2023-12-19 21:55:04 +08:00
qwqcode 7a0a9dbd92 chore(ci): fix ci pnpm version 2023-12-19 17:07:23 +08:00
dependabot[bot] 441c4fa6a9 chore(deps/ui): bump the dev-deps group in /ui with 3 updates (#698)
Bumps the dev-deps group in /ui with 3 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [@vue/tsconfig](https://github.com/vuejs/tsconfig).


Updates `@typescript-eslint/eslint-plugin` from 6.14.0 to 6.15.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.15.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.14.0 to 6.15.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.15.0/packages/parser)

Updates `@vue/tsconfig` from 0.5.0 to 0.5.1
- [Commits](https://github.com/vuejs/tsconfig/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
- dependency-name: "@vue/tsconfig"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 17:04:01 +08:00
Mr.Hope a16169f69d chore(docs): fix redocly config (#696) 2023-12-19 17:00:58 +08:00
da42676656 chore(deps): bump frontend deps (#679)
* chore: bump deps

* chore: add exports field

* chore: remove src folder

* fix: vite cjs deprecated warning

* chore(ci): fix test ci

* chore: update linter

---------

Co-authored-by: qwqcode <qwqcode@gmail.com>
Co-authored-by: qwqcode <22412567+qwqcode@users.noreply.github.com>
2023-12-19 16:54:34 +08:00
qwqcode f3a42e892f chore(ci): fix test ci 2023-12-18 23:59:18 +08:00
Mr.Hope 6a53597485 chore(docs): update README.md (#691) 2023-12-18 23:19:46 +08:00
qwqcode 60336e567d test(ci): migrate UI tests back to Github Actions (#692) 2023-12-18 23:16:16 +08:00
Mr.Hopeandqwqcode 8918c62ffd chore: update description and fix typos (#684)
* chore: update description

* chore: fix typos

* chore: tweaks

* chore: fix case

---------

Co-authored-by: qwqcode <qwqcode@gmail.com>
2023-12-18 21:21:42 +08:00
qwqcode 362fc19cd8 feat: patch locale config from zh-cn to zh-CN (#678) 2023-12-18 20:17:04 +08:00
qwqcode 1b938752ff fix(ui/dark-mode): potential memory leak issue in auto mode (#688) 2023-12-18 19:14:58 +08:00
qwqcode 835a886dc8 test(ssg): add SSG test case (#675) 2023-12-18 19:09:04 +08:00
qwqcode f390b57fe7 refactor(ui): move window references into function scope (#675) 2023-12-18 19:05:57 +08:00
qwqcode 6d21a0f204 refactor(ui/api): losing coupling between Api and User 2023-12-18 18:37:18 +08:00
qwqcode a1d0c37828 refactor(ui/user): user class no longer globally singleton 2023-12-18 18:37:18 +08:00
github-actions[bot] 763fbc417e chore: release v2.7.1 2023-12-17 17:24:29 +00:00
qwqcode 776d5e66fe docs(i18n): add translation of update notice 2023-12-18 01:22:53 +08:00
qwqcode 10c0975ce0 fix(build): generate source maps to ease debugging 2023-12-18 00:53:54 +08:00
qwqcode 7286642fc9 fix(ui): static method export issue in JS module (#669) 2023-12-18 00:46:56 +08:00
qwqcode 8db4fb3524 fix(cout-widget): loadCountWidget issue 2023-12-17 23:50:44 +08:00
qwqcode 08be04979d chore(docs): bump Artalk to v2.7.0 2023-12-17 20:33:21 +08:00
219 changed files with 11461 additions and 11149 deletions

No files matched your search

+1 -31
View File
@@ -10,7 +10,7 @@ executors:
- image: cimg/base:stable
node:
docker:
- image: 'cimg/node:18.17.1'
- image: 'cimg/node:18.19.0'
go:
docker:
- image: cimg/go:1.21.3
@@ -19,9 +19,6 @@ parameters:
trigger-app:
type: boolean
default: false
trigger-ui:
type: boolean
default: false
run-them-all:
type: boolean
default: false
@@ -60,25 +57,6 @@ jobs:
flags: go
file: /tmp/test-reports/coverage.out
## Frontend
test_ui:
executor: node
steps:
- node/install
- checkout
- run:
name: Print the node version
command: node -v
- run:
name: Install pnpm
command: npm i -g pnpm@8.7.0
- run:
name: Install Dependencies
command: pnpm --dir ./ui install --frozen-lockfile
- run:
name: Build Artalk
command: pnpm --dir ./ui build:all
all_projects:
executor: base
steps:
@@ -95,14 +73,6 @@ workflows:
jobs:
- test_app
build-ui:
when:
or:
- << pipeline.parameters.trigger-ui >>
- << pipeline.parameters.run-them-all >>
jobs:
- test_ui
build-shared-other:
when: << pipeline.parameters.run-them-all >>
jobs:
-1
View File
@@ -17,7 +17,6 @@ workflows:
mapping: |
(cmd|internal|server|pkg|test|conf)/.* trigger-app true
main.go|go.mod|go.sum trigger-app true
(ui)/.* trigger-ui true
base-revision: master # git branch name
config-path: .circleci/conditional_config.yml
filters:
+23 -41
View File
@@ -13,50 +13,32 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
# set for building docs
working-directory: ./docs
steps:
# - name: Wait for other docs build to succeed
# uses: lewagon/wait-on-check-action@v1.2.0
# with:
# running-workflow-name: 'Docs CN Mirror Deploy'
# check-name: 'Build Docs'
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# allowed-conclusions: success,skipped,cancelled
# wait-interval: 10
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install dependencies
run: pnpm install
- name: Build Docs
run: pnpm docs:build
- name: Build Docs
run: pnpm docs:build
- name: Deploy
uses: TencentCloud/cos-action@v1
with:
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
cos_bucket: ${{ secrets.DOCS_CN_COS_BUCKET }}
cos_region: ${{ secrets.DOCS_CN_COS_REGION }}
local_path: .vitepress/dist/
remote_path: /
clean: true
- name: Deploy
uses: TencentCloud/cos-action@v1
with:
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
cos_bucket: ${{ secrets.DOCS_CN_COS_BUCKET }}
cos_region: ${{ secrets.DOCS_CN_COS_REGION }}
local_path: .vitepress/dist/
remote_path: /
clean: true
+32
View File
@@ -0,0 +1,32 @@
name: Test Docs
on:
pull_request:
paths:
- "docs/**"
push:
paths:
- "docs/**"
jobs:
test_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build Docs
run: pnpm docs:build
+47
View File
@@ -0,0 +1,47 @@
name: Test Frontend
on:
push:
paths:
- 'ui/**'
pull_request:
paths:
- 'ui/**'
jobs:
test_ui:
strategy:
matrix:
node: [18, 20]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./ui
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm
cache-dependency-path: './ui/pnpm-lock.yaml'
- name: Install Dependencies
run: pnpm --dir ./ui install --frozen-lockfile
- name: Package Build Test
run: pnpm build:all
# TODO: Add unit test
# - name: Unit test
# run: pnpm test
+39
View File
@@ -1,4 +1,43 @@
## [v2.7.2](https://github.com/ArtalkJS/Artalk/compare/v2.7.1...v2.7.2) (2023-12-20)
### Features
* patch `locale` config from `zh-cn` to `zh-CN` ([#678](https://github.com/ArtalkJS/Artalk/issues/678))
### Bug Fixes
* **sidebar:** sidebar language switch and config save issue ([#708](https://github.com/ArtalkJS/Artalk/issues/708))
* **ui:** add `referrerpolicy` attribute for iframe ([#687](https://github.com/ArtalkJS/Artalk/issues/687)) ([#707](https://github.com/ArtalkJS/Artalk/issues/707))
* **ui/dark-mode:** potential memory leak issue in auto mode ([#688](https://github.com/ArtalkJS/Artalk/issues/688))
* **ui/pagination:** auto switch page by url hashtag issue ([#693](https://github.com/ArtalkJS/Artalk/issues/693))
* **ui/sidebar:** refactor settings and fix save issue ([#677](https://github.com/ArtalkJS/Artalk/issues/677)) ([#706](https://github.com/ArtalkJS/Artalk/issues/706))
### Code Refactoring
* **ui:** move window references into function scope ([#675](https://github.com/ArtalkJS/Artalk/issues/675))
* **ui/api:** losing coupling between `Api` and `User`
* **ui/user:** user class no longer globally singleton
### Documentation
* **i18n:** add translation for `open` button
* **refactor:** organize the pkgs and fix some issues ([#702](https://github.com/ArtalkJS/Artalk/issues/702))
## [v2.7.1](https://github.com/ArtalkJS/Artalk/compare/v2.7.0...v2.7.1) (2023-12-17)
### Bug Fixes
* **build:** generate source maps to ease debugging
* **cout-widget:** `loadCountWidget` issue
* **ui:** static method export issue in JS module ([#669](https://github.com/ArtalkJS/Artalk/issues/669))
### Documentation
* **i18n:** add translation of update notice
## [v2.7.0](https://github.com/ArtalkJS/Artalk/compare/v2.6.4...v2.7.0) (2023-12-17)
### Features
+11 -11
View File
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
@@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at artalkjs@gmail.com.
reported to the community leaders responsible for enforcement at <artalkjs@gmail.com>.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
+1 -1
View File
@@ -6,7 +6,7 @@ This guide is for developers who want to contribute to the project.
To develop Artalk, including the frontend and backend, you need to install the following tools:
- [Node.js](https://nodejs.org/en/) (>= 16.0.0)
- [Node.js](https://nodejs.org/en/) (>= 18.12.0)
- [Go](https://golang.org/) (>= 1.21)
- [Docker](https://www.docker.com/) (>= 20.10.0) (optional)
- [Docker Compose](https://docs.docker.com/compose/) (>= 1.29.0) (optional)
+1 -1
View File
@@ -6,7 +6,7 @@ WORKDIR /source
# install tools
RUN set -ex \
&& apk add --no-cache make git gcc musl-dev nodejs bash npm\
&& npm install -g pnpm@8.7.0
&& npm install -g pnpm@8.12.1
# download go deps
# (cache by separating the downloading of deps)
+4 -4
View File
@@ -4,12 +4,12 @@
# Artalk
[![](https://img.shields.io/npm/v/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![](https://img.shields.io/npm/dt/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![](https://badgen.net/bundlephobia/minzip/artalk?style=flat-square)](https://bundlephobia.com/package/artalk)
[![npm 版本](https://img.shields.io/npm/v/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![npm 下载量](https://img.shields.io/npm/dt/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![尺寸](https://badgen.net/bundlephobia/minzip/artalk?style=flat-square)](https://bundlephobia.com/package/artalk)
[![CircleCI](https://circleci.com/gh/ArtalkJS/Artalk/tree/master.svg?style=svg)](https://circleci.com/gh/ArtalkJS/Artalk/tree/master)
> 🌌 A Self-hosted comment system
> 🌌 A self-hosted comment system
[简体中文](./README.md) / [Documentation](https://artalk.js.org) / [Releases](https://github.com/ArtalkJS/Artalk/releases) / [Artalk](https://github.com/ArtalkJS/Artalk)
+3 -3
View File
@@ -4,8 +4,8 @@
# Artalk
[![](https://img.shields.io/npm/v/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![](https://img.shields.io/npm/dt/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![npm version](https://img.shields.io/npm/v/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![npm downloads](https://img.shields.io/npm/dt/artalk.svg?style=flat-square)](https://www.npmjs.com/package/artalk)
[![Docker Pulls](https://img.shields.io/docker/pulls/artalk/artalk-go?style=flat-square)](https://hub.docker.com/r/artalk/artalk-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/ArtalkJS/Artalk?style=flat-square)](https://goreportcard.com/report/github.com/ArtalkJS/Artalk)
[![CircleCI](https://img.shields.io/circleci/build/gh/ArtalkJS/Artalk?style=flat-square)](https://circleci.com/gh/ArtalkJS/Artalk/tree/master)
@@ -129,7 +129,7 @@ see [CONTRIBUTING.md](./CONTRIBUTING.md)
感谢社区提供的帮助与反馈,若有好的建议与意见欢迎前往 [ISSUES](https://github.com/ArtalkJS/Artalk/issues) 随时告知。
## TODOs
## TODOs
- [x] Golang 后端
- [x] 多数据库支持
+2 -2
View File
@@ -26,7 +26,7 @@ var Banner = `
Artalk (` + Version + `)
-> A Selfhosted Comment System.
-> A Self-hosted Comment System.
-> https://artalk.js.org
`
@@ -50,7 +50,7 @@ func New() *ArtalkCmd {
cmd := &ArtalkCmd{
RootCmd: &cobra.Command{
Use: "artalk",
Short: "Artalk: Your self-hosted comment system",
Short: "Artalk: A self-hosted comment system",
Long: Banner,
Version: Version,
Run: func(cmd *cobra.Command, args []string) {
-2
View File
@@ -1,2 +0,0 @@
shamefully-hoist=true
auto-install-peers=true
-211
View File
@@ -1,211 +0,0 @@
import { defineConfig } from 'vitepress'
import iterator from 'markdown-it-for-inline'
import * as Version from '../code/ArtalkVersion.json'
export default defineConfig({
title: 'Artalk',
description: '一款简洁的自托管评论系统',
lang: 'zh-CN',
head: [
['link', { rel: 'icon', href: '/favicon.png' }],
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi' }],
// artalk
// ['link', { href: `https://npm.elemecdn.com/artalk@${Version.latest}/dist/Artalk.css`, rel: 'stylesheet' }],
['link', { href: `https://artalk.qwqaq.com/dist/Artalk.css`, rel: 'stylesheet' }],
// ['script', { src: ArtalkCDN.JS }],
// light gallery
['link', { href: 'https://npm.elemecdn.com/lightgallery@2.3.0/css/lightgallery.css', rel: 'stylesheet' }],
['script', { src: 'https://npm.elemecdn.com/lightgallery@2.3.0/lightgallery.min.js' }],
// katex
// ['link', { href: "https://npm.elemecdn.com/katex@0.15.3/dist/katex.min.css", rel: 'stylesheet' }],
// ['script', { src: 'https://npm.elemecdn.com/katex@0.15.3/dist/katex.min.js' }],
// ['script', { src: 'https://npm.elemecdn.com/@artalkjs/plugin-katex/dist/artalk-plugin-katex.js' }],
],
lastUpdated: true,
markdown: {
// @link https://github.com/shikijs/shiki
theme: {
light: 'github-light',
dark: 'github-dark',
},
config: (md) => {
md.use(iterator, 'artalk_version', 'text', function (tokens, idx) {
tokens[idx].content = tokens[idx].content.replace(/:ArtalkVersion:/g, Version.latest)
});
md.use(iterator, 'artalk_version_link', 'link_open', (tokens, idx) => {
const href = tokens[idx].attrGet('href')
tokens[idx].attrSet('href', href.replace(/:ArtalkVersion:/g, Version.latest))
});
},
},
locales: {
root: {
label: '简体中文',
lang: 'zh'
},
en: {
label: 'English',
lang: 'en',
link: 'https://artalk-js-org.translate.goog/guide/intro?_x_tr_sl=auto&_x_tr_tl=en-US&_x_tr_hl=en-US&_x_tr_pto=wapp'
// link: '/en/'
}
},
themeConfig: {
sidebar: {
"/guide/": [
{
text: "快速开始",
collapsed: false,
items: [
{ text: '项目介绍', link: '/guide/intro.md' },
{ text: '程序部署', link: '/guide/deploy.md' },
{ text: '数据迁移', link: '/guide/transfer.md' },
]
},
{
text: "核心指南",
collapsed: false,
items: [
{ text: '侧边栏', link: '/guide/frontend/sidebar.md' },
{ text: '邮件通知', link: '/guide/backend/email.md' },
{ text: '多元推送', link: '/guide/backend/admin_notify.md' },
{ text: '评论审核', link: '/guide/backend/moderator.md' },
{ text: '验证码', link: '/guide/backend/captcha.md' },
{ text: '图片上传', link: '/guide/backend/img-upload.md' },
{ text: '账户与多站点', link: '/guide/backend/multi-site.md' },
{ text: '解析相对路径', link: '/guide/backend/relative-path.md' },
{ text: '如何配置界面', link: '/guide/backend/fe-control.md' },
{ text: 'English (i18n)', link: '/guide/frontend/i18n.md' },
]
},
{
text: "进阶指南",
collapsed: false,
items: [
{ text: '表情包', link: '/guide/frontend/emoticons.md' },
{ text: '浏览量统计', link: '/guide/frontend/pv.md' },
{ text: 'Latex', link: '/guide/frontend/latex.md' },
{ text: '图片灯箱', link: '/guide/frontend/lightbox.md' },
{ text: 'IP 归属地', link: '/guide/frontend/ip-region.md' },
{ text: '精简版本', link: '/guide/frontend/artalk-lite.md' },
{ text: '置入博客', link: '/guide/frontend/import-blog.md' },
{ text: '置入框架', link: '/guide/frontend/import-framework.md' },
{ text: '前端 API', link: '/develop/fe-api.md', },
{ text: '开发文档', link: '/develop/index.md', },
],
},
{
text: "配置文档",
collapsed: true,
items: [
{ text: '后端配置', link: '/guide/backend/config.md' },
{ text: '前端配置', link: '/guide/frontend/config.md' },
]
},
{
text: "部署说明",
collapsed: true,
items: [
{ text: '守护进程', link: '/guide/backend/daemon.md' },
{ text: '反向代理', link: '/guide/backend/reverse-proxy.md' },
{ text: '编译构建', link: '/guide/backend/build.md' },
{ text: '程序升级', link: '/guide/backend/update.md' },
{ text: 'Docker', link: '/guide/backend/docker.md' },
]
},
{
text: '更多内容',
collapsed: true,
items: [
{ text: '安全防范', link: '/guide/security.md' },
{ text: '扩展阅读', link: '/guide/extras.md' },
{ text: '案例展示', link: '/guide/cases.md' },
{ text: '关于我们', link: '/guide/about.md' },
]
}
],
"/develop/": [
{
text: '开发文档',
items: [
{ text: '开发说明', link: '/develop/index.md', },
{ text: '前端 API', link: '/develop/fe-api.md', },
{ text: '前端 Event', link: '/develop/event.md', },
{ text: '插件开发', link: '/develop/plugs.md' },
{ text: '🔬 HTTP API', link: 'https://artalk.js.org/http-api.html', },
{ text: '📖 Contributing Guide', link: 'https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md' },
{ text: '🔖 Code of Conduct', link: 'https://github.com/ArtalkJS/Artalk/blob/master/CODE_OF_CONDUCT.md' },
]
}
]
},
nav: [
// NavbarItem
{
text: '介绍',
link: '/guide/intro',
},
{
text: '部署',
link: '/guide/deploy',
},
{
text: '配置',
link: '/guide/backend/config',
},
{
text: '迁移',
link: '/guide/transfer',
},
{
text: '案例',
link: '/guide/cases',
},
{
text: '开发',
link: '/develop/',
},
// NavbarGroup
{
text: '传送',
items: [
{
text: '代码仓库',
link: 'https://github.com/ArtalkJS/Artalk',
},
{
text: '文档镜像 (国内)',
link: 'https://artalk-docs.qwqaq.com'
}
],
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/ArtalkJS/Artalk' }
],
search: {
provider: 'algolia',
options: {
appId: '2WNJ32WVTY',
apiKey: '6c6ebc345a87b738264f19095b78c91c',
indexName: 'artalk-js',
searchParameters: {
facetFilters: ['lang:zh-CN']
}
}
},
editLink: {
pattern: 'https://github.com/ArtalkJS/Artalk/edit/master/docs/:path',
text: '完善文档'
},
}
})
-3
View File
@@ -1,3 +0,0 @@
{
"latest": "2.7.0"
}
+2
View File
@@ -0,0 +1,2 @@
.vitepress/dist/**
.vitepress/cache/**
+253
View File
@@ -0,0 +1,253 @@
import { defineConfig } from "vitepress";
import iterator from "markdown-it-for-inline";
import * as Version from "../code/ArtalkVersion.json";
export default defineConfig({
title: "Artalk",
description: "一款简洁的自托管评论系统",
lang: "zh-CN",
head: [
["link", { rel: "icon", href: "/favicon.png" }],
[
"meta",
{
name: "viewport",
content:
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi",
},
],
// artalk
// ['link', { href: `https://npm.elemecdn.com/artalk@${Version.latest}/dist/Artalk.css`, rel: 'stylesheet' }],
[
"link",
{ href: `https://artalk.qwqaq.com/dist/Artalk.css`, rel: "stylesheet" },
],
// ['script', { src: ArtalkCDN.JS }],
// light gallery
[
"link",
{
href: "https://npm.elemecdn.com/lightgallery@2.3.0/css/lightgallery.css",
rel: "stylesheet",
},
],
[
"script",
{
src: "https://npm.elemecdn.com/lightgallery@2.3.0/lightgallery.min.js",
},
],
// katex
// ['link', { href: "https://npm.elemecdn.com/katex@0.15.3/dist/katex.min.css", rel: 'stylesheet' }],
// ['script', { src: 'https://npm.elemecdn.com/katex@0.15.3/dist/katex.min.js' }],
// ['script', { src: 'https://npm.elemecdn.com/@artalkjs/plugin-katex/dist/artalk-plugin-katex.js' }],
],
lastUpdated: true,
markdown: {
// @link https://github.com/shikijs/shiki
theme: {
light: "github-light",
dark: "github-dark",
},
config: (md) => {
md.use(iterator, "artalk_version", "text", function (tokens, idx) {
tokens[idx].content = tokens[idx].content.replace(
/:ArtalkVersion:/g,
Version.latest
);
});
md.use(iterator, "artalk_version_link", "link_open", (tokens, idx) => {
const href = tokens[idx].attrGet("href");
tokens[idx].attrSet(
"href",
href.replace(/:ArtalkVersion:/g, Version.latest)
);
});
},
},
locales: {
root: {
label: "简体中文",
lang: "zh",
link: "https://artalk.js.org/",
},
en: {
label: "English",
lang: "en",
link: "https://artalk-js-org.translate.goog/guide/intro?_x_tr_sl=auto&_x_tr_tl=en-US&_x_tr_hl=en-US&_x_tr_pto=wapp",
},
},
themeConfig: {
sidebar: {
"/guide/": [
{
text: "快速开始",
collapsed: false,
items: [
{ text: "项目介绍", link: "/guide/intro.md" },
{ text: "程序部署", link: "/guide/deploy.md" },
{ text: "数据迁移", link: "/guide/transfer.md" },
],
},
{
text: "核心指南",
collapsed: false,
items: [
{ text: "侧边栏", link: "/guide/frontend/sidebar.md" },
{ text: "邮件通知", link: "/guide/backend/email.md" },
{ text: "多元推送", link: "/guide/backend/admin_notify.md" },
{ text: "评论审核", link: "/guide/backend/moderator.md" },
{ text: "验证码", link: "/guide/backend/captcha.md" },
{ text: "图片上传", link: "/guide/backend/img-upload.md" },
{ text: "账户与多站点", link: "/guide/backend/multi-site.md" },
{ text: "解析相对路径", link: "/guide/backend/relative-path.md" },
{ text: "如何配置界面", link: "/guide/backend/fe-control.md" },
{ text: "English (i18n)", link: "/guide/frontend/i18n.md" },
],
},
{
text: "进阶指南",
collapsed: false,
items: [
{ text: "表情包", link: "/guide/frontend/emoticons.md" },
{ text: "浏览量统计", link: "/guide/frontend/pv.md" },
{ text: "Latex", link: "/guide/frontend/latex.md" },
{ text: "图片灯箱", link: "/guide/frontend/lightbox.md" },
{ text: "IP 归属地", link: "/guide/frontend/ip-region.md" },
{ text: "精简版本", link: "/guide/frontend/artalk-lite.md" },
{ text: "置入博客", link: "/guide/frontend/import-blog.md" },
{ text: "置入框架", link: "/guide/frontend/import-framework.md" },
{ text: "前端 API", link: "/develop/fe-api.md" },
{ text: "开发文档", link: "/develop/index.md" },
],
},
{
text: "配置文档",
collapsed: true,
items: [
{ text: "后端配置", link: "/guide/backend/config.md" },
{ text: "前端配置", link: "/guide/frontend/config.md" },
],
},
{
text: "部署说明",
collapsed: true,
items: [
{ text: "守护进程", link: "/guide/backend/daemon.md" },
{ text: "反向代理", link: "/guide/backend/reverse-proxy.md" },
{ text: "编译构建", link: "/guide/backend/build.md" },
{ text: "程序升级", link: "/guide/backend/update.md" },
{ text: "Docker", link: "/guide/backend/docker.md" },
],
},
{
text: "更多内容",
collapsed: true,
items: [
{ text: "安全防范", link: "/guide/security.md" },
{ text: "扩展阅读", link: "/guide/extras.md" },
{ text: "案例展示", link: "/guide/cases.md" },
{ text: "关于我们", link: "/guide/about.md" },
],
},
],
"/develop/": [
{
text: "开发文档",
items: [
{ text: "开发说明", link: "/develop/index.md" },
{ text: "前端 API", link: "/develop/fe-api.md" },
{ text: "前端 Event", link: "/develop/event.md" },
{ text: "插件开发", link: "/develop/plugs.md" },
{
text: "🔬 HTTP API",
link: "https://artalk.js.org/http-api.html",
},
{
text: "📖 Contributing Guide",
link: "https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md",
},
{
text: "🔖 Code of Conduct",
link: "https://github.com/ArtalkJS/Artalk/blob/master/CODE_OF_CONDUCT.md",
},
],
},
],
},
nav: [
// NavbarItem
{
text: "介绍",
link: "/guide/intro",
},
{
text: "部署",
link: "/guide/deploy",
},
{
text: "配置",
link: "/guide/backend/config",
},
{
text: "迁移",
link: "/guide/transfer",
},
{
text: "案例",
link: "/guide/cases",
},
{
text: "开发",
link: "/develop/",
},
// NavbarGroup
{
text: "传送",
items: [
{
text: "代码仓库",
link: "https://github.com/ArtalkJS/Artalk",
},
{
text: "文档镜像 (国内)",
link: "https://artalk-docs.qwqaq.com",
},
],
},
],
socialLinks: [
{ icon: "github", link: "https://github.com/ArtalkJS/Artalk" },
],
search: {
provider: "algolia",
options: {
appId: "2WNJ32WVTY",
apiKey: "6c6ebc345a87b738264f19095b78c91c",
indexName: "artalk-js",
searchParameters: {
facetFilters: ["lang:zh-CN"],
},
},
},
editLink: {
pattern: "https://github.com/ArtalkJS/Artalk/edit/master/docs/:path",
text: "完善文档",
},
},
vite: {
server: {
open: "/guide/intro.html",
},
},
});
@@ -1,7 +1,5 @@
<template>
<ClientOnly>
<div ref="el" style="margin-top: 20px;"></div>
</ClientOnly>
<div ref="el" style="margin-top: 20px;"></div>
</template>
<script setup lang="ts">
@@ -17,10 +15,12 @@ const page = useData().page
let artalk: Artalk
onMounted(() => {
initArtalk(getConfByPage())
nextTick(() => {
initArtalk(getConfByPage())
})
})
watch(() => router.route.data.relativePath, () => {
watch(() => router.route.path, () => {
nextTick(() => {
artalk.update(getConfByPage())
artalk.reload()
@@ -32,6 +32,7 @@ onUnmounted(() => {
})
function initArtalk(conf: any) {
// TODO: remove dynamic import after the new version released
import('artalk').then(({ default: Artalk }) => {
artalk = Artalk.init({
el: el.value,
@@ -48,7 +49,7 @@ function initArtalk(conf: any) {
function getConfByPage() {
return {
pageKey: 'https://artalk.js.org'+location.pathname,
pageKey: 'https://artalk.js.org'+router.route.path,
pageTitle: page.value.title,
server: 'https://artalk.qwqaq.com',
site: 'ArtalkDocs',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5 -4
View File
@@ -1,6 +1,8 @@
## Artalk Documentation
# Artalk Documentation
> The Documentation of Artalk
[![Netlify Status](https://api.netlify.com/api/v1/badges/6580cce0-4b27-465e-8d73-1e6a832942e9/deploy-status)](https://app.netlify.com/sites/artalk/deploys)
Documentation of Artalk
## Build
@@ -11,9 +13,8 @@ pnpm docs:build
## Deploy
[![Netlify Status](https://api.netlify.com/api/v1/badges/6580cce0-4b27-465e-8d73-1e6a832942e9/deploy-status)](https://app.netlify.com/sites/artalk/deploys)
文档通过 [Netlify](https://www.netlify.com/) 对 master 分支进行自动部署。
## Licensed
CC BY-NC-SA 4.0
File renamed without changes.
File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
{
"latest": "2.7.1"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -12,7 +12,7 @@ npm install artalk
## 创建实例 `init`
`Artalk.init` 函数和 `new Artalk` 等价,调用该函数将创建并得到一个 Artalk 的实例化对象,可用于后续操作。
调用该函数将创建并得到一个 Artalk 的实例化对象,可用于后续操作。
```js
import Artalk from 'artalk'
File renamed without changes.
File renamed without changes.
+2 -3
View File
@@ -2,11 +2,11 @@
layout: home
title: Artalk
titleTemplate: The Selfhosted Comment System
titleTemplate: A Self-hosted Comment System
hero:
name: Artalk
text: The Selfhosted Comment System
text: A Self-hosted Comment System
tagline: Elevate your online conversations with a comment system that embodies the trifecta of lightness, security, and refinement.
actions:
- theme: brand
@@ -30,4 +30,3 @@ features:
title: Flexible
details: Use Golang to interpret the excellence of multiple platforms
---
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 219 files, more files were not shown because too many files have changed in this diff. Show more