npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@markbattistella/docsify-sidebarfooter

v5.0.7

Published

Add a footer notice for Docsify.js

Downloads

185

Readme

docsify.js sidebar footer

This plugin enhances your website's sidebar or page by creating a footer area where you can display important information. It automatically updates the copyright year or range, allows you to include your name or company with a URL, and provides links to a privacy policy, terms of service, and cookies policy pages. By utilising this plugin, you can easily showcase relevant legal information, personalise your website, and promote transparency and compliance.

Installation

!> Note: There are breaking changes in the configuration from v4.x to v5.x. Please take the time to read all the documentation before upgrading

Update index.html file

Assuming you have a working docsify framework set up, it is easy to use the plugin.

  1. Add one of the following script tags to your index.html via either CDN or downloading it and using it locally:

    <!-- unpkg.com -->
    <script src="https://unpkg.com/@markbattistella/docsify-sidebarfooter@latest"></script>
    
    <!-- jsDelivr -->
    <script src="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-sidebarfooter@latest"></script>
    
    <!-- locally -->
    <script src="docsify-sidebar.min.js"></script>
  2. In docsify setup configure the plugin:

    <script>
    window.$docsify = {
      autoFooter: {
    
        // the name you wish to display as the copyright holder
        name:        String,
    
        // the URL (personal or company) which clicking the `name` goes to
        url:         String,
    
        // the start year of copyright
        copyYear:    String,
    
        // show the privacy policy link
        policy:      Bool | String,
    
        // show the terms of service link
        terms:       Bool | String,
    
        // show the cookies policy link
        cookies:     Bool | String,
    
        // use your own css styles or the built in ones
        customStyle: Bool | String
      }
    };
    </script>

Additional files

Default

If you set the policy, terms, or cookies options to true the URL links for those pages will look for the markdown files directly next to the index.html file:

// ... other config
policy: true,
terms: true,
cookies: true,
// ... other config
- index.html      --> https://your-awesome-site.com/#/
- _policy.md      --> https://your-awesome-site.com/#/_policy
- _terms.md       --> https://your-awesome-site.com/#/_terms
- _cookies.md     --> https://your-awesome-site.com/#/_cookies

Sub-folder

However, if you enter a string it will append that to the base URL of your website:

// ... other config
policy: 'site/policy',
terms: 'site/terms',
cookies: 'site/cookies',
// ... other config
- index.html      --> https://your-awesome-site.com/#/
- site/
  \__ policy.md   --> https://your-awesome-site.com/#/site/policy
  \__ terms.md    --> https://your-awesome-site.com/#/site/terms
  \__ cookies.md  --> https://your-awesome-site.com/#/site/cookies

External links

If you host your policy, terms, or cookies messages on an external website (or need to link to a parent company policy) you can add them in as the full URL:

// ... other config
policy: "https://my-other-website.com/policy",
terms: "https://my-other-website.com/terms",
cookies: "https://my-other-website.com/cookies",
// ... other config

These will open those pages in a new tab directly.

Configuration

There are some options available for the docsify-sidebarfooter:

| Setting | Type | Options | |---------------|----------------|------------------------------------| | name | String | your name or company | | url | String | url you want the name to link to | | copyYear | String | first year of copyright | | policy | Bool or String | - false hides it from the site- true defaults to _policy.md- a custom string will direct to that | | terms | Bool or String | - false hides it from the site- true defaults to _terms.md- a custom string will direct to that | | cookies | Bool or String | - false hides it from the site- true defaults to _cookies.md- a custom string will direct to that | | customStyle | Bool or String | - false uses in-built css (sidebar styled)- true applies no styles, you can create your own- sidebar uses the in-built css designed for the sidebar- body uses the in-built css designed for the body |

Usage

Sidebar

At the bottom of your _sidebar.md file add the following code:

<footer id="mb-footer"></footer>

Body

Under the <div id="app"></div> in your index.html file, add the following code:

<footer id="mb-footer"></footer>

Styling

The links container is sectioned into different classes for you to customise as much (or little) as you wish.

<footer id="mb-footer">
  <div class="footer-container">
    <div class="footer-text">
      <span class="footer-text-copyright">
        Copyright © YYYY-YYYY
      </span>
      <span class="footer-text-author">
        <a target="_blank" href="">Your website name</a>
      </span>
    </div>
    <div class="footer-link">
      <span class="footer-links-policy">
        <a href="">Policy</a>
      </span>
      <span class="footer-links-terms">
        <a href="">Terms</a>
      </span>
      <span class="footer-links-cookies">
        <a href="">Cookies</a>
      </span>
    </div>
  </div>
</footer>

Contributing

  1. Clone the repo:git clone https://github.com/markbattistella/docsify-sidebarFooter.git
  2. Create your feature branch:git checkout -b my-feature
  3. Commit your changes:git commit -am 'Add some feature'
  4. Push to the branch:git push origin my-new-feature
  5. Submit the pull request