├── .editorconfig ├── .git-blame-ignore-revs ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── documentation.md │ ├── enhancement.yml │ └── possible-bug.yml ├── dependabot.yml ├── opencollective.yml └── workflows │ ├── ci.yml │ ├── codeql.yml │ ├── release.yml │ └── scorecard.yml ├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierignore ├── .prettierrc.json ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── cmd.cjs ├── docs ├── coverage.md ├── coverage.njk ├── eleventy.coverage.js └── release-instructions.md ├── eslint.config.js ├── package-lock.json ├── package.json ├── src ├── Benchmark │ ├── Benchmark.js │ ├── BenchmarkGroup.js │ └── BenchmarkManager.js ├── Data │ ├── ComputedData.js │ ├── ComputedDataProxy.js │ ├── ComputedDataQueue.js │ ├── ComputedDataTemplateString.js │ ├── TemplateData.js │ └── TemplateDataInitialGlobalData.js ├── Eleventy.js ├── EleventyCommonJs.cjs ├── EleventyExtensionMap.js ├── EleventyFiles.js ├── EleventyServe.js ├── EleventyWatch.js ├── EleventyWatchTargets.js ├── Engines │ ├── Custom.js │ ├── FrontMatter │ │ └── JavaScript.js │ ├── Html.js │ ├── JavaScript.js │ ├── Liquid.js │ ├── Markdown.js │ ├── Nunjucks.js │ ├── TemplateEngine.js │ ├── TemplateEngineManager.js │ └── Util │ │ └── ContextAugmenter.js ├── Errors │ ├── DuplicatePermalinkOutputError.js │ ├── EleventyBaseError.js │ ├── EleventyErrorHandler.js │ ├── EleventyErrorUtil.js │ ├── TemplateContentPrematureUseError.js │ ├── TemplateContentUnrenderedTemplateError.js │ └── UsingCircularTemplateContentReferenceError.js ├── EventBus.js ├── FileSystemSearch.js ├── Filters │ ├── GetCollectionItem.js │ ├── GetCollectionItemIndex.js │ ├── GetLocaleCollectionItem.js │ ├── Slug.js │ ├── Slugify.js │ └── Url.js ├── GlobalDependencyMap.js ├── LayoutCache.js ├── Plugins │ ├── HtmlBasePlugin.js │ ├── HtmlRelativeCopyPlugin.js │ ├── I18nPlugin.js │ ├── IdAttributePlugin.js │ ├── InputPathToUrl.js │ ├── Pagination.js │ └── RenderPlugin.js ├── Template.js ├── TemplateBehavior.js ├── TemplateCollection.js ├── TemplateConfig.js ├── TemplateContent.js ├── TemplateFileSlug.js ├── TemplateGlob.js ├── TemplateLayout.js ├── TemplateLayoutPathResolver.js ├── TemplateMap.js ├── TemplatePassthrough.js ├── TemplatePassthroughManager.js ├── TemplatePermalink.js ├── TemplateRender.js ├── TemplateWriter.js ├── UserConfig.js ├── Util │ ├── ArrayUtil.js │ ├── AsyncEventEmitter.js │ ├── Compatibility.js │ ├── ConsoleLogger.js │ ├── DateGitFirstAdded.js │ ├── DateGitLastUpdated.js │ ├── DirContains.js │ ├── EsmResolver.js │ ├── EventBusUtil.js │ ├── ExistsCache.js │ ├── FilePathUtil.js │ ├── FileSystemManager.js │ ├── GetJavaScriptData.js │ ├── GlobMatcher.js │ ├── HtmlRelativeCopy.js │ ├── HtmlTransformer.js │ ├── ImportJsonSync.js │ ├── IsAsyncFunction.js │ ├── JavaScriptDependencies.js │ ├── MemoizeFunction.js │ ├── Objects │ │ ├── DeepFreeze.js │ │ ├── ObjectFilter.js │ │ ├── ProxyWrap.js │ │ ├── SampleModule.mjs │ │ ├── Sortable.js │ │ └── Unique.js │ ├── PassthroughCopyBehaviorCheck.js │ ├── PathNormalizer.js │ ├── PathPrefixer.js │ ├── Pluralize.js │ ├── ProjectDirectories.js │ ├── ProjectTemplateFormats.js │ ├── PromiseUtil.js │ ├── Require.js │ ├── ReservedData.js │ ├── SetUnion.js │ ├── SpawnAsync.js │ ├── TemplateDepGraph.js │ ├── TransformsUtil.js │ └── ValidUrl.js └── defaultConfig.js ├── test ├── ArrayUtilTest.js ├── BenchmarkTest.js ├── BundlePluginTest.js ├── CompatibilityTest.js ├── ComputedDataProxyTest.js ├── ComputedDataQueueTest.js ├── ComputedDataTemplateStringTest.js ├── ComputedDataTest.js ├── ConsoleLoggerTest.js ├── DependencyGraphTest.js ├── DirContainsTest.js ├── EleventyAddGlobalDataTest.js ├── EleventyErrorHandlerTest.js ├── EleventyErrorUtilTest.js ├── EleventyExtensionMapTest.js ├── EleventyFilesGitIgnoreEleventyIgnoreTest.js ├── EleventyFilesTest.js ├── EleventyImgTransformTest.js ├── EleventyServeTest.js ├── EleventyTest-CustomDateParsing.js ├── EleventyTest-Preprocessors.js ├── EleventyTest-Shortcodes.js ├── EleventyTest.js ├── EleventyVirtualTemplatesTest.js ├── EleventyWatchTargetsTest.js ├── EleventyWatchTest.js ├── ExistsCacheTest.js ├── FileSystemSearchTest.js ├── GetCollectionItemIndexTest.js ├── GetCollectionItemTest.js ├── GlobalDependencyMapTest.js ├── HtmlBasePluginTest.js ├── HtmlRelativeCopyTest.js ├── I18nPluginTest.js ├── IdAttributePluginTest.js ├── ImportJsonSyncTest.js ├── InputPathToUrlPluginTest.js ├── Issue3467Test.js ├── Issue3797Test.js ├── Issue3808Test.js ├── Issue3809Test.js ├── Issue3816Test.js ├── Issue3818Test.js ├── Issue3823Test.js ├── Issue3825Test.js ├── Issue3831Test.js ├── Issue3833Test.js ├── Issue434Test.js ├── Issue775Test.js ├── JavaScriptDependenciesTest.js ├── JavaScriptFrontMatterTest.js ├── LayoutCacheTest.js ├── LodashTest.js ├── PaginationTest.js ├── PassthroughCopyBehaviorTest.js ├── PathNormalizerTest.js ├── PathPrefixer.js ├── PluralizeTest.js ├── ProjectDirectoriesTest.js ├── ProjectTemplateFormatsTest.js ├── ProxyWrapTest.js ├── ReservedDataTest.js ├── SemverCheckTest.js ├── SortableTest.js ├── TemplateCollectionTest.js ├── TemplateConfigTest.js ├── TemplateDataTest.js ├── TemplateDepGraphTest.js ├── TemplateEngineManagerTest.js ├── TemplateEngineTest.js ├── TemplateFileSlugTest.js ├── TemplateGlobTest.js ├── TemplateLayoutPathResolverTest.js ├── TemplateLayoutTest.js ├── TemplateMapTest-ComputedData.js ├── TemplateMapTest.js ├── TemplatePassthroughManagerTest.js ├── TemplatePassthroughTest.js ├── TemplatePermalinkTest.js ├── TemplateRenderCustomTest.js ├── TemplateRenderHTMLTest.js ├── TemplateRenderJavaScriptTest.js ├── TemplateRenderLiquidTest.js ├── TemplateRenderMarkdownPluginTest.js ├── TemplateRenderMarkdownTest.js ├── TemplateRenderNunjucksTest.js ├── TemplateRenderPluginTest.js ├── TemplateRenderTest.js ├── TemplateTest-CompileOptions.js ├── TemplateTest-ComputedData.js ├── TemplateTest-CustomExtensions.js ├── TemplateTest-DataCascade.js ├── TemplateTest-Dates.js ├── TemplateTest-JavaScript.js ├── TemplateTest.js ├── TemplateTest_Permalink.js ├── TemplateWriterTest.js ├── TestUtilityTest.js ├── TransformsUtilTest.js ├── UrlTest.js ├── UserConfigTest.js ├── UserDataExtensionsTest.js ├── Util │ ├── normalizeNewLines.js │ └── removeNewLines.js ├── UtilSetUnionTest.js ├── _getNewTemplateForTests.js ├── _getRenderedTemplates.js ├── _issues │ ├── 975 │ │ ├── 975-test.js │ │ ├── another-post.md │ │ ├── index.md │ │ └── post.md │ ├── 2250 │ │ ├── 2250-test.js │ │ ├── javascript.11ty.cjs │ │ ├── liquid.liquid │ │ └── nunjucks.njk │ ├── 3697 │ │ ├── 3697-test.js │ │ └── _data │ │ │ └── folder │ │ │ ├── 0.json │ │ │ └── 3.json │ └── 3809 │ │ ├── .app │ │ ├── .eleventy.js │ │ └── _data │ │ │ └── app.json │ │ └── index.njk ├── _testHelpers.js ├── cmdTest.js ├── file-system-search │ └── file.txt ├── noop │ └── .gitkeep ├── noop2 │ └── .gitkeep ├── proxy-pagination-globaldata │ ├── _data │ │ └── banner.js │ ├── tmpl.liquid │ ├── tmpl2.njk │ └── tmpl4.11ty.js ├── slugify-filter │ ├── comma.njk │ ├── multibyte.njk │ ├── slug-number.njk │ ├── slug-options.njk │ ├── slugify-number.njk │ ├── slugify-options.njk │ └── test.njk ├── stubs--to │ ├── test.md │ └── test2.liquid ├── stubs-1206 │ ├── page1.njk │ └── page2.njk ├── stubs-1242 │ ├── _data │ │ ├── xyz.dottest.json │ │ └── xyz.dottest │ │ │ └── test.json │ └── empty.md ├── stubs-1325 │ ├── test.11ty.js │ └── test.js ├── stubs-142 │ └── index.njk ├── stubs-1691 │ ├── _data │ │ └── str.txt │ ├── template.11tydata.txt │ └── template.njk ├── stubs-2145 │ ├── _includes │ │ └── layout.njk │ └── test.njk ├── stubs-2167 │ └── paginated.njk ├── stubs-2224 │ └── index.njk ├── stubs-2258-2830-skip-layouts │ ├── _includes │ │ └── layout.njk │ ├── eleventy.config.cjs │ └── style.scss ├── stubs-2258 │ ├── _includes │ │ ├── _code.scss │ │ └── layout.njk │ ├── eleventy.config.cjs │ └── style.scss ├── stubs-2367 │ ├── _includes │ │ └── layout.liquid │ ├── templateWithLiquidShortcodeMultipleArguments-template2.liquid │ └── templateWithLiquidShortcodeMultipleArguments.liquid ├── stubs-2378 │ └── _data │ │ └── images │ │ ├── dog.jpg │ │ └── dogpng.png ├── stubs-2602 │ └── index.njk ├── stubs-2753 │ ├── _data │ │ └── global.js │ ├── page1.njk │ └── page2.njk ├── stubs-2790 │ └── page.11ty.cjs ├── stubs-2851 │ ├── content.njk │ └── paginated.njk ├── stubs-3013 │ ├── html │ │ ├── _data │ │ │ └── books.json │ │ ├── _includes │ │ │ └── base.html │ │ └── book.html │ ├── liquid │ │ ├── _data │ │ │ └── books.json │ │ ├── _includes │ │ │ └── base.liquid │ │ └── book.liquid │ ├── md │ │ ├── _data │ │ │ └── books.json │ │ ├── _includes │ │ │ └── base.md │ │ └── book.md │ └── njk │ │ ├── _data │ │ └── books.json │ │ ├── _includes │ │ └── base.njk │ │ └── book.njk ├── stubs-3285 │ └── src │ │ └── scripts │ │ └── hello-world.js ├── stubs-337 │ ├── data │ │ └── xyz.json │ └── src │ │ └── empty.md ├── stubs-3807 │ ├── Issue3807test.js │ ├── _layouts │ │ ├── base.html │ │ └── home.html │ ├── eleventy.config.js │ └── index.md ├── stubs-3810 │ ├── _includes │ │ └── promo.njk │ ├── eleventy.config.js │ └── index.md ├── stubs-403 │ ├── .eleventyignore │ ├── _includes │ │ └── include.liquid │ └── template.liquid ├── stubs-408-sass │ ├── _code.scss │ └── style.scss ├── stubs-413 │ └── date-frontmatter.md ├── stubs-434 │ └── _includes │ │ ├── macros-filter.njk │ │ └── macros.njk ├── stubs-475 │ ├── _includes │ │ └── layout.njk │ └── transform-layout │ │ └── transform-layout.njk ├── stubs-630 │ ├── _data │ │ ├── globalData0.cjs │ │ ├── globalData1.cjs │ │ ├── globalData2.json │ │ ├── globalData3.yaml │ │ ├── globalData4.nosj │ │ ├── mergingGlobalData.cjs │ │ ├── mergingGlobalData.js │ │ ├── mergingGlobalData.json │ │ ├── mergingGlobalData.nosj │ │ ├── mergingGlobalData.yaml │ │ └── subdir │ │ │ └── globalDataSubdir.yaml │ └── component-yaml │ │ ├── component.11tydata.cjs │ │ ├── component.11tydata.json │ │ ├── component.11tydata.nosj │ │ ├── component.11tydata.yaml │ │ ├── component.json │ │ ├── component.njk │ │ └── component.yaml ├── stubs-670 │ ├── content.njk │ └── index.njk ├── stubs-919 │ ├── test.11tydata.cjs │ ├── test.njk │ └── test2.njk ├── stubs-absolute │ └── test.md ├── stubs-addglobaldata-noop │ └── test.txt ├── stubs-addglobaldata │ └── test.liquid ├── stubs-autocopy │ ├── .gitkeep │ ├── possum.jpg │ └── possum.png ├── stubs-base-case-sens │ └── index.njk ├── stubs-base │ └── index.njk ├── stubs-circular-layout │ └── _includes │ │ ├── layout-cycle-a.njk │ │ ├── layout-cycle-b.njk │ │ ├── layout-cycle-c.njk │ │ └── layout-cycle-self.njk ├── stubs-computed-array │ └── test.liquid ├── stubs-computed-collections-filter │ ├── collections.njk │ └── dog.njk ├── stubs-computed-collections │ ├── collections.njk │ └── dog.njk ├── stubs-computed-dirdata │ └── dir │ │ ├── dir.11tydata.cjs │ │ ├── first.11ty.cjs │ │ └── second.11ty.cjs ├── stubs-computed-global │ ├── _data │ │ └── eleventyComputed.cjs │ └── intermix.njk ├── stubs-computed-pagination │ ├── child.11ty.cjs │ └── paginated.njk ├── stubs-computed-symbolparse │ ├── test.liquid │ └── test.njk ├── stubs-custom-extension │ └── test.js1 ├── stubs-data-cascade │ ├── global-versus-layout │ │ ├── _data │ │ │ └── cascade.cjs │ │ ├── _includes │ │ │ └── base.njk │ │ └── test.njk │ ├── layout-data-files │ │ ├── _includes │ │ │ └── base.njk │ │ ├── test.11tydata.cjs │ │ └── test.njk │ ├── layout-versus-dirdatafile │ │ └── src │ │ │ ├── _includes │ │ │ └── base.njk │ │ │ ├── src.11tydata.cjs │ │ │ └── test.njk │ └── layout-versus-tmpldatafile │ │ ├── _includes │ │ └── base.njk │ │ ├── test.11tydata.cjs │ │ └── test.njk ├── stubs-data-esm │ └── _data │ │ ├── commonjs.cjs │ │ └── module.mjs ├── stubs-dependency-tree │ ├── child.cjs │ ├── grandchild.cjs │ └── index.cjs ├── stubs-empty-json-data │ └── _data │ │ └── empty.json ├── stubs-empty │ └── .gitkeep ├── stubs-fancyjs │ ├── test.11ty.tsx │ └── test.mdx ├── stubs-global-data-config-api-nested │ └── _data │ │ └── deep.cjs ├── stubs-global-data-config-api │ └── empty.txt ├── stubs-i18n │ ├── en-us │ │ └── index.11ty.cjs │ ├── en │ │ └── index.liquid │ ├── es │ │ └── index.njk │ └── non-lang-file.njk ├── stubs-img-transform │ ├── ignored.md │ ├── missing-alt.md │ ├── multiple.md │ ├── possum.png │ └── single.md ├── stubs-incremental │ └── layout-chain │ │ ├── _includes │ │ ├── base.njk │ │ └── parent.njk │ │ └── test.njk ├── stubs-layout-cache │ ├── _includes │ │ ├── layout.liquid │ │ └── layout.njk │ ├── test.liquid │ └── test.njk ├── stubs-layouts-event │ ├── _includes │ │ ├── first.liquid │ │ ├── second.liquid │ │ └── third.liquid │ └── page.md ├── stubs-njk-async │ └── _includes │ │ └── loop.njk ├── stubs-pagination-computed-quotes-njk │ ├── post.njk │ └── test.njk ├── stubs-pagination-computed-quotes │ ├── post.liquid │ └── test.liquid ├── stubs-pathtourl │ ├── css.njk │ ├── filter.njk │ ├── tmpl.njk │ └── transform.njk ├── stubs-render-plugin-vue-nested │ ├── _includes │ │ └── include.vue │ └── test.vue ├── stubs-render-plugin-vue │ ├── _includes │ │ └── include.vue │ └── vue-sfc.liquid ├── stubs-render-plugin │ ├── 11tyjs-file-override.njk │ ├── 11tyjs-file.njk │ ├── 11tyjs.liquid │ ├── _includes │ │ ├── frontmatter.liquid │ │ ├── include-js.txt │ │ ├── include.11ty.cjs │ │ ├── include.liquid │ │ └── include.njk │ ├── bad-data.njk │ ├── capture-liquid.njk │ ├── capture-njk.liquid │ ├── data-no-templatelang.liquid │ ├── false.liquid │ ├── liquid-direct.njk │ ├── liquid-eleventy.njk │ ├── liquid-global.njk │ ├── liquid-md.11ty.cjs │ ├── liquid-md.liquid │ ├── liquid-page.liquid │ ├── liquid-page.njk │ ├── liquid.njk │ ├── md.liquid │ ├── njk-eleventy.liquid │ ├── njk-file-not-exist.liquid │ ├── njk-file.liquid │ ├── njk-file.njk │ ├── njk-page.liquid │ ├── nunjucks-frontmatter.njk │ ├── nunjucks-global.liquid │ ├── nunjucks.11ty.cjs │ ├── nunjucks.liquid │ ├── using-frontmatter.liquid │ └── vue.liquid ├── stubs-virtual-nowrite │ └── .gitkeep ├── stubs-virtual │ └── .gitkeep ├── stubs │ ├── .eleventyignore │ ├── 2016-02-01-permalinkdate.liquid │ ├── _data │ │ ├── globalData.json │ │ ├── globalData2.cjs │ │ ├── globalDataFn.js │ │ ├── globalDataFnCJS.cjs │ │ ├── subdir │ │ │ └── testDataSubdir.json │ │ ├── testData.json │ │ └── testDataLiquid.json │ ├── _includes │ │ ├── base.njk │ │ ├── custom-filter.liquid │ │ ├── default.liquid │ │ ├── defaultLayout.liquid │ │ ├── defaultLayoutLayoutContent.liquid │ │ ├── imports.njk │ │ ├── included-data.html │ │ ├── included-relative.njk │ │ ├── included.html │ │ ├── included.liquid │ │ ├── included.njk │ │ ├── included.nunj │ │ ├── layout-a.liquid │ │ ├── layout-b.liquid │ │ ├── layoutLiquid.liquid │ │ ├── layouts │ │ │ ├── div-wrapper-layout.njk │ │ │ ├── engineOverrides.njk │ │ │ ├── engineOverridesMd.njk │ │ │ ├── inasubdir.njk │ │ │ ├── issue-115.liquid │ │ │ ├── layout-contentdump.njk │ │ │ ├── layout-inherit-a.njk │ │ │ ├── layout-inherit-b.njk │ │ │ ├── layout-inherit-c.njk │ │ │ ├── post.liquid │ │ │ └── templateMapCollection.njk │ │ ├── multiple.liquid │ │ ├── multiple.md │ │ ├── mylocallayout.njk │ │ ├── permalink-data-layout.njk │ │ ├── permalink-in-layout │ │ │ ├── layout-fileslug.liquid │ │ │ └── layout.liquid │ │ ├── scopeleak.liquid │ │ ├── subfolder │ │ │ ├── included.html │ │ │ ├── included.liquid │ │ │ └── included.nunj │ │ └── test.js │ ├── _layouts │ │ └── layoutsdefault.liquid │ ├── add-extension │ │ ├── test.njk │ │ └── test.txt │ ├── broken-config.cjs │ ├── buffer.11ty.cjs │ ├── cfg-directories-export-cjs │ │ ├── eleventy.config.cjs │ │ └── src │ │ │ └── .gitkeep │ ├── cfg-directories-export │ │ ├── eleventy.config.js │ │ └── src │ │ │ └── .gitkeep │ ├── class-async-data-fn.11ty.cjs │ ├── class-async-filter.11ty.cjs │ ├── class-async.11ty.cjs │ ├── class-buffer.11ty.cjs │ ├── class-data-filter.11ty.cjs │ ├── class-data-fn-filter.11ty.cjs │ ├── class-data-fn-shorthand.11ty.cjs │ ├── class-data-fn.11ty.cjs │ ├── class-data-permalink-async-fn.11ty.cjs │ ├── class-data-permalink-buffer.11ty.cjs │ ├── class-data-permalink-fn-buffer.11ty.cjs │ ├── class-data-permalink-fn-filter.11ty.cjs │ ├── class-data-permalink-fn.11ty.cjs │ ├── class-data-permalink.11ty.cjs │ ├── class-data.11ty.cjs │ ├── class-filter.11ty.cjs │ ├── class-fns-has-page.11ty.cjs │ ├── class-fns.11ty.cjs │ ├── class-norender.11ty.cjs │ ├── class-with-dep-upstream.js │ ├── class-with-dep.11ty.cjs │ ├── class.11ty.cjs │ ├── classfields-data.11ty.cjs │ ├── cmd-help-processing │ │ └── _data │ │ │ └── test.js │ ├── collection-layout-wrap.njk │ ├── collection-layout │ │ ├── _includes │ │ │ └── layout.liquid │ │ ├── dog1.liquid │ │ └── template.liquid │ ├── collection-slug │ │ ├── dog1.njk │ │ └── template.njk │ ├── collection-template │ │ ├── _includes │ │ │ └── layout.liquid │ │ ├── dog1.liquid │ │ └── template.liquid │ ├── collection │ │ ├── test1.md │ │ ├── test10.md │ │ ├── test2.md │ │ ├── test3.md │ │ ├── test4.md │ │ ├── test5.md │ │ ├── test6.html │ │ ├── test7.njk │ │ ├── test8.md │ │ └── test9.md │ ├── collection2 │ │ ├── test1.md │ │ └── test2.md │ ├── component-async │ │ ├── component.11tydata.cjs │ │ ├── component.11tydata.js │ │ └── component.njk │ ├── component │ │ ├── component.11tydata.cjs │ │ ├── component.11tydata.js │ │ ├── component.11tydata.json │ │ ├── component.json │ │ └── component.njk │ ├── config-deps-upstream.cjs │ ├── config-deps.cjs │ ├── config-empty-pathprefix.cjs │ ├── config-promise.js │ ├── config.cjs │ ├── custom-extension-no-permalink.txt │ ├── custom-extension.txt │ ├── custom-frontmatter │ │ ├── template-excerpt-comment.njk │ │ ├── template-newline1.njk │ │ ├── template-newline2.njk │ │ ├── template-newline3.njk │ │ ├── template-nonewline.njk │ │ ├── template-toml.njk │ │ └── template.njk │ ├── data-cascade │ │ ├── template.11tydata.cjs │ │ └── template.njk │ ├── datafiledoesnotexist │ │ └── template.njk │ ├── dates │ │ ├── 2018-01-01-file5.md │ │ ├── 2019-01-01-folder │ │ │ └── 2020-01-01-file.md │ │ ├── file1.md │ │ ├── file2.md │ │ ├── file2b.md │ │ ├── file3.md │ │ └── file4.md │ ├── default-class-export-and-others.11ty.js │ ├── default-export-and-others.11ty.js │ ├── default-frontmatter.txt │ ├── default-function-export-and-named-data.11ty.cjs │ ├── default-function-export-and-named-data.11ty.js │ ├── default-no-liquid.md │ ├── default.liquid │ ├── default.md │ ├── dependencies │ │ ├── dep1.cjs │ │ ├── dep2.cjs │ │ └── two-deps.11ty.cjs │ ├── deps │ │ ├── dep1.cjs │ │ └── dep2.cjs │ ├── dynamic-permalink │ │ └── test.njk │ ├── eleventyComputed │ │ ├── first.njk │ │ ├── override-reuse.njk │ │ ├── override.njk │ │ ├── permalink-simple.njk │ │ ├── permalink-slug.njk │ │ ├── permalink.njk │ │ ├── second.njk │ │ ├── third.njk │ │ ├── true.njk │ │ └── use-global-data.njk │ ├── eleventyExcludeFromCollections.njk │ ├── eleventyExcludeFromCollectionsPermalinkFalse.njk │ ├── engine-singletons │ │ ├── first.njk │ │ └── second.njk │ ├── exitCode │ │ └── failure.njk │ ├── exitCode_globalData │ │ ├── _data │ │ │ └── test.js │ │ └── test.liquid │ ├── exitCode_success │ │ └── success.njk │ ├── exports-flatdata.11ty.cjs │ ├── fileslug.11ty.cjs │ ├── firstdir │ │ └── seconddir │ │ │ └── component.njk │ ├── formatTest.liquid │ ├── frontmatter-date │ │ ├── test.liquid │ │ └── test.njk │ ├── function-arrow.11ty.cjs │ ├── function-async-filter.11ty.cjs │ ├── function-async.11ty.cjs │ ├── function-buffer.11ty.cjs │ ├── function-filter.11ty.cjs │ ├── function-fns.11ty.cjs │ ├── function-markdown.11ty.cjs │ ├── function-prototype.11ty.cjs │ ├── function-throws-async.11ty.cjs │ ├── function-throws.11ty.cjs │ ├── function.11ty.cjs │ ├── glob-pages │ │ ├── about.md │ │ ├── contact.md │ │ └── home.md │ ├── global-dash-variable.liquid │ ├── globby │ │ ├── _includes │ │ │ └── include.html │ │ └── test.html │ ├── ignore-dedupe │ │ └── .gitignore │ ├── ignore1 │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignore2 │ │ ├── .gitignore │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignore3 │ │ ├── .eleventyignore │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignore4 │ │ ├── .eleventyignore │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignore5 │ │ ├── .gitignore │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignore6 │ │ ├── .eleventyignore │ │ ├── .gitignore │ │ └── ignoredFolder │ │ │ └── ignored.md │ ├── ignoredFolder │ │ └── ignored.md │ ├── ignorelocalroot │ │ └── .eleventyignore │ ├── ignorelocalrootgitignore │ │ ├── .eleventyignore │ │ └── .gitignore │ ├── img │ │ └── stub.md │ ├── included.liquid │ ├── includer.liquid │ ├── includesemptystring.liquid │ ├── index.html │ ├── index.liquid │ ├── issue-115 │ │ ├── index-with-layout.liquid │ │ ├── index.liquid │ │ ├── template-bars.liquid │ │ └── template-foos.liquid │ ├── issue-135 │ │ ├── template.json │ │ └── template.njk │ ├── issue-522 │ │ ├── excluded.md │ │ └── template.md │ ├── issue-95 │ │ ├── cat.md │ │ └── notacat.md │ ├── layout-permalink-difflang │ │ ├── _includes │ │ │ └── test.njk │ │ └── test.md │ ├── layoutsemptystring.liquid │ ├── local-data-tags │ │ ├── component.11tydata.cjs │ │ └── component.njk │ ├── multiple-ignores │ │ ├── .eleventyignore │ │ ├── ignoredFolder │ │ │ └── ignored.md │ │ └── subfolder │ │ │ ├── .eleventyignore │ │ │ └── ignoredFolder2 │ │ │ └── ignored2.md │ ├── multipleexports-promises.11ty.cjs │ ├── multipleexports.11ty.cjs │ ├── njk-relative │ │ └── dir │ │ │ ├── base.njk │ │ │ ├── imports.njk │ │ │ ├── included.njk │ │ │ └── unique-include-123.njk │ ├── object-norender.11ty.cjs │ ├── object.11ty.cjs │ ├── oneinstance.11ty.cjs │ ├── overrides │ │ ├── layout.njk │ │ ├── layoutfalse.njk │ │ ├── page-templatesyntax.md │ │ ├── test-bypass.md │ │ ├── test-empty.html │ │ ├── test-empty.md │ │ ├── test-error.njk │ │ ├── test-md.liquid │ │ ├── test-multiple.md │ │ ├── test-multiple2.njk │ │ ├── test-njk.liquid │ │ ├── test.html │ │ ├── test.liquid │ │ └── test.md │ ├── page-target-collections │ │ ├── paginateall.njk │ │ ├── tagpages.njk │ │ └── tagpagesall.njk │ ├── paged-global-data-mutable │ │ ├── _data │ │ │ └── testdata.cjs │ │ └── paged-differing-data-set.njk │ ├── paged │ │ ├── cfg-collection-tag-cfg-collection │ │ │ ├── consumer.njk │ │ │ ├── paged-downstream.njk │ │ │ ├── paged-main.njk │ │ │ ├── test1.njk │ │ │ ├── test2.njk │ │ │ └── test3.njk │ │ ├── collection-apply-to-all │ │ │ ├── consumer.njk │ │ │ ├── main.njk │ │ │ ├── test1.njk │ │ │ ├── test2.njk │ │ │ └── test3.njk │ │ ├── collection │ │ │ ├── consumer.njk │ │ │ ├── main.njk │ │ │ ├── test1.njk │ │ │ ├── test2.njk │ │ │ └── test3.njk │ │ ├── notpaged.njk │ │ ├── paged-before-and-reverse.njk │ │ ├── paged-before-filter.njk │ │ ├── paged-before-metadata.njk │ │ ├── paged-before.njk │ │ ├── paged-empty-pageonemptydata.njk │ │ ├── paged-empty.njk │ │ ├── paged.json │ │ ├── paged.njk │ │ ├── pagedalias.njk │ │ ├── pagedaliassize2.njk │ │ ├── pagedinlinedata-reverse.njk │ │ ├── pagedinlinedata.njk │ │ ├── pagedobject.njk │ │ ├── pagedobjectfilterarray.njk │ │ ├── pagedobjectfilterstring.njk │ │ ├── pagedobjectvalues.njk │ │ ├── pagedpermalink.njk │ │ ├── pagedpermalinkif.liquid │ │ ├── pagedpermalinkif.njk │ │ ├── pagedpermalinknumeric.njk │ │ ├── pagedpermalinknumericoneindexed.njk │ │ └── pagedresolve.njk │ ├── pagedate.liquid │ ├── pagedate.njk │ ├── pagedateutc.njk │ ├── pagination-eleventycomputed-permalink.liquid │ ├── pagination-eleventycomputed-title.liquid │ ├── pagination-templatecontent │ │ ├── index.njk │ │ ├── post-1.md │ │ └── post-2.md │ ├── permalink-build │ │ └── permalink-build.md │ ├── permalink-conflicts-false │ │ ├── test1.md │ │ └── test2.md │ ├── permalink-conflicts │ │ ├── test1.md │ │ ├── test2.md │ │ └── test3.md │ ├── permalink-data-layout │ │ ├── test.json │ │ └── test.njk │ ├── permalink-empty-object │ │ └── empty-object.md │ ├── permalink-false-computed │ │ └── test.md │ ├── permalink-false │ │ └── test.md │ ├── permalink-in-layout-fileslug.liquid │ ├── permalink-in-layout.liquid │ ├── permalink-markdown-override.md │ ├── permalink-markdown-var.md │ ├── permalink-markdown.md │ ├── permalink-nobuild │ │ └── permalink-nobuild.md │ ├── permalink-true │ │ └── permalink-true.md │ ├── permalinkdata-jsfn.njk │ ├── permalinkdata-jspermalinkfn.njk │ ├── permalinkdata.njk │ ├── permalinkdate.liquid │ ├── permalinked.liquid │ ├── posts │ │ ├── post1.njk │ │ ├── posts.json │ │ └── posts.njk │ ├── prematureTemplateContent │ │ ├── test.11ty.cjs │ │ ├── test.liquid │ │ ├── test.md │ │ └── test.njk │ ├── promise.11ty.cjs │ ├── public │ │ └── test.css │ ├── relative-liquid │ │ └── dir │ │ │ └── included.liquid │ ├── reuse-permalink │ │ ├── reuse-permalink.json │ │ └── test1.liquid │ ├── script-frontmatter │ │ ├── test-default.njk │ │ ├── test-js.njk │ │ └── test.njk │ ├── string.11ty.cjs │ ├── string.11ty.custom │ ├── string.11ty.possum │ ├── stubs-computed-permalink │ │ ├── eleventycomputed-nested-object.11ty.cjs │ │ ├── eleventycomputed-object-replace.11ty.cjs │ │ └── eleventycomputed-object.11ty.cjs │ ├── stubs-virtual-conflict │ │ └── virtual.md │ ├── subdir │ │ ├── img │ │ │ └── .gitkeep │ │ └── index.html │ ├── subfolder │ │ ├── index.html │ │ ├── subfolder.liquid │ │ └── subfolder │ │ │ └── subfolder.liquid │ ├── tagged-pagination-multiples-layout │ │ └── test.njk │ ├── tagged-pagination-multiples │ │ └── test.njk │ ├── template-passthrough-duplicates │ │ └── input │ │ │ ├── avatar.png │ │ │ └── src │ │ │ └── views │ │ │ └── avatar.png │ ├── template-passthrough │ │ ├── .htaccess │ │ ├── img.jpg │ │ ├── src │ │ │ └── views │ │ │ │ └── avatar.png │ │ └── static │ │ │ ├── nested │ │ │ └── test-nested.css │ │ │ ├── test.css │ │ │ └── test.js │ ├── template-passthrough2 │ │ ├── .htaccess │ │ ├── img.jpg │ │ ├── src │ │ │ └── views │ │ │ │ └── avatar.png │ │ └── static │ │ │ ├── nested │ │ │ └── test-nested.css │ │ │ ├── test.css │ │ │ └── test.js │ ├── template.liquid │ ├── templateFrontMatter.liquid │ ├── templateFrontMatterJs.njk │ ├── templateFrontMatterJson.liquid │ ├── templateLayoutCacheDuplicates-b │ │ └── _includes │ │ │ └── layout.njk │ ├── templateLayoutCacheDuplicates │ │ └── _includes │ │ │ └── layout.njk │ ├── templateMapCollection │ │ ├── paged-cfg-permalink.md │ │ ├── paged-cfg-tagged-apply-to-all.md │ │ ├── paged-cfg-tagged-permalink-apply-to-all.md │ │ ├── paged-cfg-tagged-permalink.md │ │ ├── paged-cfg-tagged.md │ │ ├── paged-cfg.md │ │ ├── paged-tag-dogs-templateContent-alias.md │ │ ├── paged-tag-dogs-templateContent.md │ │ ├── paged-tag.md │ │ ├── templateContent.md │ │ ├── test1.md │ │ ├── test2.md │ │ ├── test3.md │ │ ├── test4.md │ │ ├── test5.md │ │ └── testWithLayout.md │ ├── templateTwoLayouts.liquid │ ├── templateWithLayout.liquid │ ├── templateWithLayoutContent.liquid │ ├── templateWithLayoutKey.liquid │ ├── templatetest-frontmatter │ │ ├── multiple.njk │ │ └── single.njk │ ├── test-override-js-markdown.11ty.cjs │ ├── testing.html │ ├── transform-pages │ │ └── template.njk │ ├── use-collection.11ty.cjs │ ├── vue-layout.11ty.cjs │ ├── vue.11ty.cjs │ ├── writeTest │ │ └── test.md │ ├── writeTestJS-casesensitive │ │ ├── sample.Js │ │ └── test.11Ty.js │ ├── writeTestJS-passthrough │ │ ├── sample.js │ │ └── test.11ty.js │ ├── writeTestJS │ │ ├── sample.cjs │ │ └── test.11ty.cjs │ └── writeTestMarkdown │ │ ├── sample.md │ │ └── sample2.markdown └── views │ └── .gitkeep ├── test_node ├── JsxTest.js ├── MdxTest.js ├── README.md └── tests.js └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | charset = utf-8 9 | 10 | [*.yml] 11 | indent_style = space 12 | 13 | [/test/**/*] 14 | indent_style = space 15 | 16 | [/test/stubs*/**] 17 | insert_final_newline = false 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Switch the entire codebase to tabs, for accessibility #3098 2 | 358ec48f779fa34e14abef057cc1fa0c1a10aa45 -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners 2 | * @zachleat 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: I have a question about Eleventy 3 | url: https://github.com/11ty/eleventy/discussions/ 4 | about: General education topics should be filed on our Discussions board e.g. “How do I do this in Eleventy?” or “Can Eleventy do this?” 5 | - name: Discord Community 6 | url: https://discord.gg/GBkBy9u 7 | about: Ask the community on Discord 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation! 3 | about: A thing that Eleventy does needs to be documented better or is currently documented incorrectly! 4 | title: "" 5 | labels: documentation 6 | assignees: "" 7 | --- 8 | -------------------------------------------------------------------------------- /.github/opencollective.yml: -------------------------------------------------------------------------------- 1 | collective: 11ty 2 | tiers: 3 | - tiers: '*' 4 | labels: ["oc-supporter"] 5 | message: "Hey , thanks for supporting us on Open Collective!" 6 | invitation: | 7 | Hey :wave:, 8 | 9 | Thank you for opening an issue. We will get back to you as soon as we can. 10 | 11 | Also, check out our [Open Collective](https://opencollective.com/11ty) and consider backing us—every little bit helps! 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated files 2 | package/generated* 3 | 4 | # Ignore installed npm modules 5 | node_modules/ 6 | 7 | # Ignore build tool output, e.g. code coverage 8 | .nyc_output/ 9 | coverage/ 10 | docs/_data/coverage.json 11 | 12 | # Ignore API documentation 13 | api-docs/ 14 | 15 | # Ignore folders from source code editors 16 | .vscode 17 | .idea 18 | 19 | # Ignore eleventy output when doing manual tests 20 | _site/ 21 | 22 | # Ignore test files 23 | .cache 24 | test/stubs-layout-cache/_includes/*.js 25 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | docs 2 | docs-src 3 | test 4 | test_node 5 | coverage 6 | eslint.config.js 7 | .* 8 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 18 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "singleQuote": false, 4 | "semi": true, 5 | "endOfLine": "lf", 6 | "arrowParens": "always", 7 | "printWidth": 100 8 | } 9 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Privately report a security issue by navigating to https://github.com/11ty/eleventy/security and using the “Report a vulnerability” button. 6 | 7 | Read more at: https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability 8 | 9 | Alternatively, you may report security issues via an email to `security@11ty.dev`. 10 | -------------------------------------------------------------------------------- /docs/coverage.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: coverage.md 3 | --- 4 | # Code Coverage for Eleventy v{{ pkg.version }} 5 | 6 | | Filename | % Lines | % Statements | % Functions | % Branches | 7 | | --- | --- | --- | --- | --- | 8 | {% for file, line in coverage -%} 9 | | `{{ file | removeDir }}` | {{ line.lines.pct }}% | {{ line.statements.pct }}% | {{ line.functions.pct }}% | {{ line.branches.pct }}% | 10 | {% endfor -%} 11 | -------------------------------------------------------------------------------- /docs/eleventy.coverage.js: -------------------------------------------------------------------------------- 1 | import { dirname } from "path"; 2 | import { fileURLToPath } from "url"; 3 | import { TemplatePath } from "@11ty/eleventy-utils"; 4 | 5 | const __dirname = dirname(fileURLToPath(import.meta.url)); 6 | 7 | export default function (eleventyConfig) { 8 | eleventyConfig.addFilter("removeDir", function (str) { 9 | return TemplatePath.stripLeadingSubPath(str, TemplatePath.join(__dirname, "..")); 10 | }); 11 | 12 | return { 13 | templateFormats: ["njk"], 14 | dir: { 15 | input: "docs/coverage.njk", 16 | output: "docs/", // root relative 17 | }, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/Errors/DuplicatePermalinkOutputError.js: -------------------------------------------------------------------------------- 1 | import EleventyBaseError from "./EleventyBaseError.js"; 2 | 3 | class DuplicatePermalinkOutputError extends EleventyBaseError { 4 | get removeDuplicateErrorStringFromOutput() { 5 | return true; 6 | } 7 | } 8 | 9 | export default DuplicatePermalinkOutputError; 10 | -------------------------------------------------------------------------------- /src/Errors/EleventyBaseError.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class serves as basis for all Eleventy-specific errors. 3 | * @ignore 4 | */ 5 | class EleventyBaseError extends Error { 6 | /** 7 | * @param {string} message - The error message to display. 8 | * @param {unknown} [originalError] - The original error caught. 9 | */ 10 | constructor(message, originalError) { 11 | super(message); 12 | 13 | this.name = this.constructor.name; 14 | 15 | if (Error.captureStackTrace) { 16 | Error.captureStackTrace(this, this.constructor); 17 | } 18 | 19 | if (originalError) { 20 | this.originalError = originalError; 21 | } 22 | } 23 | } 24 | export default EleventyBaseError; 25 | -------------------------------------------------------------------------------- /src/Errors/TemplateContentPrematureUseError.js: -------------------------------------------------------------------------------- 1 | import EleventyBaseError from "./EleventyBaseError.js"; 2 | 3 | class TemplateContentPrematureUseError extends EleventyBaseError {} 4 | 5 | export default TemplateContentPrematureUseError; 6 | -------------------------------------------------------------------------------- /src/Errors/TemplateContentUnrenderedTemplateError.js: -------------------------------------------------------------------------------- 1 | import EleventyBaseError from "./EleventyBaseError.js"; 2 | 3 | class TemplateContentUnrenderedTemplateError extends EleventyBaseError {} 4 | 5 | export default TemplateContentUnrenderedTemplateError; 6 | -------------------------------------------------------------------------------- /src/Errors/UsingCircularTemplateContentReferenceError.js: -------------------------------------------------------------------------------- 1 | import EleventyBaseError from "./EleventyBaseError.js"; 2 | 3 | class UsingCircularTemplateContentReferenceError extends EleventyBaseError {} 4 | 5 | export default UsingCircularTemplateContentReferenceError; 6 | -------------------------------------------------------------------------------- /src/EventBus.js: -------------------------------------------------------------------------------- 1 | import debugUtil from "debug"; 2 | 3 | import EventEmitter from "./Util/AsyncEventEmitter.js"; 4 | 5 | const debug = debugUtil("Eleventy:EventBus"); 6 | 7 | /** 8 | * @module 11ty/eleventy/EventBus 9 | * @ignore 10 | */ 11 | 12 | debug("Setting up global EventBus."); 13 | /** 14 | * Provides a global event bus that modules deep down in the stack can 15 | * subscribe to from a global singleton for decoupled pub/sub. 16 | * @type {module:11ty/eleventy/Util/AsyncEventEmitter~AsyncEventEmitter} 17 | */ 18 | let bus = new EventEmitter(); 19 | bus.setMaxListeners(100); // defaults to 10 20 | 21 | debug("EventBus max listener count: %o", bus.getMaxListeners()); 22 | 23 | export default bus; 24 | -------------------------------------------------------------------------------- /src/Filters/GetCollectionItem.js: -------------------------------------------------------------------------------- 1 | export default function getCollectionItem(collection, page, modifier = 0) { 2 | let j = 0; 3 | let index; 4 | for (let item of collection) { 5 | if ( 6 | item.inputPath === page.inputPath && 7 | (item.outputPath === page.outputPath || item.url === page.url) 8 | ) { 9 | index = j; 10 | break; 11 | } 12 | j++; 13 | } 14 | 15 | if (index !== undefined && collection?.length) { 16 | if (index + modifier >= 0 && index + modifier < collection.length) { 17 | return collection[index + modifier]; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Filters/GetCollectionItemIndex.js: -------------------------------------------------------------------------------- 1 | // TODO locale-friendly, see GetLocaleCollectionItem.js) 2 | export default function getCollectionItemIndex(collection, page) { 3 | if (!page) { 4 | page = this.page; 5 | } 6 | 7 | let j = 0; 8 | for (let item of collection) { 9 | if ( 10 | item.inputPath === page.inputPath && 11 | (item.outputPath === page.outputPath || item.url === page.url) 12 | ) { 13 | return j; 14 | } 15 | j++; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Filters/Slug.js: -------------------------------------------------------------------------------- 1 | import slugify from "slugify"; 2 | 3 | export default function (str, options = {}) { 4 | return slugify( 5 | "" + str, 6 | Object.assign( 7 | { 8 | replacement: "-", 9 | lower: true, 10 | }, 11 | options, 12 | ), 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /src/Filters/Slugify.js: -------------------------------------------------------------------------------- 1 | import slugify from "@sindresorhus/slugify"; 2 | 3 | export default function (str, options = {}) { 4 | return slugify( 5 | "" + str, 6 | Object.assign( 7 | { 8 | // lowercase: true, // default 9 | decamelize: false, 10 | }, 11 | options, 12 | ), 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /src/Util/ArrayUtil.js: -------------------------------------------------------------------------------- 1 | export function arrayDelete(arr, match) { 2 | if (!Array.isArray(arr)) { 3 | return []; 4 | } 5 | 6 | if (!match) { 7 | return arr; 8 | } 9 | 10 | // only mutates if found 11 | if (typeof match === "function") { 12 | if (arr.find(match)) { 13 | return arr.filter((entry) => { 14 | return !match(entry); 15 | }); 16 | } 17 | } else if (arr.includes(match)) { 18 | return arr.filter((entry) => { 19 | return entry !== match; 20 | }); 21 | } 22 | 23 | return arr; 24 | } 25 | -------------------------------------------------------------------------------- /src/Util/DateGitFirstAdded.js: -------------------------------------------------------------------------------- 1 | import { spawnAsync } from "./SpawnAsync.js"; 2 | 3 | async function getGitFirstAddedTimeStamp(filePath) { 4 | try { 5 | let timestamp = await spawnAsync( 6 | "git", 7 | // Formats https://www.git-scm.com/docs/git-log#_pretty_formats 8 | // %at author date, UNIX timestamp 9 | ["log", "--diff-filter=A", "--follow", "-1", "--format=%at", filePath], 10 | ); 11 | return parseInt(timestamp, 10) * 1000; 12 | } catch (e) { 13 | // do nothing 14 | } 15 | } 16 | 17 | // return a Date 18 | export default async function (inputPath) { 19 | let timestamp = await getGitFirstAddedTimeStamp(inputPath); 20 | if (timestamp) { 21 | return new Date(timestamp); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Util/DateGitLastUpdated.js: -------------------------------------------------------------------------------- 1 | import { spawnAsync } from "./SpawnAsync.js"; 2 | 3 | async function getGitLastUpdatedTimeStamp(filePath) { 4 | try { 5 | let timestamp = await spawnAsync( 6 | "git", 7 | // Formats https://www.git-scm.com/docs/git-log#_pretty_formats 8 | // %at author date, UNIX timestamp 9 | ["log", "-1", "--format=%at", filePath], 10 | ); 11 | return parseInt(timestamp, 10) * 1000; 12 | } catch (e) { 13 | // do nothing 14 | } 15 | } 16 | 17 | // return a Date 18 | export default async function (inputPath) { 19 | let timestamp = await getGitLastUpdatedTimeStamp(inputPath); 20 | if (timestamp) { 21 | return new Date(timestamp); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Util/DirContains.js: -------------------------------------------------------------------------------- 1 | import path from "node:path"; 2 | 3 | // Returns true if subfolder is in parent (accepts absolute or relative paths for both) 4 | export default function (parent, subfolder) { 5 | if (path.resolve(subfolder).startsWith(path.resolve(parent))) { 6 | return true; 7 | } 8 | return false; 9 | } 10 | -------------------------------------------------------------------------------- /src/Util/EventBusUtil.js: -------------------------------------------------------------------------------- 1 | import eventBus from "../EventBus.js"; 2 | import debugUtil from "debug"; 3 | 4 | const debug = debugUtil("Eleventy:EventBus"); 5 | 6 | class EventBusUtil { 7 | static debugCurrentListenerCounts() { 8 | for (let name of eventBus.eventNames()) { 9 | debug("Listeners for %o: %o", name, eventBus.listenerCount(name)); 10 | } 11 | } 12 | } 13 | 14 | export default EventBusUtil; 15 | -------------------------------------------------------------------------------- /src/Util/FilePathUtil.js: -------------------------------------------------------------------------------- 1 | class FilePathUtil { 2 | static isMatchingExtension(filepath, fileExtension) { 3 | if (!fileExtension) { 4 | return false; 5 | } 6 | 7 | if (!(fileExtension || "").startsWith(".")) { 8 | fileExtension = "." + fileExtension; 9 | } 10 | 11 | return filepath.endsWith(fileExtension); 12 | } 13 | 14 | static getFileExtension(filepath) { 15 | return (filepath || "").split(".").pop(); 16 | } 17 | } 18 | 19 | export { FilePathUtil }; 20 | -------------------------------------------------------------------------------- /src/Util/GlobMatcher.js: -------------------------------------------------------------------------------- 1 | import picomatch from "picomatch"; 2 | import { TemplatePath } from "@11ty/eleventy-utils"; 3 | 4 | function isGlobMatch(filepath, globs = [], options = undefined) { 5 | if (!filepath || !Array.isArray(globs) || globs.length === 0) { 6 | return false; 7 | } 8 | 9 | let inputPath = TemplatePath.stripLeadingDotSlash(filepath); 10 | let opts = Object.assign( 11 | { 12 | dot: true, 13 | nocase: true, // insensitive 14 | }, 15 | options, 16 | ); 17 | 18 | // globs: string or array of strings 19 | return picomatch.isMatch(inputPath, globs, opts); 20 | } 21 | 22 | export { isGlobMatch }; 23 | -------------------------------------------------------------------------------- /src/Util/IsAsyncFunction.js: -------------------------------------------------------------------------------- 1 | const ComparisonAsyncFunction = (async () => {}).constructor; 2 | 3 | export default function isAsyncFunction(fn) { 4 | return fn instanceof ComparisonAsyncFunction; 5 | } 6 | -------------------------------------------------------------------------------- /src/Util/Objects/DeepFreeze.js: -------------------------------------------------------------------------------- 1 | import { isPlainObject } from "@11ty/eleventy-utils"; 2 | 3 | // via https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze 4 | 5 | function DeepFreeze(obj, topLevelExceptions) { 6 | for (let name of Reflect.ownKeys(obj)) { 7 | if ((topLevelExceptions || []).find((key) => key === name)) { 8 | continue; 9 | } 10 | 11 | const value = obj[name]; 12 | if (isPlainObject(value)) { 13 | DeepFreeze(value); 14 | } 15 | } 16 | 17 | return Object.freeze(obj); 18 | } 19 | 20 | export { DeepFreeze }; 21 | -------------------------------------------------------------------------------- /src/Util/Objects/ObjectFilter.js: -------------------------------------------------------------------------------- 1 | export default function objectFilter(obj, callback) { 2 | let newObject = {}; 3 | for (let [key, value] of Object.entries(obj || {})) { 4 | if (callback(value, key)) { 5 | newObject[key] = value; 6 | } 7 | } 8 | return newObject; 9 | } 10 | -------------------------------------------------------------------------------- /src/Util/Objects/SampleModule.mjs: -------------------------------------------------------------------------------- 1 | export default {}; 2 | -------------------------------------------------------------------------------- /src/Util/Objects/Unique.js: -------------------------------------------------------------------------------- 1 | export default function Unique(arr) { 2 | return Array.from(new Set(arr)); 3 | } 4 | -------------------------------------------------------------------------------- /src/Util/PassthroughCopyBehaviorCheck.js: -------------------------------------------------------------------------------- 1 | function isUsingEleventyDevServer(config) { 2 | return ( 3 | !config.serverOptions.module || config.serverOptions.module === "@11ty/eleventy-dev-server" 4 | ); 5 | } 6 | 7 | // Config opt-out via serverPassthroughCopyBehavior 8 | // False when other server is used 9 | // False when runMode is "build" or "watch" 10 | export default function (config, runMode) { 11 | return ( 12 | config.serverPassthroughCopyBehavior === "passthrough" && 13 | isUsingEleventyDevServer(config) && 14 | runMode === "serve" 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /src/Util/PathPrefixer.js: -------------------------------------------------------------------------------- 1 | import path from "node:path"; 2 | 3 | import PathNormalizer from "./PathNormalizer.js"; 4 | 5 | class PathPrefixer { 6 | static normalizePathPrefix(pathPrefix) { 7 | if (pathPrefix) { 8 | // add leading / (for browsersync), see #1454 9 | // path.join uses \\ for Windows so we split and rejoin 10 | return PathPrefixer.joinUrlParts("/", pathPrefix); 11 | } 12 | 13 | return "/"; 14 | } 15 | 16 | static joinUrlParts(...parts) { 17 | return PathNormalizer.normalizeSeperator(path.join(...parts)); 18 | } 19 | } 20 | 21 | export default PathPrefixer; 22 | -------------------------------------------------------------------------------- /src/Util/Pluralize.js: -------------------------------------------------------------------------------- 1 | export default function (count, singleWord, pluralWord) { 2 | return count === 1 ? singleWord : pluralWord; 3 | } 4 | -------------------------------------------------------------------------------- /src/Util/PromiseUtil.js: -------------------------------------------------------------------------------- 1 | function withResolvers() { 2 | if ("withResolvers" in Promise) { 3 | return Promise.withResolvers(); 4 | } 5 | 6 | let resolve; 7 | let reject; 8 | let promise = new Promise((res, rej) => { 9 | resolve = res; 10 | reject = rej; 11 | }); 12 | return { promise, resolve, reject }; 13 | } 14 | 15 | export { withResolvers }; 16 | -------------------------------------------------------------------------------- /src/Util/SetUnion.js: -------------------------------------------------------------------------------- 1 | function setUnion(...sets) { 2 | let root = new Set(); 3 | for (let set of sets) { 4 | for (let entry of set) { 5 | root.add(entry); 6 | } 7 | } 8 | return root; 9 | } 10 | 11 | export { setUnion }; 12 | -------------------------------------------------------------------------------- /src/Util/SpawnAsync.js: -------------------------------------------------------------------------------- 1 | import { spawn } from "node:child_process"; 2 | import { withResolvers } from "./PromiseUtil.js"; 3 | 4 | export function spawnAsync(command, args, options) { 5 | let { promise, resolve, reject } = withResolvers(); 6 | 7 | const cmd = spawn(command, args, options); 8 | cmd.stdout.on("data", (data) => { 9 | resolve(data.toString("utf8")); 10 | }); 11 | 12 | cmd.stderr.on("data", (data) => { 13 | reject(data.toString("utf8")); 14 | }); 15 | 16 | cmd.on("close", (code) => { 17 | if (code === 1) { 18 | reject("Internal error: process closed with error exit code."); 19 | } else { 20 | resolve(); 21 | } 22 | }); 23 | 24 | return promise; 25 | } 26 | -------------------------------------------------------------------------------- /src/Util/ValidUrl.js: -------------------------------------------------------------------------------- 1 | export default function isValidUrl(url) { 2 | try { 3 | new URL(url); 4 | return true; 5 | } catch (e) { 6 | // invalid url OR local path 7 | return false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/ImportJsonSyncTest.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import { TemplatePath } from "@11ty/eleventy-utils"; 3 | import { importJsonSync, findFilePathInParentDirs } from "../src/Util/ImportJsonSync.js"; 4 | 5 | test("Import a JSON", t => { 6 | t.deepEqual(Object.keys(importJsonSync("../../package.json")).sort().pop(), "version"); 7 | }); 8 | 9 | test("getWorkingProjectPackageJson() traverse parent dirs", t => { 10 | let path = findFilePathInParentDirs(TemplatePath.absolutePath("test"), "package.json"); 11 | let json = importJsonSync(path); 12 | t.deepEqual(Object.keys(json).sort().pop(), "version"); 13 | }); 14 | -------------------------------------------------------------------------------- /test/Issue3797Test.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import Eleventy from "../src/Eleventy.js"; 3 | 4 | test("#3797 Virtual templates with empty includes", async (t) => { 5 | let elev = new Eleventy("test/noop", false, { 6 | config(eleventyConfig) { 7 | eleventyConfig.setIncludesDirectory(""); 8 | eleventyConfig.setLayoutsDirectory("_layouts"); 9 | eleventyConfig.addTemplate("post1.md", "# Post1", { layout: "layout.html" }); 10 | eleventyConfig.addTemplate("_layouts/layout.html", "{{ content }}"); 11 | } 12 | }); 13 | 14 | let [result] = await elev.toJSON(); 15 | 16 | t.truthy(result); 17 | }); 18 | -------------------------------------------------------------------------------- /test/Issue3809Test.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | 3 | import { spawnAsync } from "../src/Util/SpawnAsync.js"; 4 | 5 | test("#3809 parent directory for content, with global data files", async (t) => { 6 | let result = await spawnAsync( 7 | "node", 8 | // Formats https://www.git-scm.com/docs/git-log#_pretty_formats 9 | // %at author date, UNIX timestamp 10 | ["../../../../cmd.cjs", "--to=json"], 11 | { 12 | cwd: "test/_issues/3809/.app/" 13 | } 14 | ); 15 | 16 | let json = JSON.parse(result); 17 | t.is(json.length, 1); 18 | t.is(json[0]?.content.trim(), "My Application"); 19 | }); 20 | -------------------------------------------------------------------------------- /test/Issue3833Test.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import Eleventy from "../src/Eleventy.js"; 3 | 4 | test("#3831 Computed Data regression", async (t) => { 5 | let elev = new Eleventy("test/noop", false, { 6 | config(eleventyConfig) { 7 | 8 | eleventyConfig.addTemplate("index.njk", `--- 9 | date: 10 | - April 1, 2025 11 | ---`); 12 | } 13 | }); 14 | elev.disableLogger(); 15 | 16 | let e = await t.throwsAsync(() => elev.toJSON()); 17 | t.is(e.message, `Data cascade value for \`date\` (April 1, 2025) is invalid for ./test/noop/index.njk. Expected a JavaScript Date instance, luxon DateTime instance, or String value.`); 18 | }); 19 | -------------------------------------------------------------------------------- /test/JavaScriptDependenciesTest.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import JavaScriptDependencies from "../src/Util/JavaScriptDependencies.js"; 3 | 4 | test("No node_modules", async (t) => { 5 | let deps = await JavaScriptDependencies.getDependencies([ 6 | "./test/stubs-dependency-tree/index.cjs", 7 | ]); 8 | 9 | t.deepEqual(deps, [ 10 | "./test/stubs-dependency-tree/child.cjs", 11 | "./test/stubs-dependency-tree/grandchild.cjs", 12 | ]); 13 | }); 14 | -------------------------------------------------------------------------------- /test/PluralizeTest.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | 3 | import pluralize from "../src/Util/Pluralize.js"; 4 | 5 | test("Pluralize", (t) => { 6 | t.is(pluralize(0, "test", "tests"), "tests"); 7 | t.is(pluralize(1, "test", "tests"), "test"); 8 | t.is(pluralize(2, "test", "tests"), "tests"); 9 | t.is(pluralize(3, "test", "tests"), "tests"); 10 | t.is(pluralize(3.5, "test", "tests"), "tests"); 11 | }); 12 | -------------------------------------------------------------------------------- /test/TemplateEngineTest.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | 3 | import TemplateEngine from "../src/Engines/TemplateEngine.js"; 4 | 5 | import { getTemplateConfigInstance } from "./_testHelpers.js" 6 | 7 | test("Unsupported engine", async (t) => { 8 | let eleventyConfig = await getTemplateConfigInstance(); 9 | let engine = new TemplateEngine("doesnotexist", eleventyConfig); 10 | t.is(engine.getName(), "doesnotexist"); 11 | }); 12 | 13 | test("Supported engine", async (t) => { 14 | let eleventyConfig = await getTemplateConfigInstance(); 15 | t.is(new TemplateEngine("liquid", eleventyConfig).getName(), "liquid"); 16 | }); 17 | -------------------------------------------------------------------------------- /test/TestUtilityTest.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import { normalizeNewLines } from "./Util/normalizeNewLines.js"; 3 | 4 | test("normalizeNewLines", (t) => { 5 | t.is(normalizeNewLines("\n"), "\n"); 6 | t.is(normalizeNewLines("\r\n"), "\n"); 7 | t.is(normalizeNewLines("\r\n\n"), "\n\n"); 8 | t.is(normalizeNewLines("\r\n\r\n"), "\n\n"); 9 | t.is(normalizeNewLines("a\r\nhello\r\nhi"), "a\nhello\nhi"); 10 | }); 11 | -------------------------------------------------------------------------------- /test/Util/normalizeNewLines.js: -------------------------------------------------------------------------------- 1 | import os from 'node:os'; 2 | 3 | function normalizeNewLines(str) { 4 | return str.replace(/\r\n/g, "\n"); 5 | } 6 | 7 | function localizeNewLines(str) { 8 | return normalizeNewLines(str).replace(/\n/g, os.EOL); 9 | } 10 | 11 | export { 12 | normalizeNewLines, 13 | localizeNewLines, 14 | }; 15 | -------------------------------------------------------------------------------- /test/Util/removeNewLines.js: -------------------------------------------------------------------------------- 1 | function removeNewLines(str) { 2 | return str.replace(/[\r\n]*/g, ""); 3 | } 4 | 5 | module.exports = removeNewLines; 6 | -------------------------------------------------------------------------------- /test/_issues/2250/javascript.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | return this.getUrl(); 3 | }; 4 | -------------------------------------------------------------------------------- /test/_issues/2250/liquid.liquid: -------------------------------------------------------------------------------- 1 | {{ "test" | getUrl }} -------------------------------------------------------------------------------- /test/_issues/2250/nunjucks.njk: -------------------------------------------------------------------------------- 1 | {{ "test" | getUrl }} -------------------------------------------------------------------------------- /test/_issues/3697/_data/folder/0.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "value" 3 | } 4 | -------------------------------------------------------------------------------- /test/_issues/3697/_data/folder/3.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/_issues/3809/.app/.eleventy.js: -------------------------------------------------------------------------------- 1 | export const config = { 2 | dir: { 3 | input: "../", 4 | data: ".app/_data", 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /test/_issues/3809/.app/_data/app.json: -------------------------------------------------------------------------------- 1 | {"name": "My Application"} 2 | -------------------------------------------------------------------------------- /test/_issues/3809/index.njk: -------------------------------------------------------------------------------- 1 | {{ app.name }} 2 | -------------------------------------------------------------------------------- /test/_issues/975/another-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | --- 5 | -------------------------------------------------------------------------------- /test/_issues/975/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | eleventyImport: 3 | collections: ["post"] 4 | --- 5 | -------------------------------------------------------------------------------- /test/_issues/975/post.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | --- 5 | -------------------------------------------------------------------------------- /test/file-system-search/file.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/file-system-search/file.txt -------------------------------------------------------------------------------- /test/noop/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/noop/.gitkeep -------------------------------------------------------------------------------- /test/noop2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/noop2/.gitkeep -------------------------------------------------------------------------------- /test/proxy-pagination-globaldata/_data/banner.js: -------------------------------------------------------------------------------- 1 | export default { 2 | content: "BANNER TEXT", 3 | }; 4 | -------------------------------------------------------------------------------- /test/proxy-pagination-globaldata/tmpl.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | pages: 3 | - page 1 4 | pagination: 5 | data: pages 6 | size: 1 7 | --- 8 | {{ banner.content }} -------------------------------------------------------------------------------- /test/proxy-pagination-globaldata/tmpl2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pages: 3 | - page 1 4 | pagination: 5 | data: pages 6 | size: 1 7 | --- 8 | {{ banner.content }} -------------------------------------------------------------------------------- /test/proxy-pagination-globaldata/tmpl4.11ty.js: -------------------------------------------------------------------------------- 1 | const data = { 2 | pages: ["page 1"], 3 | pagination: { 4 | data: "pages", 5 | size: 1, 6 | }, 7 | }; 8 | 9 | const render = (data) => `${data.banner.content}`; 10 | 11 | export { data, render }; 12 | -------------------------------------------------------------------------------- /test/slugify-filter/comma.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Hi, I'm ZAch" 3 | permalink: subdir/{{ title | slugify }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/multibyte.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: "test-猫" 3 | permalink: subdir/{{ title | slugify }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/slug-number.njk: -------------------------------------------------------------------------------- 1 | --- 2 | number: 1 3 | permalink: subdir/{{ number | slug }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/slug-options.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Hi, I am ZAch" 3 | permalink: "subdir/{{ title | slug({replacement:'_'}) }}/index.html" 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/slugify-number.njk: -------------------------------------------------------------------------------- 1 | --- 2 | number: 1 3 | permalink: subdir/{{ number | slugify }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/slugify-options.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Hi, I'm ZAch" 3 | permalink: "subdir/{{ title | slugify({decamelize: true}) }}/index.html" 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/slugify-filter/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: _Slug ♥ CANDIDATE люблю $#%- 3 | permalink: subdir/{{ title | slugify }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/stubs--to/test.md: -------------------------------------------------------------------------------- 1 | # hi 2 | -------------------------------------------------------------------------------- /test/stubs--to/test2.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: hello 3 | --- 4 | {{ hi }} -------------------------------------------------------------------------------- /test/stubs-1206/page1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: tag1 3 | --- 4 | This is the first template.{{ page.rawInput }} -------------------------------------------------------------------------------- /test/stubs-1206/page2.njk: -------------------------------------------------------------------------------- 1 | This is the second template.{{ collections.tag1[0].rawInput }} -------------------------------------------------------------------------------- /test/stubs-1242/_data/xyz.dottest.json: -------------------------------------------------------------------------------- 1 | { 2 | "hi": "bye" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs-1242/_data/xyz.dottest/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "abc": 42 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs-1242/empty.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-1242/empty.md -------------------------------------------------------------------------------- /test/stubs-1325/test.11ty.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-1325/test.11ty.js -------------------------------------------------------------------------------- /test/stubs-1325/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-1325/test.js -------------------------------------------------------------------------------- /test/stubs-142/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | date: git Last Modified 3 | --- 4 | {{ page.date.getTime() }} -------------------------------------------------------------------------------- /test/stubs-1691/_data/str.txt: -------------------------------------------------------------------------------- 1 | Testing -------------------------------------------------------------------------------- /test/stubs-1691/template.11tydata.txt: -------------------------------------------------------------------------------- 1 | Template Data File -------------------------------------------------------------------------------- /test/stubs-1691/template.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-1691/template.njk -------------------------------------------------------------------------------- /test/stubs-2145/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | --- 2 | LayoutData: 123 3 | --- 4 | FromLayout{{ content }} -------------------------------------------------------------------------------- /test/stubs-2145/test.njk: -------------------------------------------------------------------------------- 1 | {{ layout }} -------------------------------------------------------------------------------- /test/stubs-2167/paginated.njk: -------------------------------------------------------------------------------- 1 | --- 2 | dropdown: 3 | - a 4 | - b 5 | - c 6 | - d 7 | - e 8 | pagination: 9 | data: dropdown 10 | size: 1 11 | permalink: false 12 | --- 13 | -------------------------------------------------------------------------------- /test/stubs-2224/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | date: git created 3 | --- 4 | {{ page.date.getTime() }} -------------------------------------------------------------------------------- /test/stubs-2258-2830-skip-layouts/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | /* Banner */ 2 | {{ content | safe }} -------------------------------------------------------------------------------- /test/stubs-2258-2830-skip-layouts/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.njk 3 | --- 4 | code { 5 | padding: 0.25em; 6 | line-height: 0; 7 | } -------------------------------------------------------------------------------- /test/stubs-2258/_includes/_code.scss: -------------------------------------------------------------------------------- 1 | code { 2 | padding: 0.25em; 3 | line-height: 0; 4 | } -------------------------------------------------------------------------------- /test/stubs-2258/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | /* Banner */ 2 | {{ content | safe }} -------------------------------------------------------------------------------- /test/stubs-2258/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.njk 3 | --- 4 | @use "code.scss"; 5 | 6 | /* Comment */ -------------------------------------------------------------------------------- /test/stubs-2367/_includes/layout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | text: layout 3 | url: "/mylayout" 4 | --- 5 | {% simplelink text url text url text url %} 6 | {% simplelink text, url, text, url, text, url %} -------------------------------------------------------------------------------- /test/stubs-2367/templateWithLiquidShortcodeMultipleArguments-template2.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.liquid 3 | --- -------------------------------------------------------------------------------- /test/stubs-2367/templateWithLiquidShortcodeMultipleArguments.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.liquid 3 | --- -------------------------------------------------------------------------------- /test/stubs-2378/_data/images/dog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-2378/_data/images/dog.jpg -------------------------------------------------------------------------------- /test/stubs-2378/_data/images/dogpng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-2378/_data/images/dogpng.png -------------------------------------------------------------------------------- /test/stubs-2602/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /deep/ 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Home 18 | Test 19 | Test 20 | 21 | -------------------------------------------------------------------------------- /test/stubs-2753/_data/global.js: -------------------------------------------------------------------------------- 1 | let count = 0; 2 | export default async function () { 3 | return ++count; 4 | }; 5 | -------------------------------------------------------------------------------- /test/stubs-2753/page1.njk: -------------------------------------------------------------------------------- 1 | {{ global }} -------------------------------------------------------------------------------- /test/stubs-2753/page2.njk: -------------------------------------------------------------------------------- 1 | {{ global }} -------------------------------------------------------------------------------- /test/stubs-2790/page.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function ({ name }) { 2 | return `

${this.jsfunction(name)}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-2851/content.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: ['tag with spaces'] 3 | --- -------------------------------------------------------------------------------- /test/stubs-2851/paginated.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: "collections['tag with spaces']" 4 | size: 1 5 | --- 6 | -------------------------------------------------------------------------------- /test/stubs-3013/html/_data/books.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "The Effervescent adventures of Paul Mescal", 5 | "shortname": "paul-mescal" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Populace and Power: A user's guide", 10 | "shortname": "populace-and-power" 11 | } 12 | ] -------------------------------------------------------------------------------- /test/stubs-3013/html/_includes/base.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: Books 3 | --- 4 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3013/html/book.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: books 5 | size: 1 6 | alias: book 7 | permalink: /{{ book.shortname }}/ 8 | eleventyComputed: 9 | title: "{{ book.name }}" 10 | --- 11 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3013/liquid/_data/books.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "The Effervescent adventures of Paul Mescal", 5 | "shortname": "paul-mescal" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Populace and Power: A user's guide", 10 | "shortname": "populace-and-power" 11 | } 12 | ] -------------------------------------------------------------------------------- /test/stubs-3013/liquid/_includes/base.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: Books 3 | --- 4 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3013/liquid/book.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: books 5 | size: 1 6 | alias: book 7 | permalink: /{{ book.shortname }}/ 8 | eleventyComputed: 9 | title: "{{ book.name }}" 10 | --- 11 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3013/md/_data/books.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "The Effervescent adventures of Paul Mescal", 5 | "shortname": "paul-mescal" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Populace and Power: A user's guide", 10 | "shortname": "populace-and-power" 11 | } 12 | ] -------------------------------------------------------------------------------- /test/stubs-3013/md/_includes/base.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Books 3 | --- 4 | 5 | {{ title }} 6 | -------------------------------------------------------------------------------- /test/stubs-3013/md/book.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: books 5 | size: 1 6 | alias: book 7 | permalink: /{{ book.shortname }}/ 8 | eleventyComputed: 9 | title: "{{ book.name }}" 10 | --- 11 | 12 | {{ title }} 13 | -------------------------------------------------------------------------------- /test/stubs-3013/njk/_data/books.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "The Effervescent adventures of Paul Mescal", 5 | "shortname": "paul-mescal" 6 | }, 7 | { 8 | "id": 2, 9 | "name": "Populace and Power: A user's guide", 10 | "shortname": "populace-and-power" 11 | } 12 | ] -------------------------------------------------------------------------------- /test/stubs-3013/njk/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Books 3 | --- 4 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3013/njk/book.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: books 5 | size: 1 6 | alias: book 7 | permalink: /{{ book.shortname }}/ 8 | eleventyComputed: 9 | title: "{{ book.name }}" 10 | --- 11 | {{ title }} -------------------------------------------------------------------------------- /test/stubs-3285/src/scripts/hello-world.js: -------------------------------------------------------------------------------- 1 | export default function() { 2 | console.log('hello world'); 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-337/data/xyz.json: -------------------------------------------------------------------------------- 1 | { 2 | "hi": "bye" 3 | } -------------------------------------------------------------------------------- /test/stubs-337/src/empty.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-337/src/empty.md -------------------------------------------------------------------------------- /test/stubs-3807/_layouts/base.html: -------------------------------------------------------------------------------- 1 | {% block main %}{{ content | safe }}{% endblock %} -------------------------------------------------------------------------------- /test/stubs-3807/_layouts/home.html: -------------------------------------------------------------------------------- 1 | {% extends "test/stubs-3807/_layouts/base.html" %}{% block main %}Home{{ content | trim | safe }}{% endblock %} -------------------------------------------------------------------------------- /test/stubs-3807/eleventy.config.js: -------------------------------------------------------------------------------- 1 | export default function(eleventyConfig) { 2 | eleventyConfig.setLayoutsDirectory("_layouts"); 3 | } 4 | export const config = { 5 | markdownTemplateEngine: "njk", 6 | htmlTemplateEngine: "njk", 7 | } -------------------------------------------------------------------------------- /test/stubs-3807/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home.html 3 | --- 4 | Index -------------------------------------------------------------------------------- /test/stubs-3810/_includes/promo.njk: -------------------------------------------------------------------------------- 1 |

Sign up for our {{ promoType }}!

-------------------------------------------------------------------------------- /test/stubs-3810/eleventy.config.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import { RenderPlugin } from '../../src/Eleventy.js'; 3 | const { RenderManager } = RenderPlugin; 4 | 5 | export default function(eleventyConfig) { 6 | const rm = new RenderManager(); 7 | 8 | eleventyConfig.on('eleventy.config', cfg => { 9 | rm.templateConfig = cfg; 10 | }); 11 | 12 | eleventyConfig.addAsyncShortcode('promo', async function (promoType) { 13 | let content = fs.readFileSync('./test/stubs-3810/_includes/promo.njk').toString(); 14 | 15 | const fn = await rm.compile(content, 'njk'); 16 | 17 | return fn({ promoType }); 18 | }); 19 | } 20 | 21 | export const config = { 22 | markdownTemplateEngine: "njk", 23 | } -------------------------------------------------------------------------------- /test/stubs-3810/index.md: -------------------------------------------------------------------------------- 1 | {% promo "newsletter" %} -------------------------------------------------------------------------------- /test/stubs-403/.eleventyignore: -------------------------------------------------------------------------------- 1 | ./_includes/** -------------------------------------------------------------------------------- /test/stubs-403/_includes/include.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-403/_includes/include.liquid -------------------------------------------------------------------------------- /test/stubs-403/template.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-403/template.liquid -------------------------------------------------------------------------------- /test/stubs-408-sass/_code.scss: -------------------------------------------------------------------------------- 1 | code { 2 | padding: 0.25em; 3 | line-height: 0; 4 | } -------------------------------------------------------------------------------- /test/stubs-408-sass/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.njk 3 | --- 4 | @use "code.scss"; 5 | 6 | /* Comment */ -------------------------------------------------------------------------------- /test/stubs-413/date-frontmatter.md: -------------------------------------------------------------------------------- 1 | --- 2 | subtitle: New doc page 3 | date: 2019-03-13 20:18:42 +0000 4 | tags: 5 | - docs 6 | --- 7 | -------------------------------------------------------------------------------- /test/stubs-434/_includes/macros-filter.njk: -------------------------------------------------------------------------------- 1 | {% macro label(text) %}{% endmacro %} -------------------------------------------------------------------------------- /test/stubs-434/_includes/macros.njk: -------------------------------------------------------------------------------- 1 | {% macro label(text) %}{% endmacro %} -------------------------------------------------------------------------------- /test/stubs-475/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | {{ content | safe }} -------------------------------------------------------------------------------- /test/stubs-475/transform-layout/transform-layout.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.njk 3 | --- 4 | This is content. -------------------------------------------------------------------------------- /test/stubs-630/_data/globalData0.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | datakey1: "datavalue0" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-630/_data/globalData1.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | datakey1: "datavalue1" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-630/_data/globalData2.json: -------------------------------------------------------------------------------- 1 | { 2 | "datakey1": "datavalue2", 3 | "datakey2": "{{pkg.name}}--json" 4 | } 5 | -------------------------------------------------------------------------------- /test/stubs-630/_data/globalData3.yaml: -------------------------------------------------------------------------------- 1 | datakey1: datavalue3 2 | datakey2: "{{pkg.name}}--yaml" 3 | -------------------------------------------------------------------------------- /test/stubs-630/_data/globalData4.nosj: -------------------------------------------------------------------------------- 1 | { 2 | "datakey1": "datavalue4", 3 | "datakey2": "{{pkg.name}}--nosj" 4 | } 5 | -------------------------------------------------------------------------------- /test/stubs-630/_data/mergingGlobalData.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | datakey0: "cjs-value1", 3 | datakey1: "cjs-value1", 4 | cjskey: "cjs" 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs-630/_data/mergingGlobalData.js: -------------------------------------------------------------------------------- 1 | export default { 2 | datakey0: "js-value0", 3 | jskey: "js", 4 | }; 5 | -------------------------------------------------------------------------------- /test/stubs-630/_data/mergingGlobalData.json: -------------------------------------------------------------------------------- 1 | { 2 | "datakey0": "json-value1", 3 | "datakey1": "json-value1", 4 | "datakey2": "json-value2", 5 | "jsonkey": "json" 6 | } 7 | -------------------------------------------------------------------------------- /test/stubs-630/_data/mergingGlobalData.nosj: -------------------------------------------------------------------------------- 1 | { 2 | "datakey0": "nosj-value1", 3 | "datakey1": "nosj-value1", 4 | "datakey2": "nosj-value2", 5 | "datakey3": "nosj-value3", 6 | "datakey4": "nosj-value4", 7 | "nosjkey": "nosj" 8 | } 9 | -------------------------------------------------------------------------------- /test/stubs-630/_data/mergingGlobalData.yaml: -------------------------------------------------------------------------------- 1 | datakey0: "yaml-value1" 2 | datakey1: "yaml-value1" 3 | datakey2: "yaml-value2" 4 | datakey3: "yaml-value3" 5 | yamlkey: "yaml" 6 | -------------------------------------------------------------------------------- /test/stubs-630/_data/subdir/globalDataSubdir.yaml: -------------------------------------------------------------------------------- 1 | keyyaml: "yaml" 2 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jsKey1: "js1" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.11tydata.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonKey1": "json1" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.11tydata.nosj: -------------------------------------------------------------------------------- 1 | { 2 | "nosjKey1": "nosj1" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.11tydata.yaml: -------------------------------------------------------------------------------- 1 | yamlKey2: "yaml2" 2 | yamlKey3: "yaml3" 3 | jsonKey1: "overridden" 4 | jsKey1: "overridden" 5 | nosjKey1: "overridden" 6 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonKey2": "json2", 3 | "jsKey1": "overridden", 4 | "yamlKey3": "overridden" 5 | } 6 | -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.njk: -------------------------------------------------------------------------------- 1 | {{localkeyOverride}} -------------------------------------------------------------------------------- /test/stubs-630/component-yaml/component.yaml: -------------------------------------------------------------------------------- 1 | yamlKey1: "yaml1" 2 | yamlKey2: "overridden" 3 | jsonKey1: "overridden" 4 | jsonKey2: "overridden" 5 | jsKey1: "overridden" 6 | -------------------------------------------------------------------------------- /test/stubs-670/content.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - Cañon City 4 | --- -------------------------------------------------------------------------------- /test/stubs-670/index.njk: -------------------------------------------------------------------------------- 1 | {{ collections | length }},{% for key,item in collections %}{{ key }},{% endfor %} -------------------------------------------------------------------------------- /test/stubs-919/test.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | return { 3 | test: Math.random(), 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs-919/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | root: 3 | - one 4 | - two 5 | - three 6 | pagination: 7 | data: "root" 8 | size: 1 9 | --- 10 | {{ test | log }} -------------------------------------------------------------------------------- /test/stubs-919/test2.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-919/test2.njk -------------------------------------------------------------------------------- /test/stubs-absolute/test.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-absolute/test.md -------------------------------------------------------------------------------- /test/stubs-addglobaldata-noop/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-addglobaldata-noop/test.txt -------------------------------------------------------------------------------- /test/stubs-addglobaldata/test.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-addglobaldata/test.liquid -------------------------------------------------------------------------------- /test/stubs-autocopy/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-autocopy/.gitkeep -------------------------------------------------------------------------------- /test/stubs-autocopy/possum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-autocopy/possum.jpg -------------------------------------------------------------------------------- /test/stubs-autocopy/possum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-autocopy/possum.png -------------------------------------------------------------------------------- /test/stubs-base-case-sens/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /deep/ 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Home 18 | Test 19 | Test 20 | 21 | -------------------------------------------------------------------------------- /test/stubs-base/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /deep/ 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Home 18 | Test 19 | Test 20 | Test 21 | 22 | -------------------------------------------------------------------------------- /test/stubs-circular-layout/_includes/layout-cycle-a.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/layout-cycle-b.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-circular-layout/_includes/layout-cycle-b.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/layout-cycle-c.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-circular-layout/_includes/layout-cycle-c.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/layout-cycle-a.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-circular-layout/_includes/layout-cycle-self.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/layout-cycle-b.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-computed-array/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | dynamicValue: "test" 3 | eleventyComputed: 4 | notArray: "{{ dynamicValue }}" 5 | array: 6 | - "static value" 7 | - "{{ dynamicValue }}" 8 | --- -------------------------------------------------------------------------------- /test/stubs-computed-collections-filter/collections.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | eleventyComputed: { 4 | test: "hello", 5 | dogCollection: data => { 6 | return data.collections.dog.filter(entry => true); 7 | } 8 | } 9 | } 10 | --- 11 | Issue #1114 -------------------------------------------------------------------------------- /test/stubs-computed-collections-filter/dog.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dog 3 | --- 4 | Hi from dog -------------------------------------------------------------------------------- /test/stubs-computed-collections/collections.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | eleventyComputed: { 4 | test: "hello", 5 | dogCollection: data => { 6 | return data.collections.dog; 7 | } 8 | } 9 | } 10 | --- 11 | Issue #1114 -------------------------------------------------------------------------------- /test/stubs-computed-collections/dog.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dog 3 | --- 4 | Hi from dog -------------------------------------------------------------------------------- /test/stubs-computed-dirdata/dir/dir.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | eleventyComputed: { 3 | webmentions: (data) => { 4 | return data.test; 5 | }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs-computed-dirdata/dir/first.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | test: "first", 3 | }; 4 | 5 | module.exports.render = function (data) { 6 | return "first"; 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs-computed-dirdata/dir/second.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | test: "second", 3 | }; 4 | 5 | module.exports.render = function (data) { 6 | return "second"; 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs-computed-global/_data/eleventyComputed.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | eleventyNavigation: { 3 | key: data => { 4 | return "nested-first-global"; 5 | } 6 | }, 7 | image2: data => { 8 | return "second-global"; 9 | }, 10 | image3: data => { 11 | return "third-global"; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /test/stubs-computed-global/intermix.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | eleventyComputed: { 4 | image: data => { 5 | return "first"; 6 | }, 7 | image2: data => { 8 | return "second"; 9 | } 10 | } 11 | } 12 | --- 13 | Issue #1043 -------------------------------------------------------------------------------- /test/stubs-computed-pagination/child.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | eleventyComputed: { 3 | venues: (data) => { 4 | return data.collections.venue; 5 | }, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs-computed-pagination/paginated.njk: -------------------------------------------------------------------------------- 1 | --- 2 | venues: 3 | - first 4 | - second 5 | pagination: 6 | data: venues 7 | size: 1 8 | alias: venue 9 | addAllPagesToCollections: true 10 | permalink: "venues/{{ venue }}/" 11 | tags: venue 12 | eleventyComputed: 13 | title: "{{ venue }}" 14 | --- -------------------------------------------------------------------------------- /test/stubs-computed-symbolparse/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | eleventyComputed: 3 | c: "{{ a | fail }}{{ b | fail }}" 4 | a: "a" 5 | b: "b" 6 | --- -------------------------------------------------------------------------------- /test/stubs-computed-symbolparse/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | eleventyComputed: 3 | c: "{{ a | fail }}{{ b | fail }}" 4 | a: "a" 5 | b: "b" 6 | --- -------------------------------------------------------------------------------- /test/stubs-custom-extension/test.js1: -------------------------------------------------------------------------------- 1 |

Paragraph

-------------------------------------------------------------------------------- /test/stubs-data-cascade/global-versus-layout/_data/cascade.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "from-global-data"; 2 | -------------------------------------------------------------------------------- /test/stubs-data-cascade/global-versus-layout/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | cascade: "from-layout-file" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/global-versus-layout/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "base.njk" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-data-files/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | shared: layout 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-data-files/test.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | shared: "datafile" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-data-files/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-dirdatafile/src/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | cascade: "from-layout-file" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-dirdatafile/src/src.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | cascade: "dir-data-file", 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-dirdatafile/src/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "base.njk" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-tmpldatafile/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | cascade: "from-layout-file" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-tmpldatafile/test.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | cascade: "template-data-file", 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-data-cascade/layout-versus-tmpldatafile/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "base.njk" 3 | --- -------------------------------------------------------------------------------- /test/stubs-data-esm/_data/commonjs.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "commonjs default"; -------------------------------------------------------------------------------- /test/stubs-data-esm/_data/module.mjs: -------------------------------------------------------------------------------- 1 | export const named = "es module named"; 2 | 3 | export default "es module default"; 4 | -------------------------------------------------------------------------------- /test/stubs-dependency-tree/child.cjs: -------------------------------------------------------------------------------- 1 | require("./grandchild.cjs"); 2 | -------------------------------------------------------------------------------- /test/stubs-dependency-tree/grandchild.cjs: -------------------------------------------------------------------------------- 1 | require("kleur"); 2 | -------------------------------------------------------------------------------- /test/stubs-dependency-tree/index.cjs: -------------------------------------------------------------------------------- 1 | require("lodash"); 2 | require("./child.cjs"); 3 | -------------------------------------------------------------------------------- /test/stubs-empty-json-data/_data/empty.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/stubs-empty/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-empty/.gitkeep -------------------------------------------------------------------------------- /test/stubs-fancyjs/test.11ty.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | function render(data: object) { 4 | return
hello world 1
; 5 | } 6 | 7 | export { render } -------------------------------------------------------------------------------- /test/stubs-fancyjs/test.mdx: -------------------------------------------------------------------------------- 1 | export function Thing() { 2 | return <>World!!!! 3 | } 4 | 5 | # Hello, -------------------------------------------------------------------------------- /test/stubs-global-data-config-api-nested/_data/deep.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | existing: true, 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs-global-data-config-api/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-global-data-config-api/empty.txt -------------------------------------------------------------------------------- /test/stubs-i18n/en-us/index.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function (data) { 2 | return `${this.locale_url("/")} 3 | ${this.locale_url("/en-us/")} 4 | ${this.locale_url("/es/")} 5 | ${this.locale_url("/", "es")} 6 | ${this.locale_url("/non-lang-file/")} 7 | ${JSON.stringify(this.locale_links(data.page.url).sort())} 8 | ${JSON.stringify(this.locale_links().sort())} 9 | ${data.page.lang}`; 10 | }; 11 | -------------------------------------------------------------------------------- /test/stubs-i18n/en/index.liquid: -------------------------------------------------------------------------------- 1 | {{ "/" | locale_url }} 2 | {{ "/en-us/" | locale_url }} 3 | {{ "/es/" | locale_url }} 4 | {{ "/" | locale_url: "en-us" }} 5 | {{ "/non-lang-file/" | locale_url }} 6 | {{ page.url | locale_links | json }} 7 | {{ "" | locale_links | json }} 8 | {{ page.lang }} -------------------------------------------------------------------------------- /test/stubs-i18n/es/index.njk: -------------------------------------------------------------------------------- 1 | {{ "/" | locale_url }} 2 | {{ "/en-us/" | locale_url }} 3 | {{ "/es/" | locale_url }} 4 | {{ "/" | locale_url("en-us") }} 5 | {{ "/non-lang-file/" | locale_url }} 6 | {{ page.url | locale_links | dump | safe }} 7 | {{ "" | locale_links | dump | safe }} 8 | {{ page.lang }} -------------------------------------------------------------------------------- /test/stubs-i18n/non-lang-file.njk: -------------------------------------------------------------------------------- 1 | {{ "/" | locale_url }} 2 | {{ "/" | locale_url("en-us") }} 3 | {{ "/non-lang-file/" | locale_url }} 4 | {{ page.url | locale_links | dump | safe }} 5 | {{ "" | locale_links | dump | safe }} 6 | {{ page.lang }} -------------------------------------------------------------------------------- /test/stubs-img-transform/ignored.md: -------------------------------------------------------------------------------- 1 | it’s a possum -------------------------------------------------------------------------------- /test/stubs-img-transform/missing-alt.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/stubs-img-transform/multiple.md: -------------------------------------------------------------------------------- 1 | it’s a possum 2 | it’s a possum -------------------------------------------------------------------------------- /test/stubs-img-transform/possum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-img-transform/possum.png -------------------------------------------------------------------------------- /test/stubs-img-transform/single.md: -------------------------------------------------------------------------------- 1 | it’s a possum -------------------------------------------------------------------------------- /test/stubs-incremental/layout-chain/_includes/base.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: parent.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-incremental/layout-chain/_includes/parent.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-incremental/layout-chain/_includes/parent.njk -------------------------------------------------------------------------------- /test/stubs-incremental/layout-chain/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base.njk 3 | --- -------------------------------------------------------------------------------- /test/stubs-layout-cache/_includes/layout.liquid: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/stubs-layout-cache/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/stubs-layout-cache/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "layout.liquid" 3 | --- 4 | Content -------------------------------------------------------------------------------- /test/stubs-layout-cache/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: "layout.njk" 3 | --- 4 | Content -------------------------------------------------------------------------------- /test/stubs-layouts-event/_includes/first.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: second 3 | --- 4 | {{ content }} -------------------------------------------------------------------------------- /test/stubs-layouts-event/_includes/second.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: third.liquid 3 | --- 4 | {{ content }} -------------------------------------------------------------------------------- /test/stubs-layouts-event/_includes/third.liquid: -------------------------------------------------------------------------------- 1 | {{ content }} -------------------------------------------------------------------------------- /test/stubs-layouts-event/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: first 3 | --- 4 | -------------------------------------------------------------------------------- /test/stubs-njk-async/_includes/loop.njk: -------------------------------------------------------------------------------- 1 | included_{{item}}-{% genericshortcode item %} -------------------------------------------------------------------------------- /test/stubs-pagination-computed-quotes-njk/post.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: posts 3 | --- 4 | No -------------------------------------------------------------------------------- /test/stubs-pagination-computed-quotes-njk/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: "collections.posts" 4 | size: 1 5 | quotes: 6 | - The person that shared this is awesome 7 | eleventyComputed: 8 | quote: "{{ quotes | selectRandomFromArray }}" 9 | --- 10 | {{ quote }} -------------------------------------------------------------------------------- /test/stubs-pagination-computed-quotes/post.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | tags: posts 3 | --- 4 | No -------------------------------------------------------------------------------- /test/stubs-pagination-computed-quotes/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: "collections.posts" 4 | size: 1 5 | quotes: 6 | - The person that shared this is awesome 7 | eleventyComputed: 8 | quote: "{{ quotes | selectRandomFromArray }}" 9 | --- 10 | {{ quote }} -------------------------------------------------------------------------------- /test/stubs-pathtourl/css.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: output.css 3 | --- -------------------------------------------------------------------------------- /test/stubs-pathtourl/filter.njk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | Test 14 | Anchor 15 | Anchor 16 | Anchor 17 | Search 18 | Search 19 | 20 | -------------------------------------------------------------------------------- /test/stubs-pathtourl/tmpl.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-pathtourl/tmpl.njk -------------------------------------------------------------------------------- /test/stubs-pathtourl/transform.njk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | Test 14 | Anchor 15 | Anchor 16 | Anchor 17 | Search 18 | Search 19 | 20 | -------------------------------------------------------------------------------- /test/stubs-render-plugin-vue-nested/_includes/include.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /test/stubs-render-plugin-vue/_includes/include.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /test/stubs-render-plugin-vue/vue-sfc.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderFile "./test/stubs-render-plugin-vue/_includes/include.vue" argData %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/11tyjs-file-override.njk: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderFile "./test/stubs-render-plugin/_includes/include-js.txt", argData, "11ty.js" %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/11tyjs-file.njk: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderFile "./test/stubs-render-plugin/_includes/include.11ty.cjs", argData %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/11tyjs.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderTemplate "11ty.js" argData %} 8 | module.exports = "TESTING"; 9 | {% endrenderTemplate %} 10 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/_includes/frontmatter.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | test: frontmatterString 3 | --- 4 | {{ test }} -------------------------------------------------------------------------------- /test/stubs-render-plugin/_includes/include-js.txt: -------------------------------------------------------------------------------- 1 | module.exports = "TESTING"; 2 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/_includes/include.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "TESTING"; 2 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/_includes/include.liquid: -------------------------------------------------------------------------------- 1 | TESTING 2 | {% renderTemplate "liquid" %} 3 | TESTING IN LIQUID 4 | {% assign liquidassign = 999 %} 5 | * {{ liquidassign }} 6 | {% endrenderTemplate %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/_includes/include.njk: -------------------------------------------------------------------------------- 1 | TESTING 2 | {% renderTemplate "liquid" %} 3 | TESTING IN LIQUID 4 | {% assign liquidassign = 999 %} 5 | * {{ liquidassign }} 6 | {% endrenderTemplate %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/bad-data.njk: -------------------------------------------------------------------------------- 1 | {% renderTemplate "liquid", "string" %} 2 | {{ _ }} 3 | {% endrenderTemplate %} 4 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/capture-liquid.njk: -------------------------------------------------------------------------------- 1 | --- 2 | argData: 3 | num: 2 4 | --- 5 | {% setAsync "liquidOutput" %} 6 | {% renderTemplate "liquid", argData %} 7 | {% assign liquidVar = num | times: 2 %} 8 | {{ liquidVar }} 9 | {% endrenderTemplate %} 10 | {% endsetAsync %} 11 | {{ liquidOutput }} -------------------------------------------------------------------------------- /test/stubs-render-plugin/capture-njk.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | argData: 3 | num: 2 4 | --- 5 | {% capture nunjucksOutput %} 6 | {% renderTemplate "njk", argData %} 7 | {% set njkVar = num * 2 %} 8 | {{ njkVar }} 9 | {% endrenderTemplate %} 10 | {% endcapture %} 11 | {{ nunjucksOutput }} -------------------------------------------------------------------------------- /test/stubs-render-plugin/data-no-templatelang.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | argData: 3 | name: Bruno 4 | --- 5 | {% renderTemplate argData %} 6 | # Hello {{ name }} 7 | * Testing 8 | {% endrenderTemplate %} 9 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/false.liquid: -------------------------------------------------------------------------------- 1 | {% renderTemplate %} 2 | {% assign name = "Bruno" %} 3 | # Hello {{ name }} 4 | * Testing 5 | {% endrenderTemplate %} 6 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-direct.njk: -------------------------------------------------------------------------------- 1 | {%- set nunjucksVar = 69 -%} 2 | {{ hi }} 3 | {{ nunjucksVar }} 4 | {{ "who" | testing }} 5 | {% renderTemplate "liquid", argData %} 6 | {% assign liquidVar = 138 %} 7 | * {{ hi }} test test {{ bye }} {{ liquidVar }} 8 | {% endrenderTemplate %} 9 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-eleventy.njk: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {% renderTemplate "liquid" %} 4 | {{ eleventy.version }} 5 | {% endrenderTemplate %} 6 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-global.njk: -------------------------------------------------------------------------------- 1 | --- 2 | hi: globalHi 3 | --- 4 | {% renderTemplate "liquid" %} 5 | {{ hi }}123 6 | {% endrenderTemplate %} 7 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-md.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Tmpl { 2 | data() { 3 | return { 4 | argData: { 5 | hi: "javascriptHi", 6 | bye: "javascriptBye", 7 | }, 8 | }; 9 | } 10 | 11 | async render(data) { 12 | return this.renderTemplate( 13 | ` 14 | # Markdown 15 | {% assign t1 = 2 %} 16 | * {{ t1 }} 17 | `, 18 | "liquid,md", 19 | data.argData 20 | ); 21 | } 22 | } 23 | module.exports = Tmpl; 24 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-md.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderTemplate "liquid,md" argData %} 8 | # Hello {{ hi }} 9 | * Testing 10 | {% endrenderTemplate %} 11 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-page.liquid: -------------------------------------------------------------------------------- 1 | {% renderTemplate "liquid" %} 2 | {{ page.url }} 3 | {% endrenderTemplate %} 4 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid-page.njk: -------------------------------------------------------------------------------- 1 | {% renderTemplate "liquid" %} 2 | {{ page.url }} 3 | {% endrenderTemplate %} 4 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/liquid.njk: -------------------------------------------------------------------------------- 1 | --- 2 | # Nunjucks 3 | hi: nunjucksHi 4 | argData: 5 | hi: liquidHi 6 | bye: liquidBye 7 | --- 8 | {%- set nunjucksVar = 69 -%} 9 | {{ hi }} 10 | {{ nunjucksVar }} 11 | {% renderTemplate "liquid", argData %} 12 | {% assign liquidVar = 138 %} 13 | * {{ hi }} test test {{ bye }} {{ liquidVar }} 14 | {% endrenderTemplate %} 15 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/md.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderTemplate "md" argData %} 8 | # Hello {{ hi }} 9 | * Testing 10 | {% endrenderTemplate %} -------------------------------------------------------------------------------- /test/stubs-render-plugin/njk-eleventy.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {% renderTemplate "njk" %} 4 | {{ eleventy.version }} 5 | {% endrenderTemplate %} 6 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/njk-file-not-exist.liquid: -------------------------------------------------------------------------------- 1 | {% renderFile "./test/stubs-render-plugin/THIS_DOES_NOT_EXIST.njk" %} 2 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/njk-file.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderFile "./test/stubs-render-plugin/_includes/include.njk" argData %} 8 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/njk-file.njk: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderFile "./test/stubs-render-plugin/_includes/include.liquid", argData %} 8 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/njk-page.liquid: -------------------------------------------------------------------------------- 1 | {% renderTemplate "njk" %} 2 | {{ page.url }} 3 | {% endrenderTemplate %} 4 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/nunjucks-frontmatter.njk: -------------------------------------------------------------------------------- 1 | --- 2 | hi: "{% test %}" 3 | --- 4 | {{ hi | renderContent("njk") }} 5 | {# {% renderTemplate "njk", hi %}{{ _ }}{% endrenderTemplate %} #} 6 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/nunjucks-global.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: globalHi 3 | --- 4 | {% renderTemplate "njk" %} 5 | {{ hi }} 6 | {% endrenderTemplate %} 7 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/nunjucks.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Tmpl { 2 | data() { 3 | return { 4 | argData: { 5 | hi: "javascriptHi", 6 | bye: "javascriptBye", 7 | }, 8 | }; 9 | } 10 | 11 | async render(data) { 12 | return this.renderTemplate( 13 | ` 14 | * {{ hi | reverse }} 15 | `, 16 | "njk", 17 | data.argData 18 | ); 19 | } 20 | } 21 | module.exports = Tmpl; 22 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/nunjucks.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderTemplate "njk" argData %} 8 | {% set bye = "abldskjfl" %} 9 | * {{ hi | reverse }} 10 | * {{ bye | reverse }} 11 | {% endrenderTemplate %} 12 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/using-frontmatter.liquid: -------------------------------------------------------------------------------- 1 | {% renderFile "./test/stubs-render-plugin/_includes/frontmatter.liquid" %} 2 | -------------------------------------------------------------------------------- /test/stubs-render-plugin/vue.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | hi: value 3 | argData: 4 | hi: liquidHi 5 | bye: liquidBye 6 | --- 7 | {% renderTemplate "vue" argData %} 8 |
9 | HELLO WE ARE VUEING

10 |
11 | {% endrenderTemplate %} -------------------------------------------------------------------------------- /test/stubs-virtual-nowrite/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-virtual-nowrite/.gitkeep -------------------------------------------------------------------------------- /test/stubs-virtual/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs-virtual/.gitkeep -------------------------------------------------------------------------------- /test/stubs/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ./ignoredFolder/ignored.md 3 | # This is a comment 4 | -------------------------------------------------------------------------------- /test/stubs/2016-02-01-permalinkdate.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: Date Permalink 3 | permalink: "/{{ page.date | date: '%Y/%m/%d' }}/index.html" 4 | --- 5 | Date Permalinks -------------------------------------------------------------------------------- /test/stubs/_data/globalData.json: -------------------------------------------------------------------------------- 1 | { 2 | "datakey1": "datavalue1", 3 | "datakey2": "{{pkg.name}}" 4 | } 5 | -------------------------------------------------------------------------------- /test/stubs/_data/globalData2.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | datakeyfromjs: "howdy" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/_data/globalDataFn.js: -------------------------------------------------------------------------------- 1 | import dep1 from "../deps/dep1.cjs"; 2 | 3 | export default function () { 4 | return { 5 | datakeyfromjsfn: "howdy", 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /test/stubs/_data/globalDataFnCJS.cjs: -------------------------------------------------------------------------------- 1 | const dep1 = require("../deps/dep1.cjs"); 2 | 3 | module.exports = function() { 4 | return { 5 | datakeyfromcjsfn: "common-cjs-howdy" 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs/_data/subdir/testDataSubdir.json: -------------------------------------------------------------------------------- 1 | { 2 | "subdirkey": "subdirvalue" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs/_data/testData.json: -------------------------------------------------------------------------------- 1 | { 2 | "testdatakey1": "testdatavalue1" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs/_data/testDataLiquid.json: -------------------------------------------------------------------------------- 1 | { 2 | "datakey1": "datavalue1", 3 | "datakey2": "{{ pkg.name }}" 4 | } 5 | -------------------------------------------------------------------------------- /test/stubs/_includes/base.njk: -------------------------------------------------------------------------------- 1 |

{% block content %}This is a parent.{% endblock %}

-------------------------------------------------------------------------------- /test/stubs/_includes/custom-filter.liquid: -------------------------------------------------------------------------------- 1 | {{ name | makeItFoo }} -------------------------------------------------------------------------------- /test/stubs/_includes/default.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_includes/default.liquid -------------------------------------------------------------------------------- /test/stubs/_includes/defaultLayout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | keylayout: valuelayout 3 | postRank: 4 4 | daysPosted: 152 5 | yearsPosted: 0.4 6 | --- 7 | 8 |
9 | {{ content }} 10 |
11 | -------------------------------------------------------------------------------- /test/stubs/_includes/defaultLayoutLayoutContent.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | keylayout: valuelayout 3 | postRank: 4 4 | daysPosted: 152 5 | yearsPosted: 0.4 6 | --- 7 | 8 |
9 | {{ content }} 10 |
-------------------------------------------------------------------------------- /test/stubs/_includes/imports.njk: -------------------------------------------------------------------------------- 1 | {% macro label(text) %}{% endmacro %} -------------------------------------------------------------------------------- /test/stubs/_includes/included-data.html: -------------------------------------------------------------------------------- 1 | This is an include. {{ myVariable }} 2 | -------------------------------------------------------------------------------- /test/stubs/_includes/included-relative.njk: -------------------------------------------------------------------------------- 1 | akdlsjafkljdskl -------------------------------------------------------------------------------- /test/stubs/_includes/included.html: -------------------------------------------------------------------------------- 1 | This is an include. -------------------------------------------------------------------------------- /test/stubs/_includes/included.liquid: -------------------------------------------------------------------------------- 1 | This is an include. -------------------------------------------------------------------------------- /test/stubs/_includes/included.njk: -------------------------------------------------------------------------------- 1 | This is an include. -------------------------------------------------------------------------------- /test/stubs/_includes/included.nunj: -------------------------------------------------------------------------------- 1 | Nunjabusiness -------------------------------------------------------------------------------- /test/stubs/_includes/layout-a.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout-b 3 | key1: value1-a 4 | upstream: value2-a 5 | --- 6 | 7 |
8 | {{ content }} 9 |
10 | -------------------------------------------------------------------------------- /test/stubs/_includes/layout-b.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1-b 3 | upstream: value2-b 4 | daysPosted: 154 5 | --- 6 | 7 |
8 | {{ content }} 9 |
10 | -------------------------------------------------------------------------------- /test/stubs/_includes/layoutLiquid.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | keylayout: valuelayout 3 | --- 4 | 5 |
6 | {{ content }} 7 |
8 | -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/div-wrapper-layout.njk: -------------------------------------------------------------------------------- 1 |
{{ content }}
-------------------------------------------------------------------------------- /test/stubs/_includes/layouts/engineOverrides.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layoutkey: layoutvalue 3 | --- 4 |
{{ content | safe }}
5 | -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/engineOverridesMd.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layoutkey: layoutvalue 3 | --- 4 | # Layout header 5 | 6 |
{{ content | safe }}
-------------------------------------------------------------------------------- /test/stubs/_includes/layouts/inasubdir.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_includes/layouts/inasubdir.njk -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/issue-115.liquid: -------------------------------------------------------------------------------- 1 | {% for foo in pagination.items -%} 2 | {{ foo.data.title }} 3 | {% endfor -%} 4 | {% for bar in collections.bars -%} 5 | {{ bar.data.title }} 6 | {% endfor -%} -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/layout-contentdump.njk: -------------------------------------------------------------------------------- 1 | --- 2 | inherits: a 3 | layout: layouts/layout-inherit-b.njk 4 | --- 5 | {{content | default("this is bad")}} {{inherits}} -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/layout-inherit-a.njk: -------------------------------------------------------------------------------- 1 | --- 2 | inherits: a 3 | layout: layouts/layout-inherit-b.njk 4 | --- 5 | {{content}} {{inherits}} -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/layout-inherit-b.njk: -------------------------------------------------------------------------------- 1 | --- 2 | inherits: b 3 | secondinherits: b 4 | layout: layouts/layout-inherit-c.njk 5 | --- 6 | {{ content | safe }} {{secondinherits}} -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/layout-inherit-c.njk: -------------------------------------------------------------------------------- 1 | --- 2 | inherits: c 3 | secondinherits: c 4 | thirdinherits: c 5 | --- 6 | {{ content | safe }} {{inherits}} {{thirdinherits}} -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/post.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_includes/layouts/post.liquid -------------------------------------------------------------------------------- /test/stubs/_includes/layouts/templateMapCollection.njk: -------------------------------------------------------------------------------- 1 | --- 2 | upstream: Inherited 3 | --- 4 | 5 | {{ content | safe }} -------------------------------------------------------------------------------- /test/stubs/_includes/multiple.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_includes/multiple.liquid -------------------------------------------------------------------------------- /test/stubs/_includes/multiple.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_includes/multiple.md -------------------------------------------------------------------------------- /test/stubs/_includes/mylocallayout.njk: -------------------------------------------------------------------------------- 1 |
{{ content | safe }}
2 | -------------------------------------------------------------------------------- /test/stubs/_includes/permalink-data-layout.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: "{{ page.fileSlug }}/index.html" 3 | --- 4 | Wrapper:{{ content | safe }} -------------------------------------------------------------------------------- /test/stubs/_includes/permalink-in-layout/layout-fileslug.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: test/{{ page.fileSlug }}/ 3 | --- 4 | {{ content }} -------------------------------------------------------------------------------- /test/stubs/_includes/permalink-in-layout/layout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: hello/index.html 3 | --- 4 | {{ content }} -------------------------------------------------------------------------------- /test/stubs/_includes/scopeleak.liquid: -------------------------------------------------------------------------------- 1 | {% assign test = 2 %}{{ test }} -------------------------------------------------------------------------------- /test/stubs/_includes/subfolder/included.html: -------------------------------------------------------------------------------- 1 | This is an include. -------------------------------------------------------------------------------- /test/stubs/_includes/subfolder/included.liquid: -------------------------------------------------------------------------------- 1 | This is an include. -------------------------------------------------------------------------------- /test/stubs/_includes/subfolder/included.nunj: -------------------------------------------------------------------------------- 1 | Nunjabusiness2 -------------------------------------------------------------------------------- /test/stubs/_includes/test.js: -------------------------------------------------------------------------------- 1 | /* THIS IS A COMMENT */ alert("Issue #398"); 2 | -------------------------------------------------------------------------------- /test/stubs/_layouts/layoutsdefault.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/_layouts/layoutsdefault.liquid -------------------------------------------------------------------------------- /test/stubs/add-extension/test.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/add-extension/test.njk -------------------------------------------------------------------------------- /test/stubs/add-extension/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/add-extension/test.txt -------------------------------------------------------------------------------- /test/stubs/broken-config.cjs: -------------------------------------------------------------------------------- 1 | const missingModule = require("this-is-a-module-that-does-not-exist"); 2 | 3 | module.exports = function(eleventyConfig) { 4 | eleventyConfig.addFilter("cssmin", function(code) { 5 | return missingModule(code); 6 | }); 7 | 8 | return {}; 9 | }; 10 | -------------------------------------------------------------------------------- /test/stubs/buffer.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = Buffer.from("

tést

"); 2 | -------------------------------------------------------------------------------- /test/stubs/cfg-directories-export-cjs/eleventy.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(eleventyConfig) { 2 | 3 | }; 4 | 5 | module.exports.config = { 6 | dir: { 7 | input: "src", 8 | includes: "myincludes2", 9 | data: "mydata2", 10 | output: "dist2" 11 | } 12 | } -------------------------------------------------------------------------------- /test/stubs/cfg-directories-export-cjs/src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/cfg-directories-export-cjs/src/.gitkeep -------------------------------------------------------------------------------- /test/stubs/cfg-directories-export/eleventy.config.js: -------------------------------------------------------------------------------- 1 | export default function(eleventyConfig) { 2 | 3 | }; 4 | 5 | export const config = { 6 | dir: { 7 | input: "src", 8 | includes: "myincludes", 9 | data: "mydata", 10 | output: "dist" 11 | } 12 | }; -------------------------------------------------------------------------------- /test/stubs/cfg-directories-export/src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/cfg-directories-export/src/.gitkeep -------------------------------------------------------------------------------- /test/stubs/class-async-data-fn.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | async data() { 3 | return new Promise((resolve, reject) => { 4 | setTimeout(function() { 5 | resolve({ 6 | name: "Ted" 7 | }); 8 | }, 50); 9 | }); 10 | } 11 | 12 | render({ name }) { 13 | return `

${name}

`; 14 | } 15 | } 16 | 17 | module.exports = Test; 18 | -------------------------------------------------------------------------------- /test/stubs/class-async-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | static returnsTed() { 3 | return "Ted"; 4 | } 5 | 6 | returnsBill() { 7 | return "Bill"; 8 | } 9 | 10 | async render({ name }) { 11 | return Promise.resolve( 12 | `

${this.upper(name)}${this.returnsBill()}${Test.returnsTed()}

` 13 | ); 14 | } 15 | } 16 | 17 | module.exports = Test; 18 | -------------------------------------------------------------------------------- /test/stubs/class-async.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | async render({ name }) { 3 | return Promise.resolve(`

${name}

`); 4 | } 5 | } 6 | 7 | module.exports = Test; 8 | -------------------------------------------------------------------------------- /test/stubs/class-buffer.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | returnsBill() { 3 | return "Bill"; 4 | } 5 | 6 | static returnsTed() { 7 | return "Ted"; 8 | } 9 | 10 | render({ name }) { 11 | return Buffer.from( 12 | `

${name}${this.returnsBill()}${Test.returnsTed()}

` 13 | ); 14 | } 15 | } 16 | 17 | module.exports = Test; 18 | -------------------------------------------------------------------------------- /test/stubs/class-data-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | name: "Ted" 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${this.upper(name)}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-data-fn-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | data() { 3 | return { 4 | name: "Ted" 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${this.upper(name)}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-data-fn-shorthand.11ty.cjs: -------------------------------------------------------------------------------- 1 | function Test() {} 2 | 3 | // this doesn’t return an object?? 🤡 4 | // Test.prototype.data = () => { name: "Ted" }; 5 | Test.prototype.data = () => { 6 | return { name: "Ted" }; 7 | }; 8 | Test.prototype.render = ({ name }) => `

${name}

`; 9 | 10 | /* 11 | Test.prototype.data = function() { 12 | return { name: "Ted" }; 13 | }; 14 | Test.prototype.render = function(data) { 15 | return `

${data.name}

`; 16 | } 17 | */ 18 | 19 | /* 20 | // this isn’t valid syntax?? 🤡 21 | class Test { 22 | data() => { 23 | name: "Ted" 24 | }; 25 | 26 | render({ name }) => `

${name}

`; 27 | } 28 | */ 29 | 30 | module.exports = Test; 31 | -------------------------------------------------------------------------------- /test/stubs/class-data-fn.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | data() { 3 | return { 4 | name: "Ted" 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${name}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink-async-fn.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | key: "value1", 5 | permalink: async function(data) { 6 | return new Promise((resolve, reject) => { 7 | setTimeout(function() { 8 | resolve(`/my-permalink/${data.key}/`); 9 | }, 100); 10 | }); 11 | } 12 | }; 13 | } 14 | 15 | render({ name }) { 16 | return `

${name}

`; 17 | } 18 | } 19 | 20 | module.exports = Test; 21 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink-buffer.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | permalink: Buffer.from("/my-permalink/") 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${name}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink-fn-buffer.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | key: "value1", 5 | permalink: data => Buffer.from(`/my-permalink/${data.key}/`) 6 | }; 7 | } 8 | 9 | render({ name }) { 10 | return `

${name}

`; 11 | } 12 | } 13 | 14 | module.exports = Test; 15 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink-fn-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | title: "My Super Cool Title", 5 | permalink: function({ title }) { 6 | return `/my-permalink/${this.slug(title)}/`; 7 | } 8 | }; 9 | } 10 | 11 | render({ name }) { 12 | return `

${name}

`; 13 | } 14 | } 15 | 16 | module.exports = Test; 17 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink-fn.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | key: "value1", 5 | permalink: data => `/my-permalink/${data.key}/` 6 | }; 7 | } 8 | 9 | render({ name }) { 10 | return `

${name}

`; 11 | } 12 | } 13 | 14 | module.exports = Test; 15 | -------------------------------------------------------------------------------- /test/stubs/class-data-permalink.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | permalink: "/my-permalink/" 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${name}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-data.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | get data() { 3 | return { 4 | name: "Ted" 5 | }; 6 | } 7 | 8 | render({ name }) { 9 | return `

${name}

`; 10 | } 11 | } 12 | 13 | module.exports = Test; 14 | -------------------------------------------------------------------------------- /test/stubs/class-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | static returnsTed() { 3 | return "Ted"; 4 | } 5 | 6 | returnsBill() { 7 | return "Bill"; 8 | } 9 | 10 | render({ name }) { 11 | return `

${this.upper( 12 | name 13 | )}${this.returnsBill()}${Test.returnsTed()}

`; 14 | } 15 | } 16 | 17 | module.exports = Test; 18 | -------------------------------------------------------------------------------- /test/stubs/class-fns-has-page.11ty.cjs: -------------------------------------------------------------------------------- 1 | class TestWithPage { 2 | get page() { 3 | return "this-is-my-page"; 4 | } 5 | 6 | render(data) { 7 | data.avaTest.is(this.page, "this-is-my-page"); 8 | data.avaTest.is(data.page.url, "/hi/"); 9 | } 10 | } 11 | 12 | module.exports = TestWithPage; 13 | -------------------------------------------------------------------------------- /test/stubs/class-fns.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | render({ avaTest }) { 3 | avaTest.truthy(this.url); 4 | avaTest.truthy(this.slug); 5 | avaTest.truthy(this.log); 6 | avaTest.truthy(this.getPreviousCollectionItem); 7 | avaTest.truthy(this.getNextCollectionItem); 8 | avaTest.truthy(this.page); 9 | } 10 | } 11 | 12 | module.exports = Test; 13 | -------------------------------------------------------------------------------- /test/stubs/class-norender.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | data() { 3 | return { 4 | name: "Ted" 5 | }; 6 | } 7 | } 8 | 9 | module.exports = Test; 10 | -------------------------------------------------------------------------------- /test/stubs/class-with-dep-upstream.js: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/class-with-dep.11ty.cjs: -------------------------------------------------------------------------------- 1 | const Dep = require("./class-with-dep-upstream.js"); 2 | 3 | class Test { 4 | returnsBill() { 5 | return "Bill"; 6 | } 7 | static returnsTed() { 8 | return "Ted"; 9 | } 10 | render({ name }) { 11 | return `

${name}${this.returnsBill()}${Test.returnsTed()}

`; 12 | } 13 | } 14 | 15 | module.exports = Test; -------------------------------------------------------------------------------- /test/stubs/class.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | returnsBill() { 3 | return "Bill"; 4 | } 5 | 6 | static returnsTed() { 7 | return "Ted"; 8 | } 9 | 10 | render({ name }) { 11 | return `

${name}${this.returnsBill()}${Test.returnsTed()}

`; 12 | } 13 | } 14 | 15 | module.exports = Test; 16 | -------------------------------------------------------------------------------- /test/stubs/classfields-data.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | data = { 3 | name: "Ted" 4 | }; 5 | 6 | render({ name }) { 7 | return `

${name}

`; 8 | } 9 | } 10 | 11 | module.exports = Test; 12 | -------------------------------------------------------------------------------- /test/stubs/cmd-help-processing/_data/test.js: -------------------------------------------------------------------------------- 1 | console.log("THIS SHOULD NOT LOG TO CONSOLE"); 2 | module.exports = []; 3 | -------------------------------------------------------------------------------- /test/stubs/collection-layout-wrap.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Layout Test 3 | layout: layouts/div-wrapper-layout.njk 4 | --- 5 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/collection-layout/_includes/layout.liquid: -------------------------------------------------------------------------------- 1 | Layout 2 | 3 | {{ content }} 4 | 5 | All {{ collections.all | size }} templates 6 | Layout {{ collections.dog | size }} dog -------------------------------------------------------------------------------- /test/stubs/collection-layout/dog1.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - dog 4 | --- -------------------------------------------------------------------------------- /test/stubs/collection-layout/template.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.liquid 3 | --- 4 | Template -------------------------------------------------------------------------------- /test/stubs/collection-slug/dog1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - dog 4 | --- -------------------------------------------------------------------------------- /test/stubs/collection-slug/template.njk: -------------------------------------------------------------------------------- 1 | fileSlug:{% for post in collections.dog %}{{ post.url }}:{{ post.fileSlug }}{% endfor %} -------------------------------------------------------------------------------- /test/stubs/collection-template/_includes/layout.liquid: -------------------------------------------------------------------------------- 1 | Layout 2 | 3 | {{ content }} -------------------------------------------------------------------------------- /test/stubs/collection-template/dog1.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - dog 4 | --- -------------------------------------------------------------------------------- /test/stubs/collection-template/template.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.liquid 3 | --- 4 | Template 5 | 6 | All {{ collections.all | size }} templates 7 | Template {{ collections.dog | size }} dog -------------------------------------------------------------------------------- /test/stubs/collection/test1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | --- 7 | 8 | # Test 1 9 | -------------------------------------------------------------------------------- /test/stubs/collection/test10.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - office 6 | eleventyExcludeFromCollections: 7 | - post 8 | --- 9 | 10 | # Test 1 11 | -------------------------------------------------------------------------------- /test/stubs/collection/test2.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: cat 3 | --- 4 | 5 | # Test 2 6 | -------------------------------------------------------------------------------- /test/stubs/collection/test3.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | - cat 5 | --- 6 | 7 | # Test 3 8 | -------------------------------------------------------------------------------- /test/stubs/collection/test4.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: 1983-01-01 3 | --- 4 | 5 | # Test 3 6 | -------------------------------------------------------------------------------- /test/stubs/collection/test5.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: 2038-01-01 3 | --- 4 | 5 | # Test 3 6 | -------------------------------------------------------------------------------- /test/stubs/collection/test6.html: -------------------------------------------------------------------------------- 1 | # Test 6 2 | -------------------------------------------------------------------------------- /test/stubs/collection/test7.njk: -------------------------------------------------------------------------------- 1 | # Test 7 -------------------------------------------------------------------------------- /test/stubs/collection/test8.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - office 6 | eleventyExcludeFromCollections: true 7 | --- 8 | 9 | # Test 1 10 | -------------------------------------------------------------------------------- /test/stubs/collection/test9.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - office 6 | eleventyExcludeFromCollections: post 7 | --- 8 | 9 | # Test 1 10 | -------------------------------------------------------------------------------- /test/stubs/collection2/test1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | date: 2009-01-01 7 | --- 8 | 9 | # Test 1 10 | -------------------------------------------------------------------------------- /test/stubs/collection2/test2.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | - cat 5 | date: 2010-01-01 6 | --- 7 | 8 | # Test 2 9 | -------------------------------------------------------------------------------- /test/stubs/component-async/component.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = async function() { 2 | return new Promise(resolve => { 3 | setTimeout(function() { 4 | resolve({ 5 | localdatakeyfromcjs: "common-js-howdydoody" 6 | }); 7 | }, 1); 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /test/stubs/component-async/component.11tydata.js: -------------------------------------------------------------------------------- 1 | export default async function () { 2 | return new Promise((resolve) => { 3 | setTimeout(function () { 4 | resolve({ 5 | localdatakeyfromjs: "howdydoody", 6 | }); 7 | }, 1); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /test/stubs/component-async/component.njk: -------------------------------------------------------------------------------- 1 | {{localdatakey1}} -------------------------------------------------------------------------------- /test/stubs/component/component.11tydata.cjs: -------------------------------------------------------------------------------- 1 | const dep2 = require("../deps/dep2.cjs"); 2 | 3 | module.exports = { 4 | localdatakeyfromcjs: "common-js-howdydoody" 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/component/component.11tydata.js: -------------------------------------------------------------------------------- 1 | import dep2 from "../deps/dep2.cjs"; 2 | 3 | export default { 4 | localdatakeyfromjs: "howdydoody", 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/component/component.11tydata.json: -------------------------------------------------------------------------------- 1 | { 2 | "localdatakeyfromjs": "this_is_overridden", 3 | "localdatakeyfromcjs": "this_is_overridden", 4 | "localdatakeyfromjs2": "howdy2" 5 | } 6 | -------------------------------------------------------------------------------- /test/stubs/component/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "localdatakey1": "localdatavalue1", 3 | "localdatakeyfromjs": "this_is_also_overridden" 4 | } 5 | -------------------------------------------------------------------------------- /test/stubs/component/component.njk: -------------------------------------------------------------------------------- 1 | {{localdatakey1}} -------------------------------------------------------------------------------- /test/stubs/config-deps-upstream.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/config-deps.cjs: -------------------------------------------------------------------------------- 1 | const pretty = require("pretty"); 2 | const Dep = require("./config-deps-upstream.cjs"); 3 | 4 | module.exports = function(config) { 5 | return {}; 6 | }; 7 | -------------------------------------------------------------------------------- /test/stubs/config-empty-pathprefix.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | return { 3 | pathPrefix: "", 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/config-promise.js: -------------------------------------------------------------------------------- 1 | module.exports = async function() { 2 | return { 3 | layouts: "promise" 4 | }; 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/custom-extension-no-permalink.txt: -------------------------------------------------------------------------------- 1 | Sample content -------------------------------------------------------------------------------- /test/stubs/custom-extension.txt: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: custom-extension.lit 3 | --- 4 | Sample content -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-excerpt-comment.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt. 5 | 6 | This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-newline1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt.--- 5 | This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-newline2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt.---This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-newline3.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt. 5 | ---This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-nonewline.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt. 5 | ---This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template-toml.njk: -------------------------------------------------------------------------------- 1 | ---toml 2 | front = "hello" 3 | --- 4 | This is content. -------------------------------------------------------------------------------- /test/stubs/custom-frontmatter/template.njk: -------------------------------------------------------------------------------- 1 | --- 2 | front: hello 3 | --- 4 | This is an excerpt. 5 | --- 6 | This is content. -------------------------------------------------------------------------------- /test/stubs/data-cascade/template.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parent: { 3 | child: 2, 4 | datafile: true, 5 | }, 6 | datafile: true, 7 | tags: ["tagC", "tagD", "tagD"], 8 | }; 9 | -------------------------------------------------------------------------------- /test/stubs/data-cascade/template.njk: -------------------------------------------------------------------------------- 1 | --- 2 | parent: 3 | child: -2 4 | frontmatter: true 5 | frontmatter: true 6 | tags: 7 | - tagA 8 | - tagB 9 | --- -------------------------------------------------------------------------------- /test/stubs/datafiledoesnotexist/template.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/datafiledoesnotexist/template.njk -------------------------------------------------------------------------------- /test/stubs/dates/2018-01-01-file5.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | --- 4 | -------------------------------------------------------------------------------- /test/stubs/dates/2019-01-01-folder/2020-01-01-file.md: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | -------------------------------------------------------------------------------- /test/stubs/dates/file1.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | --- 4 | 5 | Assume file created time. 6 | -------------------------------------------------------------------------------- /test/stubs/dates/file2.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | date: "2016-01-01" 4 | --- 5 | -------------------------------------------------------------------------------- /test/stubs/dates/file2b.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | date: 2016-01-01 4 | --- 5 | -------------------------------------------------------------------------------- /test/stubs/dates/file3.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | date: Last Modified 4 | --- 5 | -------------------------------------------------------------------------------- /test/stubs/dates/file4.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: dateTestTag 3 | date: Created 4 | --- 5 | -------------------------------------------------------------------------------- /test/stubs/default-class-export-and-others.11ty.js: -------------------------------------------------------------------------------- 1 | export default class IndexPage { 2 | render(data) { 3 | const name = world(); 4 | return `
hello
`; 5 | } 6 | } 7 | 8 | export function world() { 9 | return "World"; 10 | } -------------------------------------------------------------------------------- /test/stubs/default-export-and-others.11ty.js: -------------------------------------------------------------------------------- 1 | export const foo = "test"; 2 | 3 | // render 4 | export default () => "

hello

"; -------------------------------------------------------------------------------- /test/stubs/default-frontmatter.txt: -------------------------------------------------------------------------------- 1 | --- 2 | frontmatter: 1 3 | --- 4 | hi -------------------------------------------------------------------------------- /test/stubs/default-function-export-and-named-data.11ty.cjs: -------------------------------------------------------------------------------- 1 | // render 2 | module.exports = (data) => `

${data.name} World

`; 3 | module.exports.data = function() { 4 | return { name: "Hello" } 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/default-function-export-and-named-data.11ty.js: -------------------------------------------------------------------------------- 1 | export function data() { 2 | return { name: "Hello" } 3 | }; 4 | 5 | // render 6 | export default (data) => `

${data.name} World

`; -------------------------------------------------------------------------------- /test/stubs/default-no-liquid.md: -------------------------------------------------------------------------------- 1 | hi 2 | -------------------------------------------------------------------------------- /test/stubs/default.liquid: -------------------------------------------------------------------------------- 1 | {{ "hi" }} -------------------------------------------------------------------------------- /test/stubs/default.md: -------------------------------------------------------------------------------- 1 | {{ "hi" }} 2 | -------------------------------------------------------------------------------- /test/stubs/dependencies/dep1.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/dependencies/dep2.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/dependencies/two-deps.11ty.cjs: -------------------------------------------------------------------------------- 1 | const dep1 = require("./dep1.cjs"); 2 | const dep2 = require("./dep2.cjs"); 3 | 4 | module.exports = ""; 5 | -------------------------------------------------------------------------------- /test/stubs/deps/dep1.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/deps/dep2.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function() {}; 2 | -------------------------------------------------------------------------------- /test/stubs/dynamic-permalink/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: "/{{justastring}}/" 3 | dynamicPermalink: false 4 | --- -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/first.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | key2: value2-{{ key1 }}.css 5 | --- 6 | hi:{{ key2 }} 7 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/override-reuse.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | key1: "over({{key1}})ride" 5 | --- 6 | hi:{{ key1 }} 7 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/override.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | key1: override 5 | --- 6 | hi:{{ key1 }} 7 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/permalink-simple.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | permalink: "haha-{{key1}}.html" 5 | --- 6 | hi:{{ key2 }} -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/permalink-slug.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: "This is a string" 3 | eleventyComputed: 4 | permalink: "haha-{{key1 | slug}}.html" 5 | --- -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/permalink.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | permalink: "haha-{{key2}}.html" 5 | key2: "{{key1}}" 6 | dependsOnPage: "depends:{{page.url}}" 7 | nested: 8 | key3: "{{key1}}" 9 | key4: "depends on computed {{key2}}" 10 | --- 11 | hi:{{ key2 }} 12 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/second.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | key1: "value1", 4 | eleventyComputed: { 5 | key3: function(data) { 6 | return `value3-${data.key2}`; 7 | }, 8 | key2: function(data) { 9 | return `value2-${data.key1}.css`; 10 | } 11 | } 12 | } 13 | --- 14 | hi:{{ key2 }} 15 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/third.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | key1: "value1", 4 | eleventyComputed: { 5 | key1: function(data) { 6 | return `value2-${data.key1}`; 7 | } 8 | } 9 | } 10 | --- 11 | hi:{{ key1 }} 12 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/true.njk: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | eleventyComputed: 4 | key2: true 5 | key3: false 6 | key4: 324 7 | --- 8 | -------------------------------------------------------------------------------- /test/stubs/eleventyComputed/use-global-data.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | eleventyComputed: { 4 | image: data => { 5 | return data.globalData.datakey1; 6 | } 7 | } 8 | } 9 | --- 10 | Issue #1043 -------------------------------------------------------------------------------- /test/stubs/eleventyExcludeFromCollections.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | eleventyExcludeFromCollections: true 4 | tags: 5 | - post 6 | - dog 7 | --- 8 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/eleventyExcludeFromCollectionsPermalinkFalse.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | eleventyExcludeFromCollections: true 4 | permalink: false 5 | tags: 6 | - post 7 | - dog 8 | --- 9 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/engine-singletons/first.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/engine-singletons/first.njk -------------------------------------------------------------------------------- /test/stubs/engine-singletons/second.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/engine-singletons/second.njk -------------------------------------------------------------------------------- /test/stubs/exitCode/failure.njk: -------------------------------------------------------------------------------- 1 | {{ test() }} -------------------------------------------------------------------------------- /test/stubs/exitCode_globalData/_data/test.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | throw new Error("Testing"); 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/exitCode_globalData/test.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/exitCode_globalData/test.liquid -------------------------------------------------------------------------------- /test/stubs/exitCode_success/success.njk: -------------------------------------------------------------------------------- 1 | {{ "hi" }} -------------------------------------------------------------------------------- /test/stubs/exports-flatdata.11ty.cjs: -------------------------------------------------------------------------------- 1 | // This is invalid, data must be an object 2 | exports.data = "Ted"; 3 | 4 | exports.render = function(name) { 5 | return `

${JSON.stringify(name)}

`; 6 | }; 7 | -------------------------------------------------------------------------------- /test/stubs/fileslug.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return `

${data.page.fileSlug}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/firstdir/seconddir/component.njk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/firstdir/seconddir/component.njk -------------------------------------------------------------------------------- /test/stubs/formatTest.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | name: zach 3 | --- 4 |

{{name | capitalize}}

-------------------------------------------------------------------------------- /test/stubs/frontmatter-date/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | mydate: 2009-04-15T12:34:34+01:00 3 | --- 4 | {{ mydate | date: "%Y-%m-%d" }} -------------------------------------------------------------------------------- /test/stubs/frontmatter-date/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | mydate: 2009-04-15T01:34:34+01:00 3 | --- 4 | {{ mydate.toISOString() }} -------------------------------------------------------------------------------- /test/stubs/function-arrow.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = ({ name }) => `

${name}

`; 2 | -------------------------------------------------------------------------------- /test/stubs/function-async-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = async function({ name }) { 2 | return `

${await this.upper(name)}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/function-async.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = async function(data) { 2 | return new Promise((resolve, reject) => { 3 | setTimeout(function() { 4 | resolve(`

${data.name}

`); 5 | }, 100); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs/function-buffer.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return Buffer.from(`

${data.name}

`); 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/function-filter.11ty.cjs: -------------------------------------------------------------------------------- 1 | function myFunction({ name }) { 2 | return `

${this.upper(name)}${myFunction.staticMethod()}

`; 3 | } 4 | 5 | myFunction.staticMethod = function() { 6 | return "T9000"; 7 | }; 8 | 9 | module.exports = myFunction; 10 | -------------------------------------------------------------------------------- /test/stubs/function-fns.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function({ avaTest }) { 2 | avaTest.truthy(this.url); 3 | avaTest.truthy(this.slug); 4 | avaTest.truthy(this.log); 5 | avaTest.truthy(this.getPreviousCollectionItem); 6 | avaTest.truthy(this.getNextCollectionItem); 7 | avaTest.truthy(this.page); 8 | 9 | return "test"; 10 | }; 11 | -------------------------------------------------------------------------------- /test/stubs/function-markdown.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return `# ${data.name}`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/function-prototype.11ty.cjs: -------------------------------------------------------------------------------- 1 | function myFunction() {} 2 | 3 | myFunction.prototype.render = function({ name }) { 4 | return `

${this.upper( 5 | name 6 | )}${this.returnsBill()}${myFunction.staticMethod()}

`; 7 | }; 8 | 9 | myFunction.prototype.returnsBill = function() { 10 | return "Bill"; 11 | }; 12 | 13 | myFunction.staticMethod = function() { 14 | return "T9001"; 15 | }; 16 | 17 | module.exports = myFunction; 18 | -------------------------------------------------------------------------------- /test/stubs/function-throws-async.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = async function(data) { 2 | return `

${await this.upper(data.name)}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/function-throws.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return `

${this.upper(data.name)}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/function.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return `

${data.name}

`; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/glob-pages/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | --- 4 | 5 | About 6 | -------------------------------------------------------------------------------- /test/stubs/glob-pages/contact.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Contact" 3 | --- 4 | 5 | Contact 6 | -------------------------------------------------------------------------------- /test/stubs/glob-pages/home.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Home" 3 | --- 4 | 5 | Home 6 | -------------------------------------------------------------------------------- /test/stubs/global-dash-variable.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | is-it-tasty: Yes 3 | --- 4 | {{ is-it-tasty }} -------------------------------------------------------------------------------- /test/stubs/globby/_includes/include.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/globby/_includes/include.html -------------------------------------------------------------------------------- /test/stubs/globby/test.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/globby/test.html -------------------------------------------------------------------------------- /test/stubs/ignore-dedupe/.gitignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ignoredFolder -------------------------------------------------------------------------------- /test/stubs/ignore1/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignore2/.gitignore: -------------------------------------------------------------------------------- 1 | thisshouldnotexist12345 -------------------------------------------------------------------------------- /test/stubs/ignore2/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignore3/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ./ignoredFolder/ignored.md 3 | # This is a comment 4 | -------------------------------------------------------------------------------- /test/stubs/ignore3/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignore4/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ./ignoredFolder/ignored.md 3 | # This is a comment 4 | -------------------------------------------------------------------------------- /test/stubs/ignore4/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignore5/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/ignore5/.gitignore -------------------------------------------------------------------------------- /test/stubs/ignore5/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignore6/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ./ignoredFolder/ignored.md 3 | # This is a comment 4 | -------------------------------------------------------------------------------- /test/stubs/ignore6/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/ignore6/.gitignore -------------------------------------------------------------------------------- /test/stubs/ignore6/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- 1 | # This should be ignored 2 | -------------------------------------------------------------------------------- /test/stubs/ignorelocalroot/.eleventyignore: -------------------------------------------------------------------------------- 1 | test.md -------------------------------------------------------------------------------- /test/stubs/ignorelocalrootgitignore/.eleventyignore: -------------------------------------------------------------------------------- 1 | test.md -------------------------------------------------------------------------------- /test/stubs/ignorelocalrootgitignore/.gitignore: -------------------------------------------------------------------------------- 1 | thisshouldnotexist12345 -------------------------------------------------------------------------------- /test/stubs/img/stub.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/stubs/included.liquid: -------------------------------------------------------------------------------- 1 | This is not in the includes dir. -------------------------------------------------------------------------------- /test/stubs/includer.liquid: -------------------------------------------------------------------------------- 1 |

{% include 'included' %}

2 | -------------------------------------------------------------------------------- /test/stubs/includesemptystring.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/includesemptystring.liquid -------------------------------------------------------------------------------- /test/stubs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is an html template. 4 | 5 | -------------------------------------------------------------------------------- /test/stubs/index.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/index.liquid -------------------------------------------------------------------------------- /test/stubs/issue-115/index-with-layout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/issue-115.liquid 3 | title: My index page 4 | pagination: 5 | data: collections.foos 6 | size: 12 7 | --- 8 | -------------------------------------------------------------------------------- /test/stubs/issue-115/index.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: My index page 3 | pagination: 4 | data: collections.foos 5 | size: 12 6 | --- 7 | {% for foo in pagination.items -%} 8 | {{ foo.data.title }} 9 | {% endfor -%} 10 | {% for bar in collections.bars -%} 11 | {{ bar.data.title }} 12 | {% endfor -%} -------------------------------------------------------------------------------- /test/stubs/issue-115/template-bars.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: This page is bars 3 | tags: 4 | - bars 5 | --- 6 | Bars -------------------------------------------------------------------------------- /test/stubs/issue-115/template-foos.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: This page is foos 3 | tags: 4 | - foos 5 | --- 6 | Foos. -------------------------------------------------------------------------------- /test/stubs/issue-135/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "articles": 3 | [ 4 | { 5 | "title": "Do you even paginate bro?", 6 | "author": "Bill Ted", 7 | "publish_date": "2018-06-22", 8 | "tags": [ 9 | "post" 10 | ], 11 | "image": "/url/thing", 12 | "teaser": "Teaser copy", 13 | "body": "

Raw HTML

" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/stubs/issue-135/template.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: articles 4 | size: 1 5 | alias: article 6 | permalink: blog/{{ article.title | slug }}/index.html 7 | --- 8 | {{ article.body | safe }} -------------------------------------------------------------------------------- /test/stubs/issue-522/excluded.md: -------------------------------------------------------------------------------- 1 | --- 2 | eleventyExcludeFromCollections: true 3 | --- 4 | 5 | # Test 6 | 7 | {{ collections.all[0].templateContent }} 8 | -------------------------------------------------------------------------------- /test/stubs/issue-522/template.md: -------------------------------------------------------------------------------- 1 | # Test 2 | -------------------------------------------------------------------------------- /test/stubs/issue-95/cat.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - cat 4 | --- 5 | 6 | # Test 8 7 | -------------------------------------------------------------------------------- /test/stubs/issue-95/notacat.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: notacat 3 | --- 4 | 5 | # Test 8 6 | -------------------------------------------------------------------------------- /test/stubs/layout-permalink-difflang/_includes/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: "/{{ page.fileSlug }}/" 3 | --- 4 | {{ content }} -------------------------------------------------------------------------------- /test/stubs/layout-permalink-difflang/test.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: test.njk 3 | templateEngineOverride: md 4 | --- 5 | 6 | # Title 7 | -------------------------------------------------------------------------------- /test/stubs/layoutsemptystring.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/layoutsemptystring.liquid -------------------------------------------------------------------------------- /test/stubs/local-data-tags/component.11tydata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | tags: "tag3" 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/local-data-tags/component.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - tag1 4 | - tag2 5 | --- 6 | {{localdatakey1}} -------------------------------------------------------------------------------- /test/stubs/multiple-ignores/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder 2 | ./ignoredFolder/ignored.md 3 | # This is a comment -------------------------------------------------------------------------------- /test/stubs/multiple-ignores/ignoredFolder/ignored.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/multiple-ignores/ignoredFolder/ignored.md -------------------------------------------------------------------------------- /test/stubs/multiple-ignores/subfolder/.eleventyignore: -------------------------------------------------------------------------------- 1 | ignoredFolder2 2 | ./ignoredFolder2/ignored2.md 3 | # This is a comment -------------------------------------------------------------------------------- /test/stubs/multiple-ignores/subfolder/ignoredFolder2/ignored2.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/multiple-ignores/subfolder/ignoredFolder2/ignored2.md -------------------------------------------------------------------------------- /test/stubs/multipleexports-promises.11ty.cjs: -------------------------------------------------------------------------------- 1 | exports.data = async function() { 2 | return new Promise((resolve, reject) => { 3 | setTimeout(function() { 4 | resolve({ name: "Ted" }); 5 | }, 100); 6 | }); 7 | }; 8 | 9 | exports.render = async function({ name }) { 10 | return new Promise((resolve, reject) => { 11 | setTimeout(function() { 12 | resolve(`

${name}

`); 13 | }, 100); 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /test/stubs/multipleexports.11ty.cjs: -------------------------------------------------------------------------------- 1 | exports.data = { 2 | name: "Ted" 3 | }; 4 | 5 | exports.render = function({ name }) { 6 | return `

${name}

`; 7 | }; 8 | -------------------------------------------------------------------------------- /test/stubs/njk-relative/dir/base.njk: -------------------------------------------------------------------------------- 1 |

{% block content %}This is a parent.{% endblock %}

-------------------------------------------------------------------------------- /test/stubs/njk-relative/dir/imports.njk: -------------------------------------------------------------------------------- 1 | {% macro label(text) %}{% endmacro %} -------------------------------------------------------------------------------- /test/stubs/njk-relative/dir/included.njk: -------------------------------------------------------------------------------- 1 | HELLO FROM THE OTHER SIDE. -------------------------------------------------------------------------------- /test/stubs/njk-relative/dir/unique-include-123.njk: -------------------------------------------------------------------------------- 1 | HELLO FROM THE OTHER SIDE. -------------------------------------------------------------------------------- /test/stubs/object-norender.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | data: { 3 | name: "Ted" 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/object.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | data: { 3 | name: "Ted" 4 | }, 5 | render: function({ name }) { 6 | return `

${name}

`; 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /test/stubs/oneinstance.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | constructor() { 3 | this.rand = Math.random(); 4 | } 5 | 6 | get data() { 7 | return { 8 | name: "Ted", 9 | rand: this.rand 10 | }; 11 | } 12 | 13 | render({ name }) { 14 | return `

${name}${this.rand}

`; 15 | } 16 | } 17 | 18 | module.exports = Test; 19 | -------------------------------------------------------------------------------- /test/stubs/overrides/layout.njk: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: liquid 3 | title: My Title 4 | layout: layouts/engineOverrides.njk 5 | --- 6 |

{{ title | size }}

-------------------------------------------------------------------------------- /test/stubs/overrides/layoutfalse.njk: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: false 3 | title: My Title 4 | layout: layouts/engineOverrides.njk 5 | --- 6 |

<%= title %>

-------------------------------------------------------------------------------- /test/stubs/overrides/page-templatesyntax.md: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk,md 3 | --- 4 | 5 | {{ page.templateSyntax }} 6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-bypass.md: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk 3 | title: My Title 4 | --- 5 | 6 | # {{ title }} 7 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-empty.html: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: 3 | title: My Title 4 | --- 5 |

{{ title }}

6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-empty.md: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: 3 | title: My Title 4 | --- 5 | 6 | # {{ title }} 7 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-error.njk: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: liquid,njk 3 | title: My Title 4 | --- 5 | # {{ title }} 6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-md.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: md 3 | --- 4 | # My Title 5 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-multiple.md: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk,md 3 | title: My Title 4 | --- 5 | 6 | # {{ title }} 7 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-multiple2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: liquid,md 3 | title: My Title 4 | --- 5 | # {{ title }} 6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test-njk.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk 3 | title: My Title 4 | --- 5 | {{ title }} 6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test.html: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk 3 | title: My Title 4 | --- 5 |

{{ title }}

6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | templateEngineOverride: njk 3 | title: My Title 4 | --- 5 | {{ title }} 6 | -------------------------------------------------------------------------------- /test/stubs/overrides/test.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: My Title 3 | layout: layouts/engineOverridesMd.njk 4 | --- 5 | 6 | # {{ title }} 7 | -------------------------------------------------------------------------------- /test/stubs/page-target-collections/paginateall.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.all 4 | size: 1 5 | alias: entry 6 | filter: 7 | - all 8 | addAllPagesToCollections: true 9 | --- 10 | INPUT PATH:{{ entry.inputPath }} -------------------------------------------------------------------------------- /test/stubs/page-target-collections/tagpages.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections 4 | size: 1 5 | alias: tag 6 | filter: 7 | - all 8 | --- 9 | 10 | {{ tag }} -------------------------------------------------------------------------------- /test/stubs/page-target-collections/tagpagesall.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections 4 | size: 1 5 | alias: tag 6 | filter: 7 | - all 8 | addAllPagesToCollections: true 9 | --- 10 | 11 | {{ tag }} -------------------------------------------------------------------------------- /test/stubs/paged-global-data-mutable/_data/testdata.cjs: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | key1: "item1", 4 | key2: "item2", 5 | }, 6 | { 7 | key3: "item3", 8 | key4: "item4", 9 | }, 10 | { 11 | key5: "item5", 12 | key6: "item6", 13 | }, 14 | ]; 15 | -------------------------------------------------------------------------------- /test/stubs/paged-global-data-mutable/paged-differing-data-set.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 1 5 | alias: item 6 | --- 7 | 1:{{ item.key1 }} 8 | 2:{{ item.key2 }} 9 | 3:{{ item.key3 }} 10 | 4:{{ item.key4 }} 11 | 5:{{ item.key5 }} 12 | 6:{{ item.key6 }} -------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/consumer.njk: -------------------------------------------------------------------------------- 1 | {% for item in collections.pagingtag %}{{ item.templateContent | safe }}{% endfor %} 2 | -------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/paged-downstream.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.pagingtag 4 | size: 1 5 | --- 6 |
    {% for item in pagination.items %}
  1. {{ item.url }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/paged-main.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.tag1 4 | size: 2 5 | addAllPagesToCollections: true 6 | tags: 7 | - pagingtag 8 | --- 9 |
    {% for item in pagination.items %}
  1. {{ item.url }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/test1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 1 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/test2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 2 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/cfg-collection-tag-cfg-collection/test3.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 3 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection-apply-to-all/consumer.njk: -------------------------------------------------------------------------------- 1 | {% for item in collections.pagingtag %}{{ item.templateContent | safe }}{% endfor %} 2 | -------------------------------------------------------------------------------- /test/stubs/paged/collection-apply-to-all/main.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.tag1 4 | size: 2 5 | addAllPagesToCollections: true 6 | tags: 7 | - pagingtag 8 | --- 9 |
    {% for item in pagination.items %}
  1. {{ item.url }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/collection-apply-to-all/test1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 1 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection-apply-to-all/test2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 2 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection-apply-to-all/test3.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 3 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection/consumer.njk: -------------------------------------------------------------------------------- 1 | {% for item in collections.pagingtag %}{{ item.templateContent | safe }}{% endfor %} 2 | -------------------------------------------------------------------------------- /test/stubs/paged/collection/main.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.tag1 4 | size: 2 5 | tags: 6 | - pagingtag 7 | --- 8 |
    {% for item in pagination.items %}
  1. {{ item.url }}
  2. {% endfor %}
9 | -------------------------------------------------------------------------------- /test/stubs/paged/collection/test1.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 1 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection/test2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 2 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/collection/test3.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 3 3 | tags: 4 | - tag1 5 | --- 6 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/paged/notpaged.njk: -------------------------------------------------------------------------------- 1 | --- 2 | testdata: 3 | sub: 4 | - item1 5 | - item2 6 | - item3 7 | - item4 8 | - item5 9 | - item6 10 | - item7 11 | - item8 12 | --- 13 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
14 | -------------------------------------------------------------------------------- /test/stubs/paged/paged-before-and-reverse.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | pagination: { 4 | data: "items", 5 | size: 1, 6 | reverse: true, 7 | before: function(data) { 8 | return data.slice(0, 2); 9 | } 10 | }, 11 | items: ["item1", "item2", "item3", "item4", "item5", "item6"] 12 | } 13 | --- 14 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/paged-before-filter.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | pagination: { 4 | data: "items", 5 | size: 1, 6 | before: function(data) { 7 | return data.slice(0, 2).reverse(); 8 | }, 9 | alias: "myalias" 10 | }, 11 | items: ["item1", "item2", "item3", "item4", "item5", "item6"] 12 | } 13 | --- 14 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/paged-before-metadata.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | keyword: "item3", 4 | pagination: { 5 | data: "items", 6 | size: 1, 7 | before: function(data, metadata) { 8 | return data.filter(el => el === metadata.keyword); 9 | } 10 | }, 11 | items: ["item1", "item2", "item3", "item4", "item5", "item6"] 12 | } 13 | --- 14 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
15 | -------------------------------------------------------------------------------- /test/stubs/paged/paged-before.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | pagination: { 4 | data: "items", 5 | size: 1, 6 | before: function(data) { 7 | return data.reverse(); 8 | }, 9 | alias: 'myalias' 10 | }, 11 | items: ["item1", "item2", "item3", "item4", "item5", "item6"] 12 | } 13 | --- 14 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/paged-empty-pageonemptydata.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 1 5 | generatePageOnEmptyData: true 6 | items: [] 7 | --- 8 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
9 | -------------------------------------------------------------------------------- /test/stubs/paged/paged-empty.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 1 5 | items: [] 6 | --- 7 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
8 | -------------------------------------------------------------------------------- /test/stubs/paged/paged.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": { 3 | "sub": [ 4 | "item1", 5 | "item2", 6 | "item3", 7 | "item4", 8 | "item5", 9 | "item6", 10 | "item7", 11 | "item8" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/stubs/paged/paged.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items.sub 4 | size: 5 5 | --- 6 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
7 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedalias.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 1 5 | alias: font.test 6 | items: 7 | - item1 8 | - item2 9 | permalink: pagedalias/{{ font.test }}/index.html 10 | --- 11 | {{ font.test }} 12 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedaliassize2.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 2 5 | alias: font.test 6 | items: 7 | - item1 8 | - item2 9 | - item3 10 | - item4 11 | permalink: pagedalias/{{ font.test[0] }}/index.html 12 | --- 13 | {{ font.test[0] }} 14 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedinlinedata-reverse.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | reverse: true 6 | testdata: 7 | - item1 8 | - item2 9 | - item3 10 | - item4 11 | - item5 12 | - item6 13 | - item7 14 | - item8 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
-------------------------------------------------------------------------------- /test/stubs/paged/pagedinlinedata.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | testdata: 6 | - item1 7 | - item2 8 | - item3 9 | - item4 10 | - item5 11 | - item6 12 | - item7 13 | - item8 14 | --- 15 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
16 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedobject.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | testdata: 6 | item1: itemvalue1 7 | item2: itemvalue2 8 | item3: itemvalue3 9 | item4: itemvalue4 10 | item5: itemvalue5 11 | item6: itemvalue6 12 | item7: itemvalue7 13 | item8: itemvalue8 14 | item9: itemvalue9 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
17 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedobjectfilterarray.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | filter: 6 | - item4 7 | testdata: 8 | item1: itemvalue1 9 | item2: itemvalue2 10 | item3: itemvalue3 11 | item4: itemvalue4 12 | item5: itemvalue5 13 | item6: itemvalue6 14 | item7: itemvalue7 15 | item8: itemvalue8 16 | item9: itemvalue9 17 | --- 18 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
19 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedobjectfilterstring.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | filter: item4 6 | testdata: 7 | item1: itemvalue1 8 | item2: itemvalue2 9 | item3: itemvalue3 10 | item4: itemvalue4 11 | item5: itemvalue5 12 | item6: itemvalue6 13 | item7: itemvalue7 14 | item8: itemvalue8 15 | item9: itemvalue9 16 | --- 17 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
18 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedobjectvalues.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | resolve: values 6 | testdata: 7 | item1: itemvalue1 8 | item2: itemvalue2 9 | item3: itemvalue3 10 | item4: itemvalue4 11 | item5: itemvalue5 12 | item6: itemvalue6 13 | item7: itemvalue7 14 | item8: itemvalue8 15 | item9: itemvalue9 16 | --- 17 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
18 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedpermalink.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 5 5 | items: 6 | - Slug CANDIDATE 7 | - item2 8 | - item3 9 | - item4 10 | - item5 11 | - another-slug CandiDate 12 | - item7 13 | - item8 14 | permalink: paged/{{ pagination.items[0] | slug }}/index.html 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
17 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedpermalinkif.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 2 5 | items: 6 | - item1 7 | - item2 8 | - item3 9 | - item4 10 | permalink: paged/{% if pagination.pageNumber > 0 %}page-{{ pagination.pageNumber }}/{% endif %}index.html 11 | --- 12 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
13 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedpermalinkif.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 2 5 | items: 6 | - item1 7 | - item2 8 | - item3 9 | - item4 10 | permalink: paged/{% if pagination.pageNumber > 0 %}page-{{ pagination.pageNumber }}/{% endif %}index.html 11 | --- 12 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
13 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedpermalinknumeric.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 5 5 | items: 6 | - Slug CANDIDATE 7 | - item2 8 | - item3 9 | - item4 10 | - item5 11 | - another-slug CandiDate 12 | - item7 13 | - item8 14 | permalink: paged/page-{{ pagination.pageNumber }}/index.html 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
17 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedpermalinknumericoneindexed.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: items 4 | size: 5 5 | items: 6 | - Slug CANDIDATE 7 | - item2 8 | - item3 9 | - item4 10 | - item5 11 | - another-slug CandiDate 12 | - item7 13 | - item8 14 | permalink: paged/page-{{ pagination.pageNumber + 1 }}/index.html 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
17 | -------------------------------------------------------------------------------- /test/stubs/paged/pagedresolve.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata.sub 4 | size: 4 5 | testdata: 6 | sub: 7 | - item1 8 | - item2 9 | - item3 10 | - item4 11 | - item5 12 | - item6 13 | - item7 14 | - item8 15 | --- 16 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
17 | -------------------------------------------------------------------------------- /test/stubs/pagedate.liquid: -------------------------------------------------------------------------------- 1 | {{ page.date }} -------------------------------------------------------------------------------- /test/stubs/pagedate.njk: -------------------------------------------------------------------------------- 1 | {{ page.date }} -------------------------------------------------------------------------------- /test/stubs/pagedateutc.njk: -------------------------------------------------------------------------------- 1 | {{ page.date.toUTCString() }} -------------------------------------------------------------------------------- /test/stubs/pagination-eleventycomputed-permalink.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | venues: 3 | - first 4 | - second 5 | - third 6 | pagination: 7 | data: venues 8 | size: 1 9 | alias: venue 10 | addAllPagesToCollections: true 11 | eleventyComputed: 12 | permalink: "venues/{{ venue }}/" 13 | --- 14 | -------------------------------------------------------------------------------- /test/stubs/pagination-eleventycomputed-title.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | venues: 3 | - id: 1 4 | name: first 5 | - id: 2 6 | name: second 7 | - id: 3 8 | name: third 9 | randommetadata: "woopers" 10 | pagination: 11 | data: venues 12 | size: 1 13 | alias: venue 14 | eleventyComputed: 15 | title: "website - {{ venue.name }}" 16 | --- 17 | 18 | {{ venue.name }} 19 | 20 | {{ randommetadata }} 21 | -------------------------------------------------------------------------------- /test/stubs/pagination-templatecontent/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: collections.post 4 | size: 5 5 | alias: posts 6 | --- 7 | {%- for post in posts -%} 8 | {{ post.templateContent | safe }} 9 | {%- endfor -%} -------------------------------------------------------------------------------- /test/stubs/pagination-templatecontent/post-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | --- 5 | 6 | # Post 1 7 | -------------------------------------------------------------------------------- /test/stubs/pagination-templatecontent/post-2.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - post 4 | --- 5 | 6 | # Post 2 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-build/permalink-build.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: 3 | build: /url/ 4 | --- 5 | 6 | This should be the same as `permalink: /url/` 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-conflicts-false/test1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | permalink: false 7 | --- 8 | 9 | # Test 1 10 | -------------------------------------------------------------------------------- /test/stubs/permalink-conflicts-false/test2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | permalink: false 7 | --- 8 | 9 | # Test 2 10 | -------------------------------------------------------------------------------- /test/stubs/permalink-conflicts/test1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | permalink: /permalink-conflicts/ 7 | --- 8 | 9 | # Test 1 10 | -------------------------------------------------------------------------------- /test/stubs/permalink-conflicts/test2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | permalink: /permalink-conflicts/ 7 | --- 8 | 9 | # Test 2 10 | -------------------------------------------------------------------------------- /test/stubs/permalink-conflicts/test3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | permalink: permalink-conflicts/ 7 | --- 8 | 9 | # Test 3 10 | -------------------------------------------------------------------------------- /test/stubs/permalink-data-layout/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "layout": "permalink-data-layout.njk" 3 | } -------------------------------------------------------------------------------- /test/stubs/permalink-data-layout/test.njk: -------------------------------------------------------------------------------- 1 | Test 1:{{ page.fileSlug }} -------------------------------------------------------------------------------- /test/stubs/permalink-empty-object/empty-object.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: {} 3 | --- 4 | 5 | This should be the same as if permalink was not set at all. 6 | -------------------------------------------------------------------------------- /test/stubs/permalink-false-computed/test.md: -------------------------------------------------------------------------------- 1 | --- 2 | eleventyComputed: 3 | permalink: false 4 | --- 5 | 6 | This shouldn’t write 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-false/test.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: false 3 | --- 4 | 5 | This shouldn’t write 6 | -------------------------------------------------------------------------------- /test/stubs/permalink-in-layout-fileslug.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: permalink-in-layout/layout-fileslug.liquid 3 | --- 4 | Current url: {{ permalink }} -------------------------------------------------------------------------------- /test/stubs/permalink-in-layout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: permalink-in-layout/layout.liquid 3 | --- 4 | Current url: {{ permalink }} -------------------------------------------------------------------------------- /test/stubs/permalink-markdown-override.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: My Title 3 | permalink: /news/my-test-file/index.html 4 | templateEngineOverride: html,md 5 | --- 6 | 7 | # <%= title %> 8 | -------------------------------------------------------------------------------- /test/stubs/permalink-markdown-var.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: My Title 3 | permalink: /news/{{ title | slug }}/index.html 4 | --- 5 | 6 | # <%= title %> 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-markdown.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: My Title 3 | permalink: /news/my-test-file/index.html 4 | --- 5 | 6 | # <%= title %> 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-nobuild/permalink-nobuild.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: 3 | someotherkey: /url/ 4 | --- 5 | 6 | This shouldn’t write to the file system or be rendered by a template engine. 7 | -------------------------------------------------------------------------------- /test/stubs/permalink-true/permalink-true.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: true 3 | --- 4 | 5 | This should throw an error. 6 | -------------------------------------------------------------------------------- /test/stubs/permalinkdata-jsfn.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | title: "slug", 4 | permalink: "subdir/{{title}}/" 5 | } 6 | --- 7 | Slugged. 8 | -------------------------------------------------------------------------------- /test/stubs/permalinkdata-jspermalinkfn.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | title: "slug", 4 | permalink: function(data) { 5 | return `subdir/${data.title}/`; 6 | } 7 | } 8 | --- 9 | Slugged. 10 | -------------------------------------------------------------------------------- /test/stubs/permalinkdata.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Slug CANDIDATE 3 | permalink: subdir/{{ title | slug }}/index.html 4 | --- 5 | Slugged. 6 | -------------------------------------------------------------------------------- /test/stubs/permalinkdate.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: Date Permalink 3 | date: "2016-01-01T06:00-06:00" 4 | permalink: "/{{ page.date | date: '%Y/%m/%d' }}/index.html" 5 | --- 6 | Date Permalinks -------------------------------------------------------------------------------- /test/stubs/permalinked.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: permalinksubfolder/index.html 3 | --- 4 | Current url: {{ permalink }} -------------------------------------------------------------------------------- /test/stubs/posts/post1.njk: -------------------------------------------------------------------------------- 1 | Post1 2 | -------------------------------------------------------------------------------- /test/stubs/posts/posts.json: -------------------------------------------------------------------------------- 1 | { 2 | "layout": "mylocallayout.njk" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs/posts/posts.njk: -------------------------------------------------------------------------------- 1 | Posts 2 | -------------------------------------------------------------------------------- /test/stubs/prematureTemplateContent/test.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function(data) { 2 | return data.collections.all[0].templateContent; 3 | }; 4 | -------------------------------------------------------------------------------- /test/stubs/prematureTemplateContent/test.liquid: -------------------------------------------------------------------------------- 1 | {{ collections.all[0].templateContent }} -------------------------------------------------------------------------------- /test/stubs/prematureTemplateContent/test.md: -------------------------------------------------------------------------------- 1 | {{ sample.templateContent }} 2 | -------------------------------------------------------------------------------- /test/stubs/prematureTemplateContent/test.njk: -------------------------------------------------------------------------------- 1 | {{ sample.templateContent }} -------------------------------------------------------------------------------- /test/stubs/promise.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = new Promise((resolve, reject) => { 2 | setTimeout(function() { 3 | resolve("

Zach

"); 4 | }, 100); 5 | }); 6 | -------------------------------------------------------------------------------- /test/stubs/public/test.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/public/test.css -------------------------------------------------------------------------------- /test/stubs/relative-liquid/dir/included.liquid: -------------------------------------------------------------------------------- 1 | TIME IS RELATIVE. -------------------------------------------------------------------------------- /test/stubs/reuse-permalink/reuse-permalink.json: -------------------------------------------------------------------------------- 1 | { 2 | "permalink": "/{{ page.date | date: '%Y/%m/%d' }}/index.html" 3 | } 4 | -------------------------------------------------------------------------------- /test/stubs/reuse-permalink/test1.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | date: "2016-01-01T06:00-06:00" 4 | --- 5 | 6 | # Test 1 7 | -------------------------------------------------------------------------------- /test/stubs/script-frontmatter/test-default.njk: -------------------------------------------------------------------------------- 1 | --- 2 | import {noopSync} from "@zachleat/noop"; 3 | const myString = "Hi"; 4 | 5 | // export a function 6 | function myFunction() { return "Bye" } 7 | --- 8 |
{{ noopSync(myString) }}
{{ myFunction() }}
-------------------------------------------------------------------------------- /test/stubs/script-frontmatter/test-js.njk: -------------------------------------------------------------------------------- 1 | ---javascript 2 | { 3 | myFunction: function() { 4 | return "HELLO!"; 5 | } 6 | } 7 | --- 8 |
{{ myFunction() }}
-------------------------------------------------------------------------------- /test/stubs/script-frontmatter/test.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | import {noopSync} from "@zachleat/noop"; 3 | const myString = "Hi"; 4 | 5 | // export a function 6 | function myFunction() { return "Bye" } 7 | --- 8 |
{{ noopSync(myString) }}
{{ myFunction() }}
-------------------------------------------------------------------------------- /test/stubs/string.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/string.11ty.custom: -------------------------------------------------------------------------------- 1 | export default "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/string.11ty.possum: -------------------------------------------------------------------------------- 1 | export default "

Possum

"; 2 | -------------------------------------------------------------------------------- /test/stubs/stubs-computed-permalink/eleventycomputed-nested-object.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | lang: "en", 3 | eleventyComputed: { 4 | permalink: function (data) { 5 | // console.log(">>>>", { data }); 6 | return { 7 | build: `/i18n/${data.lang}/`, 8 | }; 9 | }, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /test/stubs/stubs-computed-permalink/eleventycomputed-object-replace.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | lang: "en", 3 | permalink: "/i18n/{{lang}}/", 4 | eleventyComputed: { 5 | permalink: function (data) { 6 | return { 7 | build: data.permalink.replace("{{lang}}", "en"), 8 | }; 9 | }, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /test/stubs/stubs-computed-permalink/eleventycomputed-object.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports.data = { 2 | lang: "en", 3 | eleventyComputed: { 4 | permalink: { 5 | build: function (data) { 6 | return `/i18n/${data.lang}/`; 7 | }, 8 | }, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /test/stubs/stubs-virtual-conflict/virtual.md: -------------------------------------------------------------------------------- 1 | # This is on the file system -------------------------------------------------------------------------------- /test/stubs/subdir/img/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/subdir/img/.gitkeep -------------------------------------------------------------------------------- /test/stubs/subdir/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/subdir/index.html -------------------------------------------------------------------------------- /test/stubs/subfolder/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/subfolder/index.html -------------------------------------------------------------------------------- /test/stubs/subfolder/subfolder.liquid: -------------------------------------------------------------------------------- 1 | subfolder -------------------------------------------------------------------------------- /test/stubs/subfolder/subfolder/subfolder.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/subfolder/subfolder/subfolder.liquid -------------------------------------------------------------------------------- /test/stubs/tagged-pagination-multiples-layout/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | layout: layouts/div-wrapper-layout.njk 4 | testdata: 5 | - one 6 | - two 7 | - three 8 | pagination: 9 | data: testdata 10 | size: 1 11 | alias: item 12 | addAllPagesToCollections: true 13 | --- 14 | {{ item }} -------------------------------------------------------------------------------- /test/stubs/tagged-pagination-multiples/test.njk: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | tags: 4 | - haha 5 | pagination: 6 | data: collections.userCollection 7 | size: 1 8 | alias: item 9 | addAllPagesToCollections: true 10 | --- 11 | 12 | {{ title }} -------------------------------------------------------------------------------- /test/stubs/template-passthrough-duplicates/input/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough-duplicates/input/avatar.png -------------------------------------------------------------------------------- /test/stubs/template-passthrough-duplicates/input/src/views/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough-duplicates/input/src/views/avatar.png -------------------------------------------------------------------------------- /test/stubs/template-passthrough/.htaccess: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/.htaccess -------------------------------------------------------------------------------- /test/stubs/template-passthrough/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/img.jpg -------------------------------------------------------------------------------- /test/stubs/template-passthrough/src/views/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/src/views/avatar.png -------------------------------------------------------------------------------- /test/stubs/template-passthrough/static/nested/test-nested.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/static/nested/test-nested.css -------------------------------------------------------------------------------- /test/stubs/template-passthrough/static/test.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/static/test.css -------------------------------------------------------------------------------- /test/stubs/template-passthrough/static/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough/static/test.js -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/.htaccess: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/.htaccess -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/img.jpg -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/src/views/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/src/views/avatar.png -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/static/nested/test-nested.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/static/nested/test-nested.css -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/static/test.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/static/test.css -------------------------------------------------------------------------------- /test/stubs/template-passthrough2/static/test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template-passthrough2/static/test.js -------------------------------------------------------------------------------- /test/stubs/template.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/stubs/template.liquid -------------------------------------------------------------------------------- /test/stubs/templateFrontMatter.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | key1: value1 3 | key2: value2 4 | key3: value3 5 | --- 6 | c:{{ key1 }}:{{ key2 }}:{{ key3 }} -------------------------------------------------------------------------------- /test/stubs/templateFrontMatterJs.njk: -------------------------------------------------------------------------------- 1 | ---js 2 | { 3 | key1: "value1", 4 | key2: function(value) { 5 | return value.toUpperCase(); 6 | }, 7 | key3: "value3" 8 | } 9 | --- 10 | c:{{ key1 }}:{{ key2("value2") }}:{{ key3 }} 11 | -------------------------------------------------------------------------------- /test/stubs/templateFrontMatterJson.liquid: -------------------------------------------------------------------------------- 1 | ---json 2 | { 3 | "key1": "value1", 4 | "key2": "value2", 5 | "key3": "value3" 6 | } 7 | --- 8 | c:{{ key1 }}:{{ key2 }}:{{ key3 }} -------------------------------------------------------------------------------- /test/stubs/templateLayoutCacheDuplicates-b/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | Hello B -------------------------------------------------------------------------------- /test/stubs/templateLayoutCacheDuplicates/_includes/layout.njk: -------------------------------------------------------------------------------- 1 | Hello A -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg-permalink.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | pagination: 4 | data: collections.userCollection 5 | size: 1 6 | alias: item 7 | permalink: /{{ item.data.title | slug}}/hello/ 8 | --- 9 | 10 | # {{ title }} 11 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg-tagged-apply-to-all.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | tags: 4 | - haha 5 | pagination: 6 | data: collections.userCollection 7 | size: 1 8 | alias: item 9 | addAllPagesToCollections: true 10 | --- 11 | 12 | # {{ title }} 13 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg-tagged-permalink-apply-to-all.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | tags: 4 | - haha 5 | pagination: 6 | data: collections.userCollection 7 | size: 1 8 | alias: item 9 | addAllPagesToCollections: true 10 | permalink: /{{ item.data.title | slug}}/goodbye/ 11 | --- 12 | 13 | # {{ title }} 14 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg-tagged-permalink.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | tags: 4 | - haha 5 | pagination: 6 | data: collections.userCollection 7 | size: 1 8 | alias: item 9 | permalink: /{{ item.data.title | slug}}/goodbye/ 10 | --- 11 | 12 | # {{ title }} 13 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg-tagged.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | tags: 4 | - haha 5 | pagination: 6 | data: collections.userCollection 7 | size: 1 8 | alias: item 9 | --- 10 | 11 | # {{ title }} 12 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-cfg.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | pagination: 4 | data: collections.userCollection 5 | size: 1 6 | --- 7 | 8 | # {{ title }} 9 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-tag-dogs-templateContent-alias.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | pagination: 4 | data: collections.dog 5 | size: 2 6 | alias: dogs 7 | --- 8 | 9 | Before 10 | {% for dog in dogs %} 11 | {{ dog.templateContent }} 12 | {% endfor %} 13 | After 14 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-tag-dogs-templateContent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | pagination: 4 | data: collections.dog 5 | size: 1 6 | --- 7 | 8 | Before 9 | {% for dog in pagination.items %} 10 | {{ dog.templateContent }} 11 | {% endfor %} 12 | After 13 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/paged-tag.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Paged Test 3 | pagination: 4 | data: collections.dog 5 | size: 1 6 | --- 7 | 8 | # {{ title }} 9 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/templateContent.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: circle 3 | --- 4 | 5 | # Test 6 | 7 | {{ collections.circle[0].templateContent }} 8 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/test1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 3 | tags: 4 | - post 5 | - dog 6 | --- 7 | 8 | # Test 1 9 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/test2.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: cat 3 | --- 4 | 5 | # Test 2 6 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/test3.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: circle 3 | --- 4 | 5 | # {{ collections.circle.length }}, {{ collections.circle[0].url }} 6 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/test4.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 4 3 | tags: 4 | - post 5 | - dog 6 | --- 7 | 8 | # Test 4 9 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/test5.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test Title 5 3 | --- 4 | 5 | # Test 5 6 | -------------------------------------------------------------------------------- /test/stubs/templateMapCollection/testWithLayout.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/templateMapCollection.njk 3 | --- 4 | 5 | {{ upstream }} 6 | -------------------------------------------------------------------------------- /test/stubs/templateTwoLayouts.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout-a 3 | key1: value1 4 | title: 'Font Aliasing, or How to Rename a Font in CSS' 5 | permalink: /rename-font/ 6 | postRank: 4 7 | daysPosted: 152 8 | yearsPosted: 0.4 9 | --- 10 | 11 |

{{ upstream }}

-------------------------------------------------------------------------------- /test/stubs/templateWithLayout.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layoutLiquid.liquid 3 | keymain: valuemain 4 | title: 'Font Aliasing, or How to Rename a Font in CSS' 5 | permalink: /rename-font/ 6 | --- 7 | 8 |

Hello.

-------------------------------------------------------------------------------- /test/stubs/templateWithLayoutContent.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: defaultLayoutLayoutContent 3 | keymain: valuemain 4 | title: 'Font Aliasing, or How to Rename a Font in CSS' 5 | permalink: /rename-font/ 6 | --- 7 |

Hello.

8 | -------------------------------------------------------------------------------- /test/stubs/templateWithLayoutKey.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: defaultLayout 3 | keymain: valuemain 4 | title: 'Font Aliasing, or How to Rename a Font in CSS' 5 | permalink: /rename-font/ 6 | --- 7 | 8 |

Hello.

-------------------------------------------------------------------------------- /test/stubs/templatetest-frontmatter/multiple.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: 3 | - multi-tag 4 | - multi-tag-2 5 | --- 6 | {% if tags.includes("multi-tag-2") %}Has multi-tag-2{% endif %} -------------------------------------------------------------------------------- /test/stubs/templatetest-frontmatter/single.njk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: single-tag 3 | --- 4 | {% if tags.includes("single-tag") %}Has single-tag{% endif %} -------------------------------------------------------------------------------- /test/stubs/test-override-js-markdown.11ty.cjs: -------------------------------------------------------------------------------- 1 | class Test { 2 | data() { 3 | return { 4 | name: "markdown", 5 | templateEngineOverride: "11ty.js,md" 6 | }; 7 | } 8 | 9 | render(data) { 10 | return `# This is ${data.name}`; 11 | } 12 | } 13 | 14 | module.exports = Test; 15 | -------------------------------------------------------------------------------- /test/stubs/testing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is an html template. 4 | 5 | -------------------------------------------------------------------------------- /test/stubs/transform-pages/template.njk: -------------------------------------------------------------------------------- 1 | --- 2 | pagination: 3 | data: testdata 4 | size: 4 5 | testdata: 6 | - item1 7 | - item2 8 | - item3 9 | - item4 10 | - item5 11 | - item6 12 | - item7 13 | - item8 14 | --- 15 |
    {% for item in pagination.items %}
  1. {{ item }}
  2. {% endfor %}
16 | -------------------------------------------------------------------------------- /test/stubs/use-collection.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = function({ collections }) { 2 | return `
    ${collections.post 3 | .map(post => `
  • ${post.data.title}
  • `) 4 | .join("")}
`; 5 | }; 6 | -------------------------------------------------------------------------------- /test/stubs/vue-layout.11ty.cjs: -------------------------------------------------------------------------------- 1 | const { createSSRApp } = require("vue"); 2 | const { renderToString } = require("@vue/server-renderer"); 3 | 4 | module.exports = async function (data) { 5 | var app = createSSRApp({ 6 | template: "

Hello {{ data.name }}, this is a Vue template.

", 7 | data: function () { 8 | return { data }; 9 | }, 10 | // components: { 11 | // 'test': ComponentA 12 | // } 13 | }); 14 | 15 | let content = await renderToString(app, { title: "Test" }); 16 | return ` 17 | Test 18 | ${content}`; 19 | }; 20 | -------------------------------------------------------------------------------- /test/stubs/vue.11ty.cjs: -------------------------------------------------------------------------------- 1 | const { createSSRApp } = require("vue"); 2 | const { renderToString } = require("@vue/server-renderer"); 3 | 4 | module.exports = async function (templateData) { 5 | var app = createSSRApp({ 6 | template: "

Hello {{ data.name }}, this is a Vue template.

", 7 | data: function () { 8 | return { 9 | data: templateData, 10 | }; 11 | }, 12 | // components: { 13 | // 'test': ComponentA 14 | // } 15 | }); 16 | 17 | return renderToString(app); 18 | }; 19 | -------------------------------------------------------------------------------- /test/stubs/writeTest/test.md: -------------------------------------------------------------------------------- 1 | # Header -------------------------------------------------------------------------------- /test/stubs/writeTestJS-casesensitive/sample.Js: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestJS-casesensitive/test.11Ty.js: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestJS-passthrough/sample.js: -------------------------------------------------------------------------------- 1 | export default "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestJS-passthrough/test.11ty.js: -------------------------------------------------------------------------------- 1 | export default "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestJS/sample.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestJS/test.11ty.cjs: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestMarkdown/sample.md: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/stubs/writeTestMarkdown/sample2.markdown: -------------------------------------------------------------------------------- 1 | module.exports = "

Zach

"; 2 | -------------------------------------------------------------------------------- /test/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/11ty/eleventy/90d07d30374c7c30ba54a535df84bf8facca1b4e/test/views/.gitkeep -------------------------------------------------------------------------------- /test_node/README.md: -------------------------------------------------------------------------------- 1 | # test_node Unit Tests 2 | 3 | This folder is the start of a test suite using the [official Node Test Runner](https://nodejs.org/api/test.html). It was originally introduced to workaround issues with `tsx` and `@mdx-js/node-loader` using worker threads (not supported by the existing test runner, [ava](https://github.com/avajs/ava)). Rather than use `--no-worker-threads` with a separate `ava` run, we’re slowly migrating to this new approach. 4 | -------------------------------------------------------------------------------- /test_node/tests.js: -------------------------------------------------------------------------------- 1 | import "./JsxTest.js"; 2 | import "./MdxTest.js"; 3 | --------------------------------------------------------------------------------