简体   繁体   中英

Jekyll Post - selecting several different posts from different categories

Currently, I am building out a Jekyll website as a portfolio and a blog for my self. I want to make custom pages for job posting with the selected post being used. Example maybe only 3 portfolio project that is relevant to the employer and 3 blog posts that are relative to the employer. I would want to mix and match these for each job I apply for to give them all a custom experience.

Is there a way to do this?

I think there are 2 ways to do this.

1. Make a layout for your portfolio, and then create pages using that layout for each portfolio/employer.

  • create a portfolio layout called portfolio.html and put it in your _layouts directory
  • create a markdown file for each custom portfolio with this YAML

---
layout: portfolio
title: "Custom Title"
permalink: /custom-permalink/
---

2. Create a seperate .html file in the root directory for each portfolio/employer

Normally you would have an index.html file with the blog posts in your root directory. Simply make other files like company-1.html , company-2.html , portfolio-1.html etc., but fill those index files with the posts or projects that you want to show.

Note : to get clean links like https://yoursite.com/portfolio-1/ you may need to set this in your _config.yaml

permalink:        "/:title/"

For more details on how to do all this see the Jekyll Docs for Creating Pages as well as the information about how to link to posts and how to link to pages .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM