Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgwalker/action-no-root-relative-links
https://github.com/mgwalker/action-no-root-relative-links
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mgwalker/action-no-root-relative-links
- Owner: mgwalker
- License: mit
- Created: 2022-12-19T20:37:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-19T21:54:50.000Z (about 2 years ago)
- Last Synced: 2024-10-20T22:37:32.861Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# No root-relative links
This action scans a collection of source files (HTML and Markdown, primarily)
that will be ingested by a static-site generator (such as Jekyll, Hugo, or 11ty)
to find any links that are root-relative (i.e., links that begin with `/`).
Root-relative links can become broken during deployment if a site isn't deployed
to the root of its server. It is a good practice to prefix root-relative links
with something like `{{ site.baseurl }}` (in Jekyll) that is defined at
build-time so links will be relative to the site's actual deployed path.If this action finds any root-relative links, it will create an annotation for
the file and line where the link is.## Usage
```yaml
- uses: mgwalker/action-no-root-relative-links@v1
with:
# The path in your repository to scan for source files. In order to ensure
# this path is present, be sure to checkout the repository before running
# this action. Defaults to "."
path: "_pages"# The message to include in annotation error messages. Defaults to "This
# internal link is root-relative and should be prefixed."
message: "Your message goes here"
```