Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dailyrandomphoto/hexo-simplify-url
Simplify url for pages and links.
https://github.com/dailyrandomphoto/hexo-simplify-url
Last synced: about 1 month ago
JSON representation
Simplify url for pages and links.
- Host: GitHub
- URL: https://github.com/dailyrandomphoto/hexo-simplify-url
- Owner: dailyrandomphoto
- License: mit
- Created: 2019-08-26T02:48:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:59:44.000Z (over 3 years ago)
- Last Synced: 2024-11-11T18:32:44.233Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hexo-simplify-url
[![NPM Version](https://img.shields.io/npm/v/hexo-simplify-url.svg)](https://www.npmjs.com/package/hexo-simplify-url)
[![NPM Downloads](https://img.shields.io/npm/dm/hexo-simplify-url.svg)](https://www.npmjs.com/package/hexo-simplify-url)
[![LICENSE](https://img.shields.io/npm/l/hexo-simplify-url.svg)](LICENSE)Simplify url for pages and links.
You could use this module for your SEO of blog powered by hexo.If you don't want to see `/index.html` in your urls, use `simplify_url` helper.
If you don't want your users see `/index.html` or `/index` in the address bar of browsers, use `simplify_url_auto_redirect` helper.
## Installation
```
npm install --save hexo-simplify-url
```## Usage
### simplify_url
Use `simplify_url` to remove `index.html` in the links.``` ejs
<%= simplify_url(page.permalink) %><%- simplify_url(open_graph({ ... })) %>
```
Notice: From [email protected], use `pretty_urls` option can remove `index.html` from permalink. (https://github.com/hexojs/hexo/pull/3691)### simplify_url_auto_redirect
Add a `simplify_url_auto_redirect` helper simply to your html's `` block as follows:``` ejs
<%- simplify_url_auto_redirect() %>
```## License
Copyright (c) 2019 dailyrandomphoto. Licensed under the [MIT license](LICENSE).