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

gatsby-theme-guitar-book

v1.0.1-alpha.11

Published

A Gatsby theme for building guitar book websites

Downloads

6

Readme

Gatsby Theme Guitar Book

This is an entirely configuration-based Gatsby theme that generates a guitar book website based on a series of Markdown or MDX files. It also exports a series of components that can be used within MDX pages.

Features

  • Plug and Play
  • Fully customizable
  • Mobile, Tablet and Desktop friendly
  • SEO friendly
  • App works offline, and it can be added to phone/desktop home screen
  • Free storing space for songs
  • Easy to edit songs
  • Editing songs without programming knowledge
  • Integrated with Google Analytic and Ad Sense
  • Lyrics Auto scroll
  • Chords mapping and their preview with how to play them
  • Music Video for every song with just link from YouTube
  • Fully covered search

Published Demo Guitar Books

| Module | Status | Public URL | | -------- | --- | --- | | Polish Songs | Netlify Status | https://guitar-book.netlify.app/ | | English Songs | Netlify Status | https://guitar-book.netlify.app/english | | Shanties Songs | Netlify Status | https://guitar-book.netlify.app/shanties |

Installation

If you're using this package, you'll also need to install gatsby and its peer dependencies, react and react-dom. Next, install the theme:

npm install gatsby-theme-guitar-book

or

yarn add gatsby-theme-guitar-book

Configuration

You can configure gatsby-theme-guitar-book for use with any set of app using the provided configuration options. You may also use component shadowing to customize elements like the logo or color scheme.

// gatsby-config.js
module.exports = {
  pathPrefix: '/english',
  plugins: [
    {
      resolve: `gatsby-theme-guitar-book`,
      options: {
        ...themeOptions,
        root: __dirname,
        baseDir: 'apps/english',
        subtitle: 'English Songs',
        siteName: 'Guitar Book',
        pageTitle: 'Guitar Book',
        description: 'Track and play best guitar songs for camping',
        githubRepo: 'jozwiaczek/guitar-book',
        menuTitle: 'Songs Types',
        gaTrackingId: 'UA-122299419-2',
        baseUrl: 'https://guitar-book.netlify.app/',
        logoLink: 'https://guitar-book.netlify.app//',
        contentDir: 'content',
        twitterHandle: 'jozwiaczek',
        youtubeUrl: 'https://www.youtube.com/c/JakubJ%C3%B3%C5%BAwiak/featured',
        navConfig: {
          'Polish Songs 🇵🇱': {
              url: 'https://guitar-book.netlify.app/',
              description:
                'Navigate to guitar book with polish songs'
            },
            'English Songs 🇺🇸': {
              url: 'https://guitar-book.netlify.app/english',
              description:
                'Navigate to guitar book with english songs'
            },
            'Shanties Songs 🏴‍': {
              url: 'https://guitar-book.netlify.app/shanties',
              description:
                "Navigate to guitar book with shanties"
            }
        },
        sidebarCategories: {
          null: ['index'],
          'George Ezra': [
            'blame-it-on-me',
            'listening-to-the-men'
          ],
          'Other Guitar Books': [
            '[Polish 🇵🇱](https://guitar-book.netlify.app)',
            '[Shanties 🏴‍](https://guitar-book.netlify.app/shanties)'
          ],
        }
      }
    }
  ]
};

Important note: Remember that guitar book must always have at least one .md and mdx file to build successfully.

Options

| Option name | Type | Required | Description | | ----------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- | | root | string | Yes | Must be __dirname | | siteName | string | Yes | The main title for the website, used in the <title> element and top left corner of the site | | description | string | Yes | The site description for SEO and social (FB, Twitter) tags | | sidebarCategories | object | Yes | An object mapping categories to page paths (see sidebarCategories reference) | | subtitle | string | No | The page title that gets rendered above the sidebar navigation | | pageTitle | string | No | The string to be rendered in the page's <title> tag. If omitted, siteName will be used. | | baseDir | string | No | If your Gatsby site does not live in the root of your project directory/git repo, pass the subdirectory name here (english, for example) | | contentDir | string | No | The directory where songs content exists (content by default) | | githubRepo | string | No | The owner and name of the content repository on GitHub | | gaTrackingId | string | No | Your site's Google Analytics tracking ID | | adSense | string | No | Your site's Google AdSense tracking ID | | baseUrl | string | No | The origin where your website will be hosted (e.g. https://guitar-book.netlify.app) | | twitterHandle | string | No | Your Twitter handle, without the "@" | | youtubeUrl | string | No | The URL of your YouTube channel | | navConfig | object | No | An object defining the top-left navigation links (see navConfig reference) | | checkLinksOptions | object | No | Options accepted by gastby-remark-check-links | | ignore | array | No | Files to ignore using anymatch-compatible definition pattern

sidebarCategories

The sidebarCategories option is an object keyed by category titles. Each entry in the object is an array of page paths. The path should resemble the location of a Markdown/MDX file in the git repository, relative to contentDir, and without the .md extension. Sidebar navigation items that are not a member of a category live under the null key. To add an external link to your sidebar, your can provide a string formatted like a Markdown link.

sidebarCategories: {
  null: ['index'],
  'George Ezra': [
    'blame-it-on-me',
    'listening-to-the-men'
  ],
  'Other Guitar Books': [
    '[Polish 🇵🇱](https://guitar-book.netlify.app)',
    '[Shanties 🏴‍](https://guitar-book.netlify.app/shanties)'
  ]
}

navConfig

The navConfig option should be an object keyed by link titles. The values should be objects with description, and url properties. Check out the default theme options for an example of the expected shape of this data.

Adding songs

This theme generates pages based on Markdown or MDX files in the contentDir directory of a repo. Your Markdown/MDX files should contain some frontmatter defining their titles and descriptions. To add new song use Verse component with .mdx file.

---
title: Hallelujah
description: Jeff Buckley
ytLink: https://www.youtube.com/watch?v=y8AWFf7EAc4 
---

import { Verse } from 'gatsby-theme-guitar-book';

<Verse text={`
[Intro]
C Am C Am
\n
[Verse 1]
  C                 Am
I heard there was a secret chord
     C                   Am
That David played and it pleased the lord
    F                G               C        G
But you don't really care for music, do you?
        C                  F           G
Well it goes like this the fourth, the fifth
    Am                 F
The minor fall and the major lift
    G            E7             Am
The baffled king composing hallelujah
\n
[Chorus]
     F           Am          F           C    G   C
Hallelujah, hallelujah, hallelujah, hallelu-u-u-u-jah ....
`}/>

Page URLs will be derived from the file paths of your Markdown. You can nest Markdown files within directories to create pages with additional path segments. You can overwrite this default path by adding a slug field to your Markdown frontmatter header.

Component shadowing

You can customize a website using this theme further by taking advantage of component shadowing.

import React from 'react';
import {Helmet} from 'react-helmet';

export default function SEO({title, description, siteName}) {
  return (
    <Helmet>
      <link rel="icon" href="/path/to/custom-favicon.ico" />
      {/* other SEO tags (OpenGraph, Twitter, etc.) */}
    </Helmet>
  );
}

Components

This theme exports React components that you can use in MDX files throughout a documentation website.

Verse

This component gives you ability to show the lyrics with mapped preview of chords.

| Prop | Type | Description | | -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | | text | string | New lines in lyrics must be split by \n, other way you will get error. All chords should be placed on top of song line to be properly mapped |

import { Verse } from 'gatsby-theme-guitar-book';

<Verse text={`
[Intro]
C Am C Am
\n
[Verse 1]
  C                 Am
I heard there was a secret chord
     C                   Am
That David played and it pleased the lord
    F                G               C        G
But you don't really care for music, do you?
        C                  F           G
Well it goes like this the fourth, the fifth
    Am                 F
The minor fall and the major lift
    G            E7             Am
The baffled king composing hallelujah
\n
[Chorus]
     F           Am          F           C    G   C
Hallelujah, hallelujah, hallelujah, hallelu-u-u-u-jah ....
`}/>

ExpansionPanel

An expandable panel of content used to hide complex information or instructions that might be a tangent from the main topic of the content it lives within.

| Prop | Type | Description | | -------- | ------ | ------------------------------------------------------------------ | | children | node | The content of the panel, usually includes an ExpansionPanelList | | title | string | The title of the panel, visible even when the panel is closed |

Deployment

All apps sites will eventually be deployed into a subdirectory, as configured by the pathPrefix option—/shanties, for example.

Examples

In apps directory you will find my 3 connected guitar-books (english, polish, shanties).

Template

If you want to start with your own guitar check template directory with tutorial how to start.

Important note: Guitar book always must have at least one .md and mdx file to build successfully.

Important note: To build successfully project with gatsby-theme-guitar-book plugin you must init git in project and publish it with some provider (it can be private repo and no matter which provider).