sylhare / Type-on-Strap

🎨 Simplistic, responsive jekyll based open source theme
https://sylhare.github.io/Type-on-Strap/
MIT License
814 stars 902 forks source link

Header for another set of blogs in the same site #293

Closed im-coder-lg closed 3 years ago

im-coder-lg commented 3 years ago

How do you add a separate page as a header(i figured this one out) as well as add a separate set of blogs to it? For example, I wanna start a separate blog where I add code. How do I do that? I found out how to add the header page. How can I include a set of code used for the home page that will help me add blogs separately and not mix them in the home page?

sylhare commented 3 years ago

You want to have two types of articles in one blog:

Am I understanding you correctly? If so you could try to use the portfolio functionality?

im-coder-lg commented 3 years ago

You want to have two types of articles in one blog:

  • Normal article with in _posts
  • Other "code" article that don't mix with the posts

Am I understanding you correctly?

Yes If so you could try to use the portfolio functionality?

I don't want the portfolio because to use it, I need to make a picture to add it. I want it to appear just like the home screen blog. How do I do that?

danisztls commented 3 years ago

How do you add a separate page as a header(i figured this one out) as well as add a separate set of blogs to it? For example, I wanna start a separate blog where I add code. How do I do that? I found out how to add the header page. How can I include a set of code used for the home page that will help me add blogs separately and not mix them in the home page?

Use categories for that.

im-coder-lg commented 3 years ago

What is categories?

danisztls commented 3 years ago

A field that you can put on the front matter of blogs posts. You can use the categories as any other field on the permalink.

im-coder-lg commented 3 years ago

Well, how do you use it then?

im-coder-lg commented 3 years ago

What I am trying to tell is that if I have a new page in my blog, and added a header page, how do I put the posts in that page only?

danisztls commented 3 years ago

You need to mess with pagination. There's a plugin for that but it will not work with GH Pages. What you can do is write a fac-simile using Liquid only that filter for the desired category. You can use a if inside a for loop to do that.

im-coder-lg commented 3 years ago

Any simple method?

im-coder-lg commented 3 years ago

Or at least how to redirect via header page?

im-coder-lg commented 3 years ago

ping @sylhare

sylhare commented 3 years ago

You can use jekyll collections (In this theme portfolio is a collection but you can add another one and custom it so that it fits your needs)

You could do it in two repo hosted on github page one showing your code and the other one your blog and add links between the two pages. But that will require some customization as well.

im-coder-lg commented 3 years ago

That works, but how can I add a header page? That is confusing to me.

im-coder-lg commented 3 years ago

Any code for adding?

im-coder-lg commented 3 years ago

ping @sylhare

im-coder-lg commented 3 years ago

Found a solution via collections. Thanks!

sylhare commented 3 years ago

Awesome 👍 You can reference it here, if someone is having the same question as you, I'm sure they'll be glad to see your stuff!

im-coder-lg commented 3 years ago

Yep.