Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eleventy-plugin-calendar

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eleventy-plugin-calendar

A plugin for generating an ICS calendar and events.

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

eleventy-plugin-calendar

Eleventy plugin containing filters for generating ICS calendar and ICS events using the Nunjucks templating engine.

Motivations

Turn your posts directly into events that will show up in a published ICS calendar, or that you can import into another calendar!

Installation

npm install eleventy-plugin-calendar 

Open up your Eleventy config file (probably eleventy.config.js) and use addPlugin:

const calendarPlugin = require("eleventy-plugin-calendar");

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

You're now supplied with the following filters:

  • slugifyEvent: slugify event name and date. Useful for setting calendar event permalink.
  • toCalendar: turn a collection into an ICS calendar.
  • toCalendarEvent: turn an event into an ICS event.

Options

const calendarPlugin = require("eleventy-plugin-calendar");

module.exports = eleventyConfig => {
    eleventyConfig.addPlugin(calendarPlugin, {
        defaultDuration: 60,
        defaultOrganizer: {
            name: "hjonin",
            email: "hjonin@foo.bar"
        }
    });
};

Usage

See sample/calendar.njk for an example ICS calendar template and sample/calendar-event.njk for an example ICS event template.

Copy and paste these templates and modify the YAML frontmatter to match your calendar’s needs. Make sure collections.events (the collection of post files using the events tag) matches the template collection you want to provide a calendar and calendar events for.

Place the files anywhere in your project and they will be transformed into a calendar.ics and calendar/{eventName-eventDate}.ics file at the root of your website (or depending on your calendar and events permalinks if you've changed them) when Eleventy builds it.

Ultimately your calendar will be available at https://yourwebsite.com/calendar.ics.

Run the example:

npm run sample
[npm clean]

Note on dates

They must be of HTML format, see here for examples.

Development and testing

Install dependencies:

npm install

Test:

npm test

Publishing

npm version [version]
npm publish

Keywords

FAQs

Package last updated on 28 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc