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

How do I do this? make featured image; image thumbnails in /archive; page without sidebar #230

Closed
3 tasks done
nro-bot opened this issue Apr 14, 2018 · 4 comments
Closed
3 tasks done

Comments

@nro-bot
Copy link

nro-bot commented Apr 14, 2018

I am trying to replicate some behavior in the demo site,
http://notes.iissnan.com/archives/
specifically, creating what seem to be a "featured image" and also a "gallery" on the archives page.
However, I do not know how to do so.

I agree and want to create new issue


Expected behavior

  1. I would like to make a photo gallery show up on the archives page timeline

gallery

  1. I would like to make a "featured image" for my blog posts

featured_image

Actual behavior

No photos appear in timeline

Additionally, I have no idea how to make a "featured image". I tried adding to the frontmatter

---
layout: post
featured_image: test.png
---

However, this did not do anything.

Steps to reproduce the behavior

  1. hexo new post testgallery.md
---
type: "gallery"
layout: post 
title: testgall
photos:
 - images/pasted-0.png
 - images/pasted-1.png
date: 2018-04-14 01:27:32
tags:
---
test page

Go to http://localhost:4000/my-site/archives/ -- no images appear

NexT Scheme:

[] All schemes
[] Muse
[] Mist
[] Pisces
[x] Gemini

Next Theme v 6.1.0

What I really want to do, is to have a single "featured image" show up both on the index page and on the archives (timeline) pages. That is, a combination of being able to set a featured image in a post (maybe in the frontmatter), and have it show up in the archive with a picture thumbnail.

Is this possible?

I would also like to make a page without a sidebar. I am hopingI can make a my-site/themes/next/layout/nosidebar.swig file and then put in the frontmatter of a new page my-site/source/index/index.md' the yaml type: "nosidebar"` . I will try this tomorrow.

Thank you very much for the beautiful theme.

@AlynxZhou
Copy link

About the second read here, it is somewhat but still able to work.

About first maybe you should use layout: photo? I have read this but iissnan never record it in docs, if I remember he should write this in some issues, but I cannot find them, you can go to search.

And the third, I read templates and seems NexT has no config about this, you can add a if statement if you know swig, just add {% if page.sidebar != false %} to page.swig or post.swig before sidebar render and then add {% endif %} after it, and then add sidebar: false to your page, it should word...

@reuixiy
Copy link
Contributor

reuixiy commented Apr 19, 2018

I hope this page would be helpful for you.

@nro-bot
Copy link
Author

nro-bot commented May 26, 2018

Hi, I can confirm that putting in the post frontmatter "layout:photo" allows the photos to show up in the "archive" page. (And yes, this feature can only be found in source code: https://github.com/theme-next/hexo-theme-next/blob/cc07c43d002a13df9976c31813f774908fcd0d40/layout/_macro/post.swig)

I am slowly learning swig, thank you!

@stevenjoezhang
Copy link
Contributor

stevenjoezhang commented Nov 3, 2019

Superseded by #1253

Fixed in next-theme/hexo-theme-next@7b91f8e

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

No branches or pull requests

4 participants