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

@progital/gatsby-theme-wp-source-one

v0.1.5

Published

WordPress source theme for Gastby

Downloads

1

Readme

@progital/gatsby-theme-wp-source-one

Description

The idea behind this theme is making a one-stop solution for a WordPress blog owner who wants to switch to Gatsby powered frontend. Simple to configure that works out of the box. For a common use scenario - standard WordPress installation, basic posts and pages content - only a source url is needed.

{
    resolve: '@progital/gatsby-theme-wp-source-one',
    options: {
        wordPressUrl: 'https://your.wordpress.site/',
    },
}

Dependencies

This theme uses GraphQL API to source WordPress content. Therefore the source WordPress site must use the WPGraphQL plugin.

How to install

yarn add @progital/gatsby-theme-wp-source-one
{
  resolve: '@progital/gatsby-theme-wp-source-one',
  options: {
    wordPressUrl: 'https://your.wordpress.site/',
    menuLocation: 'MENU_1',
  },
},

Available options

wordPressUrl - source site.

uploadsUrl - (optional) WordPress uploads folder. Uses default if this option not set.

processPostTypes - (optional) post types to process. You can include custom post types as defined in WPGraphQL however CPTs also need to have some code added to create pages on Gatsby site. And that is currently outside of this theme's scope.

useWebp - (optional) if true uses WebP images. Default is false.

menuLocation - WordPress menu location slug. Sanitized.

menuLocation

A build would break if menuLocation was not cofigured right. The location slug comes from register_nav_menus function call in functions.php (example) of your WordPress theme.

siteMetadata

siteMetadata: {
    title: 'Site title',
    author: 'Author name',
    description: 'Site description',
    social: [
        {
            name: 'twitter',
            url: 'https://twitter.com/your_twitter',
        },
    ],
},

Features

  • Uses WordPress menu from a defined location. Only first level menu items are displayed. "Home" menu item is automatically added if there is no menu item linking to the site homepage.
  • Supports post categories.
  • Downloads images embedded in posts/pages/CPTs and hosted on the WordPress site. Converts <img> tags to Gatbsy <Img> component.
  • Downloads featured images (post thumbnails) and makes them available as Gatsby <Img> component.
  • Downloads all other files linked in posts/pages/CPTs and hosted on the WordPress site. Serves them from the Gatsby static folder.
  • Links embedded in posts that lead to other pages are converted to <Link> component.

This theme utilizes the gatsby-wpgraphql-inline-images plugin for most of the content processing.

Examples of usage

I have a WordPress site serving demo content at https://noh.progital.dev. It uses the default twentynineteen theme so there is no need to configure menu location.

{
    resolve: '@progital/gatsby-theme-wp-source-one',
    options: {
        wordPressUrl: 'https://noh.progital.dev/',
    },
},

The demo site repo is at https://github.com/progital/gatsby-theme-wp-source-one-demo-site and a live demo is available at https://gatsby-wp-theme.progital.dev.

Shout Outs

Special thanks for inspiration and some borrowed code go to:

https://github.com/jlengstorf
https://github.com/jasonbahl
https://wordpress.org/themes/juliet/

Demo site uses images by Unsplash and text content from Wikipedia.

How to contribute

This is a WIP and any contribution, feedback and PRs are very welcome. Issues is a preferred way of submitting feedback, but you can also email to [email protected].