Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
feat: rename seo plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jun 3, 2022
1 parent 7d62c92 commit a64ff9d
Show file tree
Hide file tree
Showing 27 changed files with 97 additions and 611 deletions.
2 changes: 1 addition & 1 deletion docs/seo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "seo-docs",
"version": "1.30.0",
"private": true,
"description": "Docs for @mr-hope/vuepress-plugin-seo",
"description": "Docs for vuepress-plugin-seo1",
"license": "MIT",
"author": {
"name": "Mr.Hope",
Expand Down
2 changes: 1 addition & 1 deletion docs/seo/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default hope.config({
color: "#ffffff",
},
manifest: {
name: "@mr-hope/vuepress-plugin-seo",
name: "vuepress-plugin-seo1",
short_name: "seo-plugin",
icons: [
{
Expand Down
10 changes: 5 additions & 5 deletions docs/seo/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ home: true
title: Home
icon: home
heroImage: /logo.svg
heroText: "@mr-hope/vuepress-plugin-seo"
heroText: "vuepress-plugin-seo1"
tagline: Inject <meta> into your web page to enhance the SEO of your web page.
action:
- text: Guide 💡
Expand All @@ -26,15 +26,15 @@ copyrightText: false
::: code-group-item yarn

```bash
yarn add -D @mr-hope/vuepress-plugin-seo
yarn add -D vuepress-plugin-seo1
```

:::

::: code-group-item npm

```bash
npm i -D @mr-hope/vuepress-plugin-seo
npm i -D vuepress-plugin-seo1
```

:::
Expand All @@ -52,7 +52,7 @@ npm i -D @mr-hope/vuepress-plugin-seo
export default {
plugins: [
[
"@mr-hope/seo",
"seo1",
{
// your options
},
Expand All @@ -70,7 +70,7 @@ export default {
module.exports = {
plugins: [
[
"@mr-hope/seo",
"seo1",
{
// your options
},
Expand Down
10 changes: 5 additions & 5 deletions docs/seo/src/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ home: true
title: 主页
icon: home
heroImage: /logo.svg
heroText: "@mr-hope/vuepress-plugin-seo"
heroText: "vuepress-plugin-seo1"
tagline: 向你的网页注入 <meta>,来增强你网页的 SEO。
action:
- text: 快速上手 💡
Expand All @@ -26,15 +26,15 @@ copyrightText: false
::: code-group-item yarn

```bash
yarn add -D @mr-hope/vuepress-plugin-seo
yarn add -D vuepress-plugin-seo1
```

:::

::: code-group-item npm

```bash
npm i -D @mr-hope/vuepress-plugin-seo
npm i -D vuepress-plugin-seo1
```

:::
Expand All @@ -52,7 +52,7 @@ npm i -D @mr-hope/vuepress-plugin-seo
export default {
plugins: [
[
"@mr-hope/seo",
"seo1",
{
// 配置选项
},
Expand All @@ -70,7 +70,7 @@ export default {
module.exports = {
plugins: [
[
"@mr-hope/seo",
"seo1",
{
// 配置选项
},
Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/config/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tags:

- [vuepress-plugin-reading-time1][reading-time]: Expect reading time and words count

- [@mr-hope/vuepress-plugin-seo][seo]: SEO Enhancement Plugin
- [vuepress-plugin-seo1][seo]: SEO Enhancement Plugin

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: Sitemap Generator for your site

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The theme also includes the following plugins, you can use them in other themes

- [vuepress-plugin-reading-time1][reading-time]: Expect reading time and words count

- [@mr-hope/vuepress-plugin-seo][seo]: SEO Enhancement Plugin
- [vuepress-plugin-seo1][seo]: SEO Enhancement Plugin

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: Sitemap Generator for your site

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/guide/feature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The theme includes the following plugins, you can use them directly in other the

- [vuepress-plugin-reading-time1][reading-time]: Expect reading time and words count

- [@mr-hope/vuepress-plugin-seo][seo]: SEO Enhancement Plugin
- [vuepress-plugin-seo1][seo]: SEO Enhancement Plugin

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: Sitemap Generator for your site

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/guide/feature/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- seo
---

`vuepress-theme-hope` provide SEO enhancement by includeing [`@mr-hope/vuepress-plugin-seo`](https://vuepress-theme-hope.github.io/v1/seo/).
`vuepress-theme-hope` provide SEO enhancement by includeing [`vuepress-plugin-seo1`](https://vuepress-theme-hope.github.io/v1/seo/).

To make the plugin work better, you may need to look at [Page Information Configuration](../../config/page.md#page-information-configuration) and configure them reasonably.

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/config/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tags:

- [vuepress-plugin-reading-time1][reading-time]: 阅读时间与字数统计

- [@mr-hope/vuepress-plugin-seo][seo]: SEO 增强插件
- [vuepress-plugin-seo1][seo]: SEO 增强插件

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: 为你的站点生成 sitemap

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ tags:

- [vuepress-plugin-reading-time1][reading-time]: 阅读时间与字数统计

- [@mr-hope/vuepress-plugin-seo][seo]: SEO 增强插件
- [vuepress-plugin-seo1][seo]: SEO 增强插件

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: 为你的站点生成 sitemap

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/feature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tags:

- [vuepress-plugin-reading-time1][reading-time]: 阅读时间与字数统计

- [@mr-hope/vuepress-plugin-seo][seo]: SEO 增强插件
- [vuepress-plugin-seo1][seo]: SEO 增强插件

- [@mr-hope/vuepress-plugin-sitemap][sitemap]: 为你的站点生成 sitemap

Expand Down
2 changes: 1 addition & 1 deletion docs/theme/src/zh/guide/feature/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- seo
---

`vuepress-theme-hope` 通过内置 [`@mr-hope/vuepress-plugin-seo`](https://vuepress-theme-hope.github.io/v1/seo/zh/) 为提供 SEO 增强功能。
`vuepress-theme-hope` 通过内置 [`vuepress-plugin-seo1`](https://vuepress-theme-hope.github.io/v1/seo/zh/) 为提供 SEO 增强功能。

为了使插件能够更好的工作,可能需要查看一下 [页面信息配置](../../config/page.md#页面信息配置) 并合理的配置它们。

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"@mr-hope/vuepress-plugin-components": "workspace:*",
"@mr-hope/vuepress-plugin-git": "workspace:*",
"@mr-hope/vuepress-plugin-pwa": "workspace:*",
"@mr-hope/vuepress-plugin-seo": "workspace:*",
"@mr-hope/vuepress-plugin-sitemap": "workspace:*",
"@mr-hope/vuepress-plugin-smooth-scroll": "workspace:*",
"@mr-hope/vuepress-theme-types": "workspace:*",
Expand Down Expand Up @@ -103,6 +102,7 @@
"vuepress-plugin-md-enhance": "workspace:*",
"vuepress-plugin-photo-swipe": "workspace:*",
"vuepress-plugin-reading-time1": "workspace:*",
"vuepress-plugin-seo1": "workspace:*",
"vuepress-shared": "workspace:*",
"vuepress-typings": "workspace:*"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/seo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<p align="center">
<img width="240" src="https://vuepress-theme-hope.github.io/v1/logo.svg" style="text-align: center;"/>
</p>
<h1 align="center">@mr-hope/vuepress-plugin-seo</h1>
<h1 align="center">vuepress-plugin-seo1</h1>
<h4 align="center">VuePress SEO plugin🛠 / VuePress SEO 插件🛠</h4>

[![Version](https://img.shields.io/npm/v/@mr-hope/vuepress-plugin-seo.svg?style=flat-square&logo=npm) ![Downloads](https://img.shields.io/npm/dm/@mr-hope/vuepress-plugin-seo.svg?style=flat-square&logo=npm) ![Size](https://img.shields.io/bundlephobia/min/@mr-hope/vuepress-plugin-seo?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mr-hope/vuepress-plugin-seo)
[![Version](https://img.shields.io/npm/v/vuepress-plugin-seo1.svg?style=flat-square&logo=npm) ![Downloads](https://img.shields.io/npm/dm/vuepress-plugin-seo1.svg?style=flat-square&logo=npm) ![Size](https://img.shields.io/bundlephobia/min/vuepress-plugin-seo1?style=flat-square&logo=npm)](https://www.npmjs.com/package/vuepress-plugin-seo1)

<!-- markdownlint-restore -->

Expand All @@ -22,11 +22,11 @@ VuePress 2 is recommanded to start new project. You should use [`vuepress-plugin
## 安装 / Install

```bash
npm i -D @mr-hope/vuepress-plugin-seo
npm i -D vuepress-plugin-seo1
```

Or

```bash
yarn add -D @mr-hope/vuepress-plugin-seo
yarn add -D vuepress-plugin-seo1
```
2 changes: 1 addition & 1 deletion packages/seo/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@mr-hope/vuepress-plugin-seo",
"name": "vuepress-plugin-seo1",
"version": "1.30.0",
"description": "SEO plugin for vuepress",
"keywords": [
Expand Down
130 changes: 0 additions & 130 deletions packages/seo/src/node/dayjs.ts

This file was deleted.

23 changes: 15 additions & 8 deletions packages/seo/src/node/meta.ts → packages/seo/src/node/info.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {
getAuthor,
getCover,
getDate,
getImages,
getLocales,
resolveUrl,
} from "./utils";
import { getAuthor, getDate, removeEndingSlash } from "vuepress-shared";

import { getCover, getImages, getLocales, resolveUrl } from "./utils";

import type { Context, Page } from "vuepress-typings";
import type { SeoContent, SeoOptions } from "../types";
Expand Down Expand Up @@ -98,3 +93,15 @@ export const getOGP = (

return defaultOGP;
};

export const getCanonicalLink = (
page: Page,
options: SeoOptions
): string | null => {
if (typeof options.canonical === "function") return options.canonical(page);

if (typeof options.canonical === "string")
return `${removeEndingSlash(options.canonical)}${page.path}`;

return null;
};
Loading

0 comments on commit a64ff9d

Please sign in to comment.