Coder Social home page Coder Social logo

eshlox / gatsby-theme-axii Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 22.51 MB

AXII - A Gatsby blog theme.

Home Page: https://gatsby-theme-axii.netlify.com

License: MIT License

JavaScript 27.03% TypeScript 72.97%
blog-theme gatsby gatsby-theme react typescript

gatsby-theme-axii's People

Contributors

dependabot-preview[bot] avatar eshlox avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

magic8baller

gatsby-theme-axii's Issues

Inform the user when Algolia keys are not available

The theme tries to get Algolia keys and application ID from environment variables. If the environment variables are not set, the build process fails.

Cannot query field "search" on type "SiteSiteMetadata".

GraphQL request:5:9
4 |       siteMetadata {
5 |         search {
  |         ^
6 |           algolia {

File: node_modules/@eshlox/gatsby-theme-axii/src/components/Search/Search.tsx:27:9

The idea is to print some message to inform the user what's wrong.

Update the README

  • how to install and use the theme
  • how to setup the development environment

Add comments type to GraphQL

The theme allows us to add comments: false to the frontmatter to disable comments for the article.

comments: false

The theme should create a comments type for GraphQL in case there is no article with the comment option, otherwise, it won't work.

I wanted to add this to gatsby-node.js:

exports.createSchemaCustomization = ({ actions, schema }) => {
  const { createTypes, createFieldExtension } = actions;

  createFieldExtension({
    name: `defaultTrue`,
    extend() {
      return {
        resolve(source, args, context, info) {
          if (source[info.fieldName] == null) {
            return true;
          }
          return source[info.fieldName];
        }
      };
    }
  });

  createTypes(`
    type MdxFrontmatter @infer {
      comments: Boolean @defaultTrue
    }
    type Mdx implements Node @infer {
      frontmatter: MdxFrontmatter
    }
  `);
};

but it does not create a new type.

I see these warnings during the build process:

warn Plugin `gatsby-plugin-mdx` tried to define the GraphQL type `MdxFrontmatter`, which has already been defined by the plugin `@eshlox/gatsby-theme-axii`.
warn Plugin `gatsby-plugin-mdx` tried to define the GraphQL type `Mdx`, which has already been defined by the plugin `@eshlox/gatsby-theme-axii`.

Maybe there is another/better way?

Full width image (component)

It doesn't have to be a component but I would like to be able to mark an image somehow and display it with the maximum width (100% of the window).

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.