tommi, (edited )
@tommi@pan.rent avatar

Hey tinkerers!

I have a git submodule that I am adding inside the repository of my website, but I want it to be ignored, except for its README.md.

I have tried two different approaches. In both cases I am able to exclude the git submodule, but I can’t find a way to include the README and use it as a regular template.

Option 1: using .eleventyignore

inputdir/submodule<br></br>!inputdir/submodule/README.md<br></br>

Option 2: using .eleventy.js

module.exports = function (eleventyConfig) {<br></br>  eleventyConfig.ignores.add('inputdir/submodule');<br></br>  eleventyConfig.ignores.add('inputdir/submodule/README.md'); // added it first to be sure<br></br>  eleventyConfig.ignores.delete('inputdir/submodule/README.md');<br></br>};<br></br>

Do you have any suggestions to fix this? The ignore section in Eleventy’s documentation is not helping much…

Thanks a lot!

cc: @eleventy @

(https://discord.com/channels/741017160297611315/1022195881698672650/threads/1233153676416254133 and on GitHub Discussions

cjerrington,
@cjerrington@mstdn.social avatar

@tommi @eleventy so you’re trying to only include the readme file from the git submodule?

Does the submodule needed in the rest of the build? I wonder if the readme.md is the only file needed, there’s is a unique way to clone a specific file instead of the whole repo.

tommi,
@tommi@pan.rent avatar

Thanks for replying, @cjerrington!

Actually, I really need to have all of the files of the submodule locally.

cjerrington,
@cjerrington@mstdn.social avatar

@tommi I wonder then if you can still ignore the folder, which will no be copied to your build, but then do a copypassthrough function for the readme file?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • 11ty
  • rosin
  • thenastyranch
  • ethstaker
  • osvaldo12
  • mdbf
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • ngwrru68w68
  • slotface
  • GTA5RPClips
  • kavyap
  • cubers
  • JUstTest
  • everett
  • cisconetworking
  • tacticalgear
  • anitta
  • khanakhh
  • normalnudes
  • Durango
  • modclub
  • tester
  • provamag3
  • Leos
  • megavids
  • lostlight
  • All magazines