Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How to make certain pages behave like posts? #3468

Closed
FernandoHurtado opened this issue Feb 25, 2019 · 7 comments
Closed

[question] How to make certain pages behave like posts? #3468

FernandoHurtado opened this issue Feb 25, 2019 · 7 comments
Labels

Comments

@FernandoHurtado
Copy link

I have certain pages (under the projects section) that I want to behave like posts (without actually being posts) in the sense that they should have table of contents and tags. I know I could just edit post.ejs but I just need the pages under /projects/ to have this layout.

##Thanks!

Here's the repo:
https://github.com/FernandoHurtado/purtechnikon

@tcrowe
Copy link
Contributor

tcrowe commented Feb 28, 2019

Hey @FernandoHurtado 😸

Did you arrive at a solution? If so, what was it?

Some things I usually do are putting *.md or *.html pages in directories and hexo automatically knows how to render it.

@tcrowe
Copy link
Contributor

tcrowe commented Feb 28, 2019

Combined with front-matter: https://hexo.io/docs/front-matter

@FernandoHurtado
Copy link
Author

Did you arrive at a solution? If so, what was it?
Some things I usually do are putting *.md or *.html pages in directories and hexo automatically knows how to render it.

hey @tcrowe , I haven't found a solution :( . Basically what I'm asking is how to make hexo know to render pages under the /projects/ directory like it does posts.

For example, https://purtechnikon.com/projects/Journal-julia/ doesn't have an index on the side and a share button and stuff as opposed to https://purtechnikon.com/2019/02/25/Exploring-the-limits-of-Turing-Computability/ , which is formatted more properly for texts.

@yoshinorin
Copy link
Member

yoshinorin commented Mar 6, 2019

@FernandoHurtado
Hi 👋

You can specify which layout do you use by each posts or pages using by Front-matter layout variable.
For example, hexo-theme-landscape has seven templates.

So, I think you should create *.md file in your _source/project directory & specify layout.

Example

// _source/project/index.md

---
layout: post //specify which layout do you use
title: "example"
date: 2018-11-13 19:02:46
---

I'm sorry if I misunderstand. Thanks :)

@FernandoHurtado
Copy link
Author

@yoshinorin
Hi! I tried setting layout to post and it really only changed how the title looks:
It still doesn't generate the table of contents or sharing buttons :(

I checked the other layouts and none of them work either. This is my layouts folder:
https://github.com/FernandoHurtado/purtechnikon/tree/master/themes/cactus-PT/layout

@yoshinorin
Copy link
Member

@FernandoHurtado
I tried to customize your theme, but it's difficult for me...
We need an expert who is knowledgeable in layout customize.

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Mar 10, 2020

Whether to show the share button is controlled by the theme, you can ask the maintainer of the theme for help.
Or you can try moving /projects/ to /_posts/projects/

There is a discussion about it #1067
I'm closing this issue. Please join the discussion there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants