feat: support create versioning docs (#16)
parent
8767974c17
commit
65eee57a38
@ -0,0 +1,104 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
|
import Link from '@docusaurus/Link';
|
||||||
|
import Layout from '@theme/Layout';
|
||||||
|
|
||||||
|
import {useVersions, useLatestVersion} from '@theme/hooks/useDocs';
|
||||||
|
|
||||||
|
function Version(): JSX.Element {
|
||||||
|
const {
|
||||||
|
siteConfig: {organizationName, projectName},
|
||||||
|
} = useDocusaurusContext();
|
||||||
|
const versions = useVersions();
|
||||||
|
const latestVersion = useLatestVersion();
|
||||||
|
const currentVersion = versions.find(
|
||||||
|
(version) => version.name === 'current',
|
||||||
|
)!;
|
||||||
|
const pastVersions = versions.filter(
|
||||||
|
(version) => version !== latestVersion && version.name !== 'current',
|
||||||
|
);
|
||||||
|
const repoUrl = `https://github.com/${organizationName}/${projectName}`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Layout
|
||||||
|
title="Versions"
|
||||||
|
description="Docusaurus 2 Versions page listing all documented site versions">
|
||||||
|
<main className="container margin-vert--lg">
|
||||||
|
<h1>Halo documentation versions</h1>
|
||||||
|
|
||||||
|
{latestVersion && (
|
||||||
|
<div className="margin-bottom--lg">
|
||||||
|
<h3 id="next">Current version (Stable)</h3>
|
||||||
|
<p>
|
||||||
|
Here you can find the documentation for current released version.
|
||||||
|
</p>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>{latestVersion.label}</th>
|
||||||
|
<td>
|
||||||
|
<Link to={latestVersion.path}>Documentation</Link>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
|
||||||
|
Release Notes
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{currentVersion !== latestVersion && (
|
||||||
|
<div className="margin-bottom--lg">
|
||||||
|
<h3 id="latest">Next version (Unreleased)</h3>
|
||||||
|
<p>
|
||||||
|
Here you can find the documentation for work-in-process unreleased
|
||||||
|
version.
|
||||||
|
</p>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>{currentVersion.label}</th>
|
||||||
|
<td>
|
||||||
|
<Link to={currentVersion.path}>Documentation</Link>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(pastVersions.length > 0) && (
|
||||||
|
<div className="margin-bottom--lg">
|
||||||
|
<h3 id="archive">Past versions (Not maintained anymore)</h3>
|
||||||
|
<p>
|
||||||
|
Here you can find documentation for previous versions of
|
||||||
|
Docusaurus.
|
||||||
|
</p>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
{pastVersions.map((version) => (
|
||||||
|
<tr key={version.name}>
|
||||||
|
<th>{version.label}</th>
|
||||||
|
<td>
|
||||||
|
<Link to={version.path}>Documentation</Link>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href={`${repoUrl}/releases/tag/v${version.name}`}>
|
||||||
|
Release Notes
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</main>
|
||||||
|
</Layout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Version;
|
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: 关于文档
|
||||||
|
description: 关于本文档站点的一些说明
|
||||||
|
---
|
||||||
|
|
||||||
|
:::note
|
||||||
|
此文档使用 [Docusaurus](https://docusaurus.io/) 搭建,感谢 [Docusaurus](https://github.com/facebook/docusaurus) 社区所做的贡献。
|
||||||
|
:::
|
||||||
|
|
||||||
|
## 参与贡献
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
如果你发现文档中有不正确或者需要添加的内容,非常欢迎参与到文档编辑当中。
|
||||||
|
:::
|
||||||
|
|
||||||
|
当前文档的仓库地址为 [halo-dev/docs](https://github.com/halo-dev/docs) ,所以你可以 fork 此仓库,修改之后提交 `Pull request` 等待我们合并即可。
|
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: 系统结构
|
||||||
|
description: Halo 项目的构成
|
||||||
|
---
|
||||||
|
|
||||||
|
[Halo](https://github.com/halo-dev/halo) 博客系统分为以下四个部分:
|
||||||
|
|
||||||
|
| 项目名称 | 简介 |
|
||||||
|
| :------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| [halo](https://github.com/halo-dev/halo) | 提供整个系统的服务,采用 [Spring Boot](https://spring.io/) 开发 |
|
||||||
|
| [halo-admin](https://github.com/halo-dev/halo-admin) | 负责后台管理的渲染,采用 [Vue](https://vuejs.org/) 开发,已集成在 Halo 运行包内,无需独立部署。 |
|
||||||
|
| [halo-comment](https://github.com/halo-dev/halo-comment) | 评论插件,采用 [Vue](https://vuejs.org/) 开发,在主题中运行方式引入构建好的 `Javascript` 文件即可 |
|
||||||
|
| [halo-theme-\*](https://github.com/halo-dev) | 主题项目集,采用 [Freemarker](https://freemarker.apache.org/) 模板引擎编写,需要包含一些特殊的配置才能够被 halo 所使用 |
|
||||||
|
|
||||||
|
## 自定义配置
|
||||||
|
|
||||||
|
> 为什么要提前讲自定义配置呢?是因为在这里让大家了解到 `Halo` 的`配置方式`,以及`配置优先级`,不至于未来运行项目的时候不知道如何优雅地修改配置。
|
||||||
|
|
||||||
|
`Halo` 配置目录优先级如下(从上到下优先级越来越小,上层的配置将会覆盖下层):
|
||||||
|
|
||||||
|
- `Halo` 自定义配置
|
||||||
|
- file:~/.halo/
|
||||||
|
- file:~/.halo-dev/
|
||||||
|
- `Spring Boot` 默认配置
|
||||||
|
- file:./config/
|
||||||
|
- file:./
|
||||||
|
- classpath:/config/
|
||||||
|
- classpath:/
|
||||||
|
|
||||||
|
> 参考: [Application Property Files](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files)
|
||||||
|
|
||||||
|
在开发的时候,希望大家能够在 `~/halo-dev/application.yml` 中进行添加自定义配置。当然后面也会讲到如何用`运行参数` 和 `VM options` 进行控制配置,届时可根据具体情况进行选择。
|
||||||
|
|
||||||
|
|
||||||
|
<article class="message is-warning">
|
||||||
|
<div class="message-body">
|
||||||
|
|
||||||
|
开发的时候,我们不建议直接更改`项目源码`中的所包含的`配置文件`,包括 `application.yml`、`application-dev.yml`、`application-test.yml` 和 `application-user.yml`。
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</article>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
title: 资源下载
|
||||||
|
description: 目前所有与 Halo 相关的下载地址
|
||||||
|
---
|
||||||
|
|
||||||
|
## Github
|
||||||
|
|
||||||
|
:::note
|
||||||
|
如果您的服务器在海外,推荐从 GitHub 下载。
|
||||||
|
:::
|
||||||
|
|
||||||
|
- [运行包](https://github.com/halo-dev/halo/releases)
|
||||||
|
- [配置文件](https://github.com/halo-dev/halo-common)
|
||||||
|
|
||||||
|
## 官方镜像源
|
||||||
|
|
||||||
|
- [https://dl.halo.run](https://dl.halo.run)
|
||||||
|
|
||||||
|
此镜像源由 [Nova Kwok](https://nova.moe/) 提供并维护。
|
||||||
|
|
||||||
|
## 三方镜像源
|
||||||
|
|
||||||
|
- [https://halo.cary.tech](https://halo.cary.tech)
|
||||||
|
|
||||||
|
此镜像源由 [新逸Cary](https://blog.xinac.cn) 提供并维护。
|
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
title: 三方指南
|
||||||
|
---
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
此类指南或教程均来自第三方或者网友提供,我们不能一直保证其具有有效性,请参考的时候仔细甄别。另外,如果您有写类似的教程,也可以[联系我们](mailto:hi@halo.run)放在下方。
|
||||||
|
:::
|
||||||
|
|
||||||
|
- [Halo 博客安装教程,一款优秀的 Java 开源博客系统](https://www.cnblogs.com/bronya0/p/14198512.html)
|
||||||
|
- [如何用服务器优雅地搭建一个博客—Hello,Halo!](https://www.bilibili.com/video/BV1JN411Q7Na/)
|
||||||
|
- [Halo+云服务器+Nginx反向代理实现个人博客搭建](https://yusart.xyz/archives/halo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA)
|
||||||
|
- [如何在 Windows 下搭建 Halo](https://ykanade.cn/archives/如何在windows下搭建halo)
|
||||||
|
- [Halo 博客建站记录](https://catchersun.cn/archives/halo%E5%8D%9A%E5%AE%A2%E5%BB%BA%E7%AB%99%E8%AE%B0%E5%BD%95)
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
title: 常见问题
|
||||||
|
---
|
||||||
|
|
||||||
|
# Header
|
||||||
|
Your content here
|
@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
"tutorialSidebar": [
|
||||||
|
"intro",
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "入门",
|
||||||
|
"collapsed": false,
|
||||||
|
"items": [
|
||||||
|
"getting-started/prepare",
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "安装指南",
|
||||||
|
"items": [
|
||||||
|
"getting-started/install/linux",
|
||||||
|
"getting-started/install/docker",
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "其他指南",
|
||||||
|
"items": [
|
||||||
|
"getting-started/install/other/bt-panel",
|
||||||
|
"getting-started/install/other/oneinstack",
|
||||||
|
"getting-started/install/other/tencent-cloudbase",
|
||||||
|
{
|
||||||
|
"type": "link",
|
||||||
|
"label": "腾讯云开发者实验室",
|
||||||
|
"href": "https://cloud.tencent.com/developer/labs/lab/10523"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"getting-started/install/third-party"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"getting-started/config",
|
||||||
|
"getting-started/upgrade",
|
||||||
|
"getting-started/downloads"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "用户指南",
|
||||||
|
"items": [
|
||||||
|
"user-guide/backup-migration",
|
||||||
|
"user-guide/markdown"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "开发者指南",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "系统开发",
|
||||||
|
"items": [
|
||||||
|
"developer-guide/core/structure",
|
||||||
|
"developer-guide/core/prepare",
|
||||||
|
"developer-guide/core/code-style"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "主题开发",
|
||||||
|
"items": [
|
||||||
|
"developer-guide/theme/prepare",
|
||||||
|
"developer-guide/theme/config-files",
|
||||||
|
"developer-guide/theme/global-variable",
|
||||||
|
"developer-guide/theme/public-template-tag",
|
||||||
|
"developer-guide/theme/page-variable",
|
||||||
|
"developer-guide/theme/template-tag"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "link",
|
||||||
|
"label": "REST API",
|
||||||
|
"href": "https://api.halo.run"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"label": "参与贡献",
|
||||||
|
"items": [
|
||||||
|
"contribution/issue",
|
||||||
|
"contribution/pr",
|
||||||
|
"contribution/sponsor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"about"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
"1.4.15"
|
||||||
|
]
|
Loading…
Reference in new issue