https://github.com/uiolee/hexo-absolute
convert relative path to absolute URL for hexo
https://github.com/uiolee/hexo-absolute
filter hexo hexo-plugin plugin url
Last synced: about 1 year ago
JSON representation
convert relative path to absolute URL for hexo
- Host: GitHub
- URL: https://github.com/uiolee/hexo-absolute
- Owner: uiolee
- License: mpl-2.0
- Created: 2022-06-05T02:40:20.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T16:26:23.000Z (over 1 year ago)
- Last Synced: 2025-03-24T03:23:55.258Z (over 1 year ago)
- Topics: filter, hexo, hexo-plugin, plugin, url
- Language: JavaScript
- Homepage: https://npmjs.com/hexo-absolute
- Size: 283 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hexo-absolute
[](https://github.com/uiolee/hexo-absolute/tags)
[](https://github.com/uiolee/hexo-absolute/releases)
[](https://github.com/uiolee/hexo-absolute/compare/...main)
[](#hexo-absolute)
[](https://coveralls.io/github/uiolee/hexo-absolute?branch=main)
[](https://github.com/uiolee/hexo-absolute/actions/workflows/ci.yml)
[](https://libraries.io/github/uiolee/hexo-absolute#dependencies)
Convert relative path to absolute URL for [hexo](https://github.com/hexojs/hexo)
Only run when `hexo generate` or `deploy`, won't run when `hexo server`.
## Install
[](https://www.npmjs.com/package/hexo-absolute)
[](https://nodejs.org/)
[](./LICENSE)
[](#hexo-absolute)
[](#hexo-absolute)
[](https://libraries.io/npm/hexo-absolute/tree)
```bash
pnpm add hexo-absolute
# npm i hexo-absolute
```
## Configuration
### Website Configuration
```yaml
# If your website is in a subdirectory (such as http://example.org/blog) set url to http://example.org/blog and set root to /blog/.
url: http://example.org/blog
```
[**Hexo/Docs/Configuration#URL**](https://hexo.io/docs/configuration#URL)
### Plugin Configuration
```yaml
absolute:
enable: true
tagName: ["a", "link", "img", "script"]
attribute: ["href", "src"]
priority: 20
```
- `enable`
boolean, set `false` to disable this plugin.
- `tagName`
html tag name
- `attribute`
html tag attribute
- `priority`
define the priority of this plugin.
> [**Hexo/API/Filter#Synopsis:**
> You can define the priority. Lower priority means that it will be executed first. The default priority is 10.](https://hexo.io/api/filter.html#Synopsis)
## Example (default config)
### before
```html
top

```
### after
```html
top

```
## Uninstall
```bash
pnpm rm hexo-absolute
# npm uninstall hexo-absolute
```