danurbanowicz / eleventy-netlify-boilerplate

A template for building a simple website with the Eleventy static site generator

Home Page:https://eleventy-netlify-boilerplate.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get tags and author to work on another repo

talmax1124 opened this issue · comments

commented

Hello, I cannot add the tags or author feature to this repository. Could someone help me and do a pull request? I also have a question on regards the layout template, I have it configured a different way, can someone help me configure everything to match my repo: https://github.com/talmax1124/DrKhan

Your issue with authors is probably due to incorrect naming in your project. For example in your eleventy.js where the authors collection is generated from a glob, you are referencing a folder that no longer exists:

 eleventyConfig.addCollection("authors", (collection) => {
    const blogs = collection.getFilteredByGlob("posts/*.md");

If you change the posts/ folder to articles/ then the collection should be generated correctly.

Check your project for any other small inconsistencies like that, and then everything should work.

Let us know if you need any more help. And post any errors here so that we can see what's going on in your build.

Thanks!

commented

@danurbanowicz It is not working at all. & I'm not recieving any errors at all at runtime. This time I tried it on another repo, but it is not giving me right result, instead giving me this screen when clicking on author.
Screen Shot 2021-09-16 at 6 47 55 PM

Repo: https://github.com/talmax1124/knighttimesnews-restore

From your code it looks like you are mixing this project with another similar starter project, maybe that is where the problems are originating?

The GET error above likely points to a problem with your permalink setup in your frontmatter. i.e. the pages are being output somewhere different. The first step is to check your output directory and see what it is actually outputting there.

commented

I think that maybe the issue is that there is no authors folder. I don't know how your repo is generating the authors. I just have my authors in the frontmatter when making a post. @danurbanowicz

An authors folder is not required.

The authors collection is added in eleventy.js using eleventyConfig.addCollection

It looks for the author inside each post's frontmatter and uses author.njk to paginate the collection and generate a page of posts for each author.

Hopefully this helps!

I'm closing this issue for now but do let me know if you need me to re-open and investigate this further. Thanks!

ezoic increase your site revenue