Giter Site home page Giter Site logo

pklaschka / ssblc Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 4.0 763 KB

Static Site Broken Link Chacker: A broken-link checker for static sites, like the ones generated with docsify

Home Page: https://www.npmjs.com/package/@pklaschka/ssblc

License: MIT License

JavaScript 94.38% HTML 5.62%
ci docsify broken-links broken-link broken-link-finder static-site nodejs npm

ssblc's Introduction

@pklachka/ssblc

Static Site Broken Link Checker

CI Status Badge

A broken-link checker for static sites, like the ones generated with docsify that can get used, for example, for CI purposes on docsify docs (this is what I've developed it for).

It recursively checks internal links found on the static website (until every internal link is checked) and (without recursion) outgoing links. This is achieved by finding href attributes in the HTML, meaning also stylesheets included with <link href="some-file.css"> get checked.

Installation

You can either run it by just using npx, in which case you won't have to install it, or first install it with

npm install -g @pklaschka/ssblc

Usage

When you are in the folder of your static website (i.e., there is an index.html in this folder), simply run

ssblc

after which the checker will begin its work.

To use it with npx, simply run

npx @pklaschka/ssblc

Alternatively, you can also specify an absolute or relative path to the directory of the site, e.g., like this:

ssblc ../my-site

ssblc's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar pklaschka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssblc's Issues

Add tests

Add unit tests (ideally with a test coverage of 100%) to the project, as for usage in CI, developers have to trust that the tool works completely every time it's used

content.matchAll is not a function

Running this on my docs folder, I get an error.

$ ssblc
Running at http://localhost:3000

0/0	 Checking link:  http://localhost:3000/
Something didn't quite work as expected:  content.matchAll is not a function
ferozed:~/stash/ops/docs (main)

Here is my directory listing

$ ls
README.md			_sidebar.md			apple-touch-icon.png		index.html
_coverpage.md			alpha				favicon-16x16.png		site.webmanifest
_footer.md			android-chrome-192x192.png	favicon-32x32.png		v1
_navbar.md			android-chrome-512x512.png	favicon.ico

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.