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

@fec/eleventy-plugin-pokedex

v0.2.1

Published

Eleventy plugin to add a Pokédex to your website.

Downloads

9

Readme

@fec/eleventy-plugin-pokedex

Eleventy plugin to add one or more Pokédex to your website. Gotta catch em all!

You can see an example on the authors website: Pokémon Sword Pokédex

Installation

You can install the plugin through NPM:

npm install -D @fec/eleventy-plugin-pokedex

After installing the plugin you need configure it and setup your Pokédex:

  1. Enable the plugin and configure it
  2. Create a page that shows your Pokédex
  3. Add CSS to give your Pokédex some styles
  4. Setup sprites to include images in your Pokédex

Enable the plugin and configure it

You can then add the plugin to your Eleventy configuration (.eleventy.js by default):

const PokedexPlugin = require("@fec/eleventy-plugin-pokedex");

module.exports = (eleventyConfig) => {
  eleventyConfig.addPlugin(PokedexPlugin);
  // ...
};

Create a page that shows your Pokédex

In your Eleventy web site you need to add a page where you use the shortcodes provided by @fec/eleventy-plugin-pokedex and data configured in the front matter or anywhere else in the Eleventy data cascade. The data structure is very simple: one field with the name of the Pokédex you want to render and a list of all Pokémon in the Pokédex with true/false assigned to it. For example, the following Nunjucks template renders the Sinnoh Pokédex used in Shiny Pearl and Brilliant Diamond:

---
pokedex: pokedex-sinnoh-bdsp
pokedex_entries:
  turtwig: true
  grotle: true
  torterra: false
  chimchar: false
  monferno: false
  # Abridged list for brevity
---
{% pokedex_progress pokedex, pokedex_entries %}

{% pokedex_list pokedex, pokedex_entries %}

You don't have to write the YAML list of all Pokémon in the Pokédex, you can copy the pre-compiled list from the .yaml files in data/.

Add CSS to give your Pokédex some styles

When you render the page you will see the Pokédex, but it is currently not styled. You can manually define CSS for your Pokédex and you have the option to set the class names which the plugin uses when generating the HTML. However, the plugin also includes some CSS styles to get you started. You need to copy it into your build directory:

// .eleventy.js
// ...
eleventyConfig.addPassthroughCopy({
  "node_modules/@fec/eleventy-plugin-pokedex/css/*.css": "/css",
});

Setup sprites to include images in your Pokédex

Lastly you want to include images of your Pokémon in your Pokédex. In this plugin we are using the PokéSprite project. You can either download the sprites or you can just add the PokéSprite repository as a submodule:

git submodule add [email protected]:msikma/pokesprite.git

Then we can add another passthrough copy to our Eleventy configuration:

eleventyConfig.addPassthroughCopy({
  "pokesprite/pokemon-gen8/regular/*.png": "/pokesprite",
});

At the moment (January 2024) the PokéSprite project does not contain any sprites from Pokémon Scarlet and Violet (Paldea region), however, you can download sprites from other places and easily combine them using another passthrough copy command. You can find sprites from SV, for example, in this discussion in the PokéSprite repository: #135 Add sprites from Pokemon Scarlet and Violet

You can take a look at the example in example/ to see how everything works together.

Shortcodes

  • pokedex_completion_perc
  • pokedex_completion_missing
  • pokedex_completion_count
  • pokedex_total_count
  • pokedex_pokemon_complete_class
  • pokedex_entry
  • pokedex_list
  • pokedex_progress
  • pokedex_progress_bar

Filters

  • pokedex_pokemon_list
  • pokedex_pokemon_sprite

Supported Pokédexes

| Pokédex | Name | | ---------------- | --------------------- | | Galar | pokedex-galar | | Kanto (Let's Go) | pokedex-kanto-letsgo | | Kanto | pokedex-kanto | | National | pokedex-national | | National (BDSP) | pokedex-national-bdsp | | Paldea | pokedex-paldea | | Sinnoh (BDSP) | pokedex-sinnoh-bdsp | | Paldea | pokedex-paldea | | Kitakami | pokedex-kitakami | | Blueberry | pokedex-blueberry |