eleventy | simpler site generator | Static Site Generator library

 by   11ty JavaScript Version: v2.0.1 License: MIT

kandi X-RAY | eleventy Summary

kandi X-RAY | eleventy Summary

eleventy is a JavaScript library typically used in Web Site, Static Site Generator, Jekyll applications. eleventy has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i @gerhobbelt/eleventy' or download it from GitHub, npm.

A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML. Works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, and JavaScript Template Literals.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              eleventy has a medium active ecosystem.
              It has 14470 star(s) with 447 fork(s). There are 85 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 445 open issues and 1701 have been closed. On average issues are closed in 110 days. There are 17 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of eleventy is v2.0.1

            kandi-Quality Quality

              eleventy has 0 bugs and 0 code smells.

            kandi-Security Security

              eleventy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              eleventy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              eleventy is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              eleventy releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              eleventy saves you 8 person hours of effort in developing the same functionality from scratch.
              It has 24 lines of code, 0 functions and 257 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed eleventy and discovered the below as its top functions. This is intended to give you an instant insight into eleventy implemented functionality, and help decide if they suit your requirements.
            • Add an entry to the server .
            • Parses a bunch of blocks
            • Parse content of a block .
            • Renders a Jade instance
            • This is the entry point for the EdgeGraph .
            • Parse a template tag
            • Main content of a tag
            • Wrap a plain object in a closure
            • Compiles a template file .
            • Event handler for serverless events
            Get all kandi verified functions for this library.

            eleventy Key Features

            No Key Features are available at this moment for eleventy.

            eleventy Examples and Code Snippets

            No Code Snippets are available at this moment for eleventy.

            Community Discussions

            QUESTION

            11ty pagation across multiple directories / multiple pagation
            Asked 2022-Mar-13 at 13:06

            Im using Eleventy/11ty site generator and I have a myData object structured like this

            ...

            ANSWER

            Answered 2022-Mar-13 at 13:06

            You should be able to use computed data + JS front matter to get this to work:

            Source https://stackoverflow.com/questions/71453570

            QUESTION

            Toggling Dark mode button stops working after AJAX calls in click event listener (all logic wrapped in an IIFE)
            Asked 2022-Mar-08 at 08:01

            For my personal blogging site (https://victorfeight.com/) served behind Cloudflare pages, I'm using Eleventy with a custom script that include dark mode toggling logic, SPA-like page switches with AJAX, and search functionality with Elasticlunr and JavaScript . As I am new to JavaScript Web development and opted not to use a Framework to achieve SPA page switches, I decided to implement all the logic into a single file, wrapped in an IIFE (passing in window and document). I'm wondering if this is the standard way to implement this sort of logic together, or if I should be using webpack or a more modern solution. I'm also wondering if it's possible to load dark mode/light mode script logic and search mode logic per page, in spite of using an AJAX url-switching logic.

            First issue: Certain click event handling logic seems to be interrupting my new dark mode toggle, introduced in the same file. I implemented logic found here for dark mode: https://jec.fyi/blog/supporting-dark-mode And I implemented search functionality using logic found here: https://www.belter.io/eleventy-search/

            I have the following HTML in my Liquid template, which is loaded by default:

            ...

            ANSWER

            Answered 2022-Mar-06 at 20:07

            Let me take this step my step.

            First issue: The click event handling logic

            I re-implemented all of my javascript logic into separate files, which get minified by Rollup.js now.

            Here is my new rollup build config:

            Source https://stackoverflow.com/questions/71261900

            QUESTION

            Iterate over global data subfolder in Eleventy / 11ty
            Asked 2022-Feb-20 at 15:50

            I'm using Eleventy and have created the subfolder yummy in my global data folder, that contains the following files:

            ...

            ANSWER

            Answered 2022-Feb-20 at 15:46

            Managed to solve this myself by adding a second loop.

            Source https://stackoverflow.com/questions/71195379

            QUESTION

            11ty - How do I display post / page year?
            Asked 2022-Feb-06 at 14:00

            I'm using Eleventy and using Posts. I have set the date in the meta data using the format

            date: 2021-09-10.

            I can display the full date using

            {{ page.date | readableDate }}

            But I want to display just the year (YYYY) within the post content. I'm using Nunjucks.

            How do i do this?

            I've tried

            {{ page.date.getFullYear }}

            This gives the following error:

            function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return obj[val].apply(obj, args); }

            Any help would be really appreciated - thanks!

            ...

            ANSWER

            Answered 2022-Feb-06 at 14:00

            Add a filter to your .eleventy.js file

            Source https://stackoverflow.com/questions/70987695

            QUESTION

            Eleventy: Create "View all posts in collection" link
            Asked 2022-Feb-06 at 13:45

            I'm trying to build a site in Eleventy. The site has blog posts in two collections: A and B. When I'm reading a post in the collection A, I'd like to have a link after the post content that says, "View all A posts". And when I'm reading a post in collection B, I'd like to see a "View all B posts" link.

            The blog posts share the same _includes template post.html. In that template, I should be able to create an if statement in nunjucks that goes something like this:

            ...

            ANSWER

            Answered 2021-Sep-27 at 12:59

            Given that you have blog posts separated by folder, you can create a directory data file that specifies a value for the directory (A, B). Something like so:

            Source https://stackoverflow.com/questions/69302683

            QUESTION

            Use Zenject FromSubContainerResolve on ProjectContext to SceneContext
            Asked 2022-Feb-04 at 17:35

            I have a Unity + Zenject setup with a ProjectInstaller with some global dependencies that adhere to a "modal" interface, e.g.,

            ...

            ANSWER

            Answered 2022-Feb-04 at 17:35

            The problem is that that ModalManager can only be injected with dependencies that are added directly to ProjectContext. For these kinds of problems I recommend using the following pattern:

            Source https://stackoverflow.com/questions/70989976

            QUESTION

            Running eleventy build (via npm run) as AWS Lambda function
            Asked 2022-Jan-02 at 18:40

            I have a eleventy Node project, which renders HTML from a JSON file.

            Currently, I run this locally using npm run (which runs the eleventy CLI)

            Here's the workflow I have in my head:

            • put the JSON file in a S3 bucket
            • on each file change, run the HTML build
            • push the output to a different S3 bucket, which serves the web page

            Conceptually, I feel like this would be a standard FaaS use case.

            Practically, I stumble over the fact that the Node.js-Lambda runtime always expects an explicit function handler to be invoked. It seems Eleventy does not provide a standard way to be invoked from code (or I have not discovered this yet).

            I found that I could build my package into a Docker container and run the npm run as Entrypoint. This would surely work, but seems unnecessary, since the Lambda-provided Node.js runtimes should be capable of running my npm build command if I put my packages in the deployment artifact.

            Do I have a knot in my brain? Anything I'm overlooking? Would be happy about any input.

            ...

            ANSWER

            Answered 2022-Jan-02 at 18:40

            I'm not sure this is supported as I don't see it documented, but I looked at the unit tests for Eleventy and saw many examples of this (https://github.com/11ty/eleventy/tree/master/test). I tried the following and it worked. Note that init an write are both async and I do NOT properly await them, I was just trying to get a simple example:

            Source https://stackoverflow.com/questions/70536908

            QUESTION

            Maintaining external links in Eleventy
            Asked 2021-Dec-03 at 02:20

            I'm using markdown reference links in my eleventy site.

            Rather than repeatedly defining links on each page, I'd rather put them in one place, and just reference them in my pages.

            For example links.md could contain:

            ...

            ANSWER

            Answered 2021-Dec-03 at 02:20

            If you want to define the links in one spot and access them globally in your templates, you can create a global data file in the _data/* directory containing link definitions and then reference them in your Markdown files. Below is an example global data file _data/links.json:

            Source https://stackoverflow.com/questions/70206178

            QUESTION

            11ty: --incremental not having any effect?
            Asked 2021-Nov-02 at 15:33

            I'm using this on my package.json

            ...

            ANSWER

            Answered 2021-Nov-02 at 15:33

            I believe incremental is only meant to be used with serve. The docs say:

            "Incremental builds perform a partial build operating only on files that have changed to improve build times when doing local development."

            In my testing, I confirmed this. I ran eleventy --incremental --serve and noticed that it would only rebuild one file at a time when I changed it. If you run it by itself, it's going to create a full build every time, as documented here: https://www.11ty.dev/docs/usage/incremental/#cold-start

            Source https://stackoverflow.com/questions/69779416

            QUESTION

            Nunjucks for loop running twice
            Asked 2021-Oct-06 at 00:00

            I'm building a website using Nunjucks and Eleventy. I'm attempting to create an unordered list with a Nunjucks for loop (the data is stored in a JSON file). Everything appears to be working, except that the loop runs twice, when it should only run once.

            JSON

            ...

            ANSWER

            Answered 2021-Oct-06 at 00:00

            There was a copy of the JSON file saved inside of my input folder. I deleted it and now the HTML output no longer shows the rendered data an extra time. Thank you, @RaymondCamden!

            Source https://stackoverflow.com/questions/69376645

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install eleventy

            Read our Getting Started guide.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries