Giter VIP home page Giter VIP logo

eleventy-plugin-post-graph's Introduction

eleventy-plugin-post-graph

npm

Generate Github-style post distribution graph for your blog posts in Eleventy

Basic Usage

Install the package

npm install @rknightuk/eleventy-plugin-post-graph --save-dev

In your Eleventy config:

const postGraph = require('@rknightuk/eleventy-plugin-post-graph')

module.exports = (eleventyConfig, options = {}) => {
    eleventyConfig.addPlugin(postGraph)
}

In your template, use the shortcode and pass it your posts collection:

{% postGraph collections.posts %}

Advanced Usage and Options

See the docs

eleventy-plugin-post-graph's People

Contributors

hamatti avatar michaelseanbecker avatar rknightuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

eleventy-plugin-post-graph's Issues

Post graph is inaccessible

Firstly, thanks for this plugin - it looks great!

Apologies if this isn't the case, but I think that the graph is inaccessible to screen reader users and other users of assistive tech since, as far as I can tell, the graph is made up of a series of <div> elements. Would you consider reworking how the graphs are drawn, so that the information that the graphs are trying to convey are also accessible to users of assistive technologies?


This may or may not help, but Adrian Roselli wrote up a great piece on accessibility issues with GitHub's contributions graph. GitHub have since made some accessibility improvements. One of the changes they made was switching the graph from using an SVG to a <table>.

Document collections.posts

In the docs, it shows either using collections.posts to the shorttag, or custom data. But is there anything in particular in regards to collections.posts that folks should know about? I assume it has to have a date value?

Strange Behaviour: Extra HTML Tags

Hi there,

first of all: thanks for this very cool plugin :)

I'm using it with data obtained from git log, the live version can be found here: https://ttntm.me/changelog/#timeline

Yesterday I noticed strange sizing ond extreme overflow in Chrome/Chromium on all devices I checked. After a little bit of investigation, I managed to figure out the cause - an extra <br> after the last div.epg__box in div.epg__squares:

Screenshot from 2024-04-10 08-57-19

I was rather late, so I checked again this morning and compared it to the version on your website.

Yours

Months

Screenshot from 2024-04-10 08-55-45

Squares

Screenshot from 2024-04-10 08-55-56

Mine

Months

Screenshot from 2024-04-10 08-54-32

Squares

Screenshot from 2024-04-10 08-55-01

Workaround

.epg__months > :not(div),
.epg__squares > :not(div) {
  display: none;
}

Additional Notes

  • I'm using htmlmin for my site; tried turning it off, but the result was the same
  • Firefox does not have any issues with the extra tags

noLabels option generates 'false' line in CSS when not set to true

When the noLabels option is left to its default setting of false, it generates a line in the CSS of 'false' rather than being silent, resulting in a CSS validation error. When it is set to true, the option setting works correctly.

I tracked it down to this line in your plugin:

${options.noLabels && `
        .${prefix}__year, .${prefix}__months { display: none; }
    `}

It should probably be something like this:

${options.noLabels ? `.${prefix}__year, .${prefix}__months { display: none; }` : ''}

Strange "false" line between CSS and HTML

While working out some of my own issues to get the plugin working in my context. I noticed what appears to be an errant line with the word "false" on it between the CSS and HTML generated by the plugin. I'm attaching a screen grab of a portion.
CleanShot 2023-12-21 at 16 37 18@2x

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.