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

@walltowall/gatsby-theme-ww-prismic

v2.0.1

Published

Gatsby theme providing a base for using Prismic as a datasource for Wall-to-Wall Gatsby websites.

Downloads

86

Readme

@walltowall/gatsby-theme-ww-prismic

Gatsby theme providing a base for using Prismic as a datasource for Wall-to-Wall Gatsby websites.

Install

npm install --save @walltowall/gatsby-theme-ww-prismic

In addition to installing the theme, install all peer dependencies listed in package.json.

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: '@walltowall/gatsby-theme-ww-prismic',
    options: {
      // Path to the project's root directory. This is required and should be
      // set to `__dirname`.
      root: __dirname,

      // The name of your prismic.io repository. This is required.
      // Example: 'gatsby-source-prismic-test-site' if your prismic.io address
      // is 'gatsby-source-prismic-test-site.prismic.io'.
      repositoryName,

      // An API access token to your prismic.io repository. This is required.
      // You can generate an access token in the "API & Security" section of
      // your repository settings. Setting a "Callback URL" is not necessary.
      // The token will be listed under "Permanent access tokens".
      accessToken,

      // Set a link resolver function used to process links in your content.
      // Fields with rich text formatting or links to internal content use this
      // function to generate the correct link URL.
      // The document node, field key (i.e. API ID), and field value are
      // provided to the function, as seen below. This allows you to use
      // different link resolver logic for each field if necessary.
      // See: https://prismic.io/docs/javascript/query-the-api/link-resolving
      linkResolver = () => linkResolverPathFor,

      // Set a list of links to fetch and be made available in your link
      // resolver function.
      // See: https://prismic.io/docs/javascript/query-the-api/fetch-linked-document-fields
      fetchLinks = ['page.parent'],

      // Set an HTML serializer function used to process formatted content.
      // Fields with rich text formatting use this function to generate the
      // correct HTML.
      // The document node, field key (i.e. API ID), and field value are
      // provided to the function, as seen below. This allows you to use
      // different HTML serializer logic for each field if necessary.
      // See: https://prismic.io/docs/nodejs/beyond-the-api/html-serializer
      htmlSerializer,

      // Provide an object of Prismic custom type JSON schemas to load into
      // Gatsby. This is required.
      schemas,

      // Set a default language when fetching documents. The default value is
      // '*' which will fetch all languages.
      // See: https://prismic.io/docs/javascript/query-the-api/query-by-language
      lang,

      // Set a function to determine if images are downloaded locally and made
      // available for gatsby-transformer-sharp for use with gatsby-image.
      // The document node, field key (i.e. API ID), and field value are
      // provided to the function, as seen below. This allows you to use
      // different logic for each field if necessary.
      // This defaults to always return true.
      shouldNormalizeImage,

      // Set the prefix for the filename where type paths for your schemas are
      // stored. The filename will include the MD5 hash of your schemas after
      // the prefix.
      // This defaults to 'prismic-typepaths---${repositoryName}'.
      typePathsFilenamePrefix,

      // Define pages that should not be deleted and recreated with the UID in
      // context. Generally, this should be a list of pages not created by
      // Prismic.
      // This defaults to /reference/*, /404/
      pageOverrideBlacklist: [/\/reference\//, /\/404/],

      // Define which template pages use by setting metadata criteria. Each key
      // in the object represents a template filename in `src/templates/`.
      // Pages can be filtered using the following criteria:
      //   - metadataType: The page must have this metadata type.
      //   - tag: The page must have this tag.
      templates: {
        blogPost: { metadataType: 'PrismicPageMainBlogPost', tag: 'Blog Post' }
      },

      // Create a redirect at /admin to the Prismic repository.
      // This defaults to true.
      createAdminRedirection: true,
    },
  },
]