1.0.2 • Published 3 months ago

hexo-absolute v1.0.2

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
3 months ago

hexo-absolute

GitHub Coveralls branch CI

Convert relative path to absolute URL for hexo

Only run when hexo generate or deploy, won't run when hexo server.

Install

npm npm npm

pnpm add hexo-absolute

# npm i hexo-absolute

Configuration

Website Configuration

# 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

Plugin Configuration

absolute:
  enable: true
  tagName: ["a", "link", "img", "script"]
  attribute: ["href", "src"]
  priority: 20

Example (default config)

before

<a href="#top">top</a>
<link rel="stylesheet" href="/css/style.css" />
<img src="/images/hexo.png" />
<script src="/js/jquery-2.2.4.min.js"></script>

after

<a href="https://example.org/#top">top</a>
<link rel="stylesheet" href="https://example.org/css/style.css" />
<img src="https://example.org/images/hexo.png" />
<script src="https://example.org/js/jquery-2.2.4.min.js"></script>

Uninstall

pnpm rm hexo-absolute

# npm uninstall hexo-absolute
1.0.2

3 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.2.2

7 months ago

0.2.1

8 months ago

0.1.0

10 months ago

0.2.0

10 months ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago