Adding additional content sections in Lanyon theme

Hello, I am new to hugo and trying to adding different sections in the existing lanyon theme. For example you might have two blog folders each contains a different list of posts. I will have section called “otherposts” inside content folder as in HugoBasicExample. Here is what I did to achieve that:

  1. In the “content” folder, create otherposts folder

  2. in the theme folder (lanyon-hugo theme folder). Add this entry to the siderbar.html

    <a class=“sidebar-nav-item {{ if eq .Url “otherposts” }} active {{ end }}” href="/otherposts">Other Posts

  3. In the “indexes” folder create “otherposts.html” as the copy of post.html

  4. create otherposts folder with copying the contents from post folder (li.html, single.html) inside layouts folder.

It seems worked, however, this approach seem to have lots repetitive code. any suggestion with better methods?

The current lanyou-hugo theme author suggested me to post here since he is no longer use hugo. Many thanks for any input!

The layout of the Lanyon theme looks a little bit funky to me, maybe it’s been there for a long time.

My starting point is always:

_default/single.html
_default/list.html
index.html
partials (with lots of stuff)

And then maybe some views.

But all sections share the same templates in most cases. And now I have started to use Ace with its base template support, and it looks even nicer.

If you do some clean up here, It would benefit more people if you did it as a PR to the theme project.

Many thanks! I am new to this. I guess PR means “pull request”? I will do that. Also there is some other features lanyon lacks :

  1. page navigation
  2. summary format
  3. discuss and comments
    I will try to do it locally and ask for these feature been merged.
    regards

Thanks! We look forward to seeing these features implemented.

Just created the PR for lanyon theme with standard disqus and summary template.