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

@florantara/gatsby-theme-mercadolibre-store

v1.0.14

Published

<p> <img src="http://img.shields.io/npm/v/@florantara/gatsby-theme-mercadolibre-store.svg?style=flat" alt="npm version"> <img src="https://app.codeship.com/projects/d724b210-9925-0137-7a7c-5a4d2a496d42/status?branch=master" alt="TS checks and linting

Downloads

34

Readme

Gatsby Theme that imports products from Mercado Libre and shows them on a grid format + detail screen.

Demo

https://gatsby-theme-mercadolibre-store.netlify.com

Product Detail

Features

  • Sources from a MercadoLibre user.
  • Creates a Products grid and a Product detail screen.
  • Offers a "load more" button as the default pagination, and the ability to "paginate" into pages.
  • Uses Theme UI leveraging variants.
  • Uses MDX for static pages, and provides fragments.
  • Written in TypeScript 👮‍♀️

... more! and more to come.

Install

From your Gatsby site's root:

npm install @florantara/gatsby-theme-mercadolibre-store

or

yarn add @florantara/gatsby-theme-mercadolibre-store

Setup

Import data

Open gatsby-config.js and configure it under plugins.

{
  resolve: "@florantara/gatsby-theme-mercadolibre-store",
  options: {
    mercadoLibre: {
      siteID: "yoursiteid",
      user: "youruser"
    },
  },
}

About your MercadoLibre ID and user >

Paths and Pagination

You can customize the slug for the products listing and the detail page paths.

The default pagination format is a "load more" button, but you can setup "paginated" pagination.

{
  resolve: "@florantara/gatsby-theme-mercadolibre-store",
  options: {
    productDetail: {
      slug: "producto",
    },
    productsListing: {
      slug: "productos",
      enablePagination: true, // defaults to false
      productsListingPerPage: 3
    },
  }
}

Title and Logo

In gatsby-config.js, use the siteMetadata for the title. We'll use this for SEO, and if there isn't a logo image.

siteMetadata: {
  title: "Plants Store",
}

To import a logo, configure:

options: {
  site: {
    logoURL:
      "https://placeholder.com/wp-content/uploads/2018/10/placeholder.com-logo3.jpg",
    }
  }
}

Note: we currently don't support using a local image, but this image will be imported into the site. It won't be referenced using the link provided.

Shadow theme files

To override any file from the theme, create in your site's src/ folder:

@florantara/gatsby-theme-mercadolibre-store

Then replicate the same folder/file structure from the theme that you want to shadow.

🔌 Remember to restart the server for this to take effect.

Theming

Most components come with a Theme UI variant setup you can use to style them, or you can style any component that the Theme Spec provides.

Variants reference >

Customize the theme

  1. Install lodash
npm i --save lodash
  1. Create a folder in your site to store the shadow files: yourProjectRoot/src/@florantara/gatsby-theme-mercadolibre-store

  2. Inside that folder create a settings folder, and then theme.js file inside of it:

// In settings/theme.js
import merge from "lodash/merge"
import { theme as base } from "@florantara/gatsby-theme-mercadolibre-store/src/settings/theme"

export const theme = merge(base, {
  // Your overrides here
})

Follow the Theme UI documentation to know what properties to use.

Typography

The theme uses Roboto for the body and headings too.

You can configure any other typography you want in the theme settings - after importing it to your site with a plugin such as gatsby-plugin-prefetch-google-fonts.

Use the fonts property of Theme UI.

fonts: {
  heading: "Roboto, system-ui, sans-serif",
  body: "Roboto, system-ui, sans-serif",
}

Site settings

We provide a set of settings for hiding/showing things, like the price on the products and the category, and also other site-wide configurations.

Settings reference >

Following the same directions as with Theming, shadow this file: settings/siteConfig.js.

// In settings/site.js
import merge from "lodash/merge"
import { siteConfig as base } from "@florantara/gatsby-theme-mercadolibre-store/src/settings/site"

export const siteConfig = merge(base, {
  // Your overrides here
})

Static Pages

The homepage gets created automatically for you with some quick start documentation. Edit it from yourProjectRoot/static-pages/index.mdx.

Use MDX to create pages. Place them in src/static-pages.

At the top of the page, setup the path and title like so:

You can also specify a css class that will be added to the page container if you need to add styles to your new page, using the bodyClass field.

---
path: "/nueva-pagina"
title: "Nueva Página"
bodyClass: "pageHomepage"
---

Fragments for Pages

There's a few reusable components we are calling "fragments" available:

  • Hero
  • Paper
  • FeaturedProducts
  • Layout (width compact and tiny options)
  • Container (wraps everything with a maxWidth container)

...more to come!

Custom Fragments

You can create as many fragments as you want to use on the MDX pages. These can be buttons, banners, ads, etc.

  1. In the shadow folder (read the "Override the settings" if you don't have one yet), create a fragments folder, and then an index.js file inside, with:
// In fragments/index.js
import merge from "lodash/merge"
import { fragments as base } from "@florantara/gatsby-theme-mercadolibre-store/src/fragments/index"

export const fragments = merge(base, {
  // Your new fragments here
})

Example:

// In fragments/index.js
import merge from "lodash/merge"
import { fragments as base } from "@florantara/gatsby-theme-mercadolibre-store/src/fragments/index"

import { MyCustomButton } from "../components/MyCustomButton";

// Custom fragments
export const fragments = merge(base, {
  MyCustomButton
})

Performance

Lighthouse scores for the Products Listing page (which has many images).

🔥 Lighthouse

Accessibility

Navigating with Tabs:

Contributions

I'd love to hear ideas of features or improvements.

If you are considering using this Theme and would love some feature let me know!

Found an issue? Please submit it here

Fork

Upon forking this repository, setup the environment running this from the root of the cloned repo:

yarn
yarn workspace demo develop

Use the clean command to run gatsby clean. This will delete the public and .cache folders.

yarn workspace demo clean

Then work on the theme folder.

A note on language

The codebase is in english and the content is in spanish, since the soul of the Theme is MercadoLibre and the target users/public are spanish speakers accessibility labels, static and customizable words default to spanish.