How to create list of all posts on one page

List page:

All posts here:

It looks like a trivial task, but i can’t figure out how to do this in a simple way.

One way would be to make a custom shortcode and then call that shortcode in that page.

The shortcode would be pretty simple to make - just range through all the pages.

You might even just want to try an inline shortcode since you’re probably not going to reuse the code anywhere else.

1 Like

2nd way

copy the original template and ( ex. to singlewithlist.html)

in frontmatter set layout = singlewithlist

build the needed range in there

1 Like

Sorry for newbieness, but i still don’t figure out how to reproduce it.
Could you be more detailed?

It would be easier to assist you if you were to share your project repository. And I don’t mean this one:

Yes, that’s my repo.

Please share the repository that contains the source (templates, markdown, etc.).

Thanks for the help. Currently i don’t know how to do this.
I’m using Mainroad theme:

Then zip up your source code and post it somewhere.

Here is source code on mega without pictures (to lighten the weight)

Given your unique site structure, perhaps the easiest way to do this:

rm content/menu/


  name = "Publications"
  url = "/post/"
  weight = 20

Then set the menu weights of the pages that you created in content/menu/. For example:


    weight: 10


    weight: 30
1 Like

Thank you very much! That worked, very elegant solution.

And one more lil’ question is there any way to remove word “Posts” from the top of Publications page?

mkdir -p layouts/post
cp themes/mainroad/layouts/_default/list.html layouts/post/
diff --git a/layouts/post/list.html b/layouts/post/list.html
index dc04ca6..3c7e334 100644
--- a/layouts/post/list.html
+++ b/layouts/post/list.html
@@ -1,10 +1,5 @@
 {{ define "main" }}
 <main class="main list" role="main">
-       {{- with .Title }}
-       <header class="main__header">
-               <h1 class="main__title">{{ . }}</h1>
-       </header>
-       {{- end }}
        {{- with .Content }}
        <div class="content main__content clearfix">
                {{ . }}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.