@la-ots/eleventy-plugin-pelican v1.0.1
Pelican Eleventy Plugin
Eleventy plugin to build websites and documentation using the Pelican design system
Inspired by the GOV.UK Eleventy plugin: https://github.com/x-govuk/govuk-eleventy-plugin
You’re welcome to use this plugin even if your application isn’t considered part of the Louisiana.gov system, provided the application does not:
- Identify itself as being part of Louisiana.gov
- Use the Louisiana state seal or OTS logo as an identifying mark
- Suggest that it’s an official Louisiana.gov website if it’s not
Requirements
- Node.js v16 or above
- Eleventy v1.0.0 or above
Installation
> npm install @la-ots/eleventy-plugin-pelican --saveUsage
Include the following in your Eleventy config file (typically .eleventy.js'):
const pelicanEleventyPlugin = require("eleventy-plugin-pelican");
eleventyConfig.addPlugin(pelicanEleventyPlugin, {
// configuration options
});Debugging
You can use the debugging instructions provided by Eleventy. The debug key is PELICAN:
> DEBUG=Pelican* NODE_ENV=development ELEVENTY_ENV=development eleventy --serveConfiguration
These configurations are set in the Eleventy config
{
// Default site title - can be overridden in page level meta
title: null,
// Default site description - can be overridden in page level meta
description: null,
// Site URL - used for URL generation
url: null,
// Relative favicon path
favicon: null,
// Relative image path for site level social card
social: {
image: null
},
// layout specific configurations
layouts: {
// any custom css or javascript files to include on all pages
// use paths that are relative to the build output folder
// will be included as:
// <link rel="stylesheet" href="{path}" />
// <script src="{path}"></script>
css: [],
javascript: [],
// sidebar layout configurations
sidebar: {
// title (defaults to site title)
title: null,
// icon
icon: {
// url (defaults to favicon)
url: null,
// alt text
alt: null
}
},
// docs layouts
docs: {
// github button
github: {
// show "edit on Github" button?
button: false,
// Github repository url
repository: null
}
}
},
// asset building/bundling
assets: {
// use core assets?
// core assets include Pelican libraries and some template related assets
core: true,
// any custom assets (css/js) to include in bundle.
// these must be absolute paths as they will be read in
// from disk, processed, and bundled.
// SASS is processed, CSS is passed through, Javascript is compiled.
custom: {
css: [],
javascript: []
},
// If using custom SASS, you can also provide custom load paths
sassLoadPaths: []
}
// NewRelic configuration - optional
newRelicApm: {
accountId: null,
trustKey: null,
agentId: null,
licenseKey: null,
applicationId: null,
}
}Page-Level Configuration
These configurations are typically set in the page meta
social:
# Custom page title (will default to page title)
title: null
# Custom description (will default to page description)
description: null
# Custom image (will default to global image)
image: nullTemplates/Blocks
The following list includes all of the templates and blocks available:
base- Base templatecss- Any custom cssjavascript- Any custom javascriptnewRelicApm- New Relic APM codehead- Any custom HTML head itemsskipLink- Skip to content linkofficialBanner- Official State of LA info bannercontent- Core page contentbackToTop- Back to top link
home- Empty template, only inherits frombasepage- Public facing pagepageNavbar- Top navigation areapageContentStart- Content at start of page content areapageContent- Main contentpageContentEnd- Content at end of page content areapageFooter- Footer area
sidebar- Template with sidebarsidebar- Side navigationsidebarMainContent- Main content areasidebarTopHeader- HeaderpageWithSidebarContent- Main sidebar contentsidebarFooter- Footer
docs/guide- Main template for a docs/guide pageguideBreadcrumbs- BreadcrumbsguideTitle- TitleguideTableOfContents- Table of contentsguideMainContent- Main content wrapperguideStart- Content at start of guide content areaguideContent- Main contentguidePageNavigation- Page next/previousguideEnd- Content at end of guide area
docs/area- Sub template for an area overview for docsdocs/sitemap- Sitemap template for guidessitemap.xml- Template for XML based sitemaps
Development
Highly recommend using yalc to dev and test.
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago