Group and sort Eleventy’s verbose output by directory (and show file size with benchmarks)

Overview

eleventy Logo

eleventy-plugin-directory-output

Group and sort Eleventy’s verbose output by directory (and show file size with benchmarks).

Sample output from eleventy-base-blog:

> [email protected] build
> eleventy

↘ _site/                               --                           --       --
  → about/index.html                   about/index.md            1.8kB    2.7ms
  ↘ feed/                              --                           --       --
    • .htaccess                        feed/htaccess.njk         0.1kB    0.2ms
    • feed.json                        feed/json.njk           106.8kB   17.3ms
    • feed.xml                         feed/feed.njk           109.8kB    9.8ms
  → page-list/index.html               page-list.njk             3.2kB    1.1ms
  ↘ posts/                             --                           --       --
    → firstpost/index.html             posts/firstpost.md        3.5kB    1.0ms
    → fourthpost/index.html            posts/fourthpost.md     101.0kB   27.2ms
    → secondpost/index.html            posts/secondpost.md       3.2kB    5.6ms
    → thirdpost/index.html             posts/thirdpost.md        4.5kB    7.5ms
    • index.html                       archive.njk               3.0kB   13.7ms
  ↘ tags/                              --                           --       --
    → another-tag/index.html           tags.njk                  2.1kB    0.9ms
    → number-2/index.html              tags.njk                  2.1kB    0.4ms
    → posts-with-two-tags/index.html   tags.njk                  2.3kB    0.2ms
    → second-tag/index.html            tags.njk                  2.5kB    0.5ms
    • index.html                       tags-list.njk             2.0kB    0.4ms
  • 404.html                           404.md                    1.9kB    0.4ms
  • index.html                         index.njk                 2.8kB    1.7ms
  • sitemap.xml                        sitemap.xml.njk           1.4kB    1.3ms
[11ty] Copied 3 files / Wrote 18 files in 0.16 seconds (8.9ms each, v1.0.1)

The full eleventy-plugin-directory-output documentation is on 11ty.dev.

npm Version GitHub issues

Installation

npm install @11ty/eleventy-plugin-directory-output

The full eleventy-plugin-directory-output documentation is on 11ty.dev.

Comments
  • Problem with custom template formats

    Problem with custom template formats

    I'm running in a problem with the custom template formats that I defined. The plugin works great, as long as I don't define such for CSS and JS. If I comment out the lines 53 to 93 in my .eleventy.js the plugin works fine. Is there anything I can do on my side?

    [11ty] Problem writing Eleventy templates: (more in DEBUG output) [11ty] > Having trouble writing template: _site/_source/scss/1_settings/_fonts.css

    TemplateWriterWriteError was thrown [11ty] > Cannot read property 'length' of undefined

    TypeError was thrown: [11ty] TypeError: Cannot read property 'length' of undefined at Object. (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy-plugin-directory-output/.eleventy.js:260:21) at Template.runLinters (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:530:14) at Template.renderPageEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:847:16) at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:872:32 at Array.map () at Template.generateMapEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:867:23) at TemplateWriter._generateTemplate (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:251:17) at TemplateWriter.generateTemplates (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:282:14) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async TemplateWriter.write (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:321:23)

    The error on the CSS file is just an example, I've had the same message on several JS files.

    Here's also the debug output:

    [11ty] Having trouble writing template: _site/_source/scss/1_settings/_fonts.css

    TemplateWriterWriteError was thrown Eleventy:EleventyErrorHandler (error stack): TemplateWriterWriteError: Having trouble writing template: _site/_source/scss/1_settings/_fonts.css Eleventy:EleventyErrorHandler at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:289:15 Eleventy:EleventyErrorHandler at processTicksAndRejections (internal/process/task_queues.js:93:5) Eleventy:EleventyErrorHandler at async Promise.all (index 5) Eleventy:EleventyErrorHandler at async Eleventy.executeBuild (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Eleventy.js:986:13) +0ms [11ty] Cannot read property 'length' of undefined

    TypeError was thrown: Eleventy:EleventyErrorHandler (error stack): TypeError: Cannot read property 'length' of undefined Eleventy:EleventyErrorHandler at Object. (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy-plugin-directory-output/.eleventy.js:260:21) Eleventy:EleventyErrorHandler at Template.runLinters (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:530:14) Eleventy:EleventyErrorHandler at Template.renderPageEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:847:16) Eleventy:EleventyErrorHandler at /workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:872:32 Eleventy:EleventyErrorHandler at Array.map () Eleventy:EleventyErrorHandler at Template.generateMapEntry (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/Template.js:867:23) Eleventy:EleventyErrorHandler at TemplateWriter._generateTemplate (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:251:17) Eleventy:EleventyErrorHandler at TemplateWriter.generateTemplates (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:282:14) Eleventy:EleventyErrorHandler at processTicksAndRejections (internal/process/task_queues.js:93:5) Eleventy:EleventyErrorHandler at async TemplateWriter.write (/workspaces/martinschneiderme-11ty/node_modules/@11ty/eleventy/src/TemplateWriter.js:321:23) +1ms

    opened by schneyra 2
  • Programmatic quietMode option not respected for directory output

    Programmatic quietMode option not respected for directory output

    I'm using the programmatic API in a test helper method to compile a single template, so that I can create a JSDOM object and attach a script to it for testing. The programmatic method allows passing an options object that can have a quietMode property, and it's helpful to suppress all output in my test runner.

    However, this option isn't respected by the eleventy-plugin-directory-output module so I get a lot of extraneous output from my test runner. I think the right way to fix this would be something like this:

    -    d.print();
    +    if (!eleventyConfig.quietMode) d.print();
    

    I thought I'd ask before submitting a PR if this is the best solution.

    bug 
    opened by webstackdev 1
  • 2.0.0-canary.16 doesn't report time, only size

    2.0.0-canary.16 doesn't report time, only size

    v1.0.2

    npm run build
    
    > [email protected] build
    > eleventy
    
    ↘ www/                    --                         --       --
      → liquid/index.html     src/liquid.liquid       0.2kB    5.0ms
      → nunjucks/index.html   src/nunjucks.njk        0.2kB    3.8ms
      • index.html            src/index.liquid      154.2kB   10.1ms
    [11ty] Benchmark      9ms  11%     1× (Configuration) "inspect" Liquid Filter
    [11ty] Wrote 3 files in 0.06 seconds (v1.0.2)
    

    v2.0.0-canary.16

    npm i @11ty/eleventy@canary -D
    
    added 27 packages, removed 142 packages, changed 12 packages, and audited 212 packages in 2s
    
    37 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    
    npm run build
    
    > [email protected] build
    > eleventy
    
    ↘ www/                    --                         -- --
      → liquid/index.html     src/liquid.liquid       0.2kB --
      → nunjucks/index.html   src/nunjucks.njk        0.2kB --
      • index.html            src/index.liquid      146.6kB --
    [11ty] Benchmark      7ms  11%     1× (Configuration) "inspect" Liquid Filter
    [11ty] Wrote 3 files in 0.05 seconds (v2.0.0-canary.16)
    
    opened by pdehaan 1
  • [feature] ability to limit depth

    [feature] ability to limit depth

    As I have many many directories in my build (2813 !), but only a dozen in the root folder, it would be great if I could set the maximum depth to report, directories reporting the sum of their "children" directories.

    opened by nhoizey 0
  • sort_by option

    sort_by option

    Add an option to the plugin configuration in .eleventy.js where it should be specified according to which criteria the file structure should be organized. For example, I would love to have the biggest files at the top.

    opened by xplosionmind 0
Owner
Eleventy
Eleventy
An Eleventy server plugin to use Browsersync with Eleventy 2.0+.

An Eleventy server plugin to use Browsersync with Eleventy 2.0+.

Eleventy 12 Sep 9, 2022
A lightweight extension to automatically detect and provide verbose warnings for embedded iframe elements in order to protect against Browser-In-The-Browser (BITB) attacks.

Enhanced iFrame Protection - Browser Extension Enhanced iFrame Protection (EIP) is a lightweight extension to automatically detect and provide verbose

odacavo 16 Dec 24, 2022
Collection of benchmarks of functional programming languages and proof assistants.

Functional Benchmarks This repository contains a collection of benchmarks of functional programming languages and proof assistants. It is split in two

null 22 Dec 12, 2022
A Tailwind plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and all variations.

Tailwind Labeled Groups A plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and

Max 18 Nov 21, 2022
A demo to show how to re-use Eleventy Image’s disk cache across Netlify builds.

Re-use Eleventy Image Disk Cache across Netlify Builds Live Demo This repository takes all of the high resolution browser logos and processes them thr

Eleventy 9 Apr 5, 2022
Script to fetch all NFT owners using moralis API. This script output is a data.txt file containing all owner addresses of a given NFT and their balances.

?? Moralis NFT Snapshot Moralis NFT API will only return 500 itens at a time when its is called. For that reason, a simple logic is needed to fetch al

Phill Menezes 6 Jun 23, 2022
Validate directory structure and file contents with an extension of JSON schema.

directory-schema-validator Description Validate directory structure and file contents with an extension of JSON schema. Install Install using NPM or s

Justin Poehnelt 5 Nov 1, 2022
Find and parse the tsconfig.json file from a directory path

get-tsconfig Find and parse tsconfig.json files. Features Zero dependencies (not even TypeScript) Tested against TypeScript for accuracy Supports comm

hiroki osame 66 Jan 2, 2023
TVMAZE API-based webapp, receives TV show episodes with all data about that TV show.

TVMAZE API-based webapp, receives TV show episodes with all data about that TV show. The Webapp has two interfaces: A home page, showing a list of Tv show episodes you can like. And a popup window with more data about the TV show that you can comment on.

Yasin Warsame 4 Aug 9, 2022
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022
Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Yongwook Choi 18 Nov 2, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
Using Htmx, ASP.NET Core, and Marten (postgres document db) to sort list

Using Htmx, ASP.NET Core, and Marten (postgres document db) to sort list

Khalid Abuhakmeh 5 Feb 16, 2022
⛲ Sort import declarations into a pleasing and readable cascade.

⛲ eslint-plugin-cascading-imports This plugin allows to automatically enforce a visual "cascading" order for import declarations. Imports in each bloc

Florent 1 Jan 20, 2022
URL Shortener API in NodeJS supporting pagination, sort params and lot more

node-url-shortener Built with ❤️ in NodeJS A simple URL Shortner REST API that uses shortid npm package to generate short endpoints for your long URL.

Dhairya Ostwal 3 Sep 22, 2022
Sort tsconfig.json compilerOptions

sort-compiler-options Sort tsconfig.json compilerOptions in the same order as the TSConfig Reference (Support v4.5.5 or less) Install npm i sort-compi

P-Chan 6 Oct 19, 2022
A small CLI to sort any specified json files alphabetically

This is a small CLI to sort any specified json files alphabetically. This was created to sort localization files, but maybe you will find another use case.

PLAYT.net 4 Mar 20, 2022
Sort imports by path - VS Code extension

Import sort by absolute path The sorting algorithm will group each item in the array and sort (alphabetically) its children that starts with the path

Richard Bidin 3 Feb 2, 2022
Sort tailwind classes for each elements className list by a given order-config

eslint-plugin-tailwind-classname-order This eslint plugin automatically orders the tailwind classes included in the className tags from each element b

aacn 4 Nov 25, 2022