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

Blog post thumb images #108

Open
mwhelan opened this issue Apr 4, 2014 · 15 comments
Open

Blog post thumb images #108

mwhelan opened this issue Apr 4, 2014 · 15 comments

Comments

@mwhelan
Copy link

mwhelan commented Apr 4, 2014

I'm considering having a thumb image for each blog post to go with the excerpt on the main page. Is this something I can do currently with Snow? If not, can you recommend the best way to go about achieving it?

Thanks

@phillip-haydon
Copy link
Member

Hey,

A thumb image that is not part of the blog post itself? Something to show on the listing page only?

@mwhelan
Copy link
Author

mwhelan commented Apr 4, 2014

Yeah, exactly. I could choose a key image from each post and make it into a thumb image just for the listing page. Seems quite common on newspaper style blogs. The original large image would still be buried in the markdown somewhere.

@phillip-haydon
Copy link
Member

Hmmm interesting.

Maybe I can add a header property where you can specify a URL to an image.

The idea originally was that you could add your own properties to the header and they would just become dynamic properties of the Post that you can use for anything you want.

Maybe its time to implement it!

Basically you could do:

---
layout: post
title: My new blog post
excerptimage: /images/banana.jpg
banana: bananas are awesome
---

Then you could use it like:

post.excerptimage
post.banana.Default("If this doesn't exist")

@mwhelan
Copy link
Author

mwhelan commented Apr 4, 2014

Yeah, I like the idea of excerptimage on the post. That seems like a logical place to put it and would work well the way you've described.

It might also be useful to have excerpt itself be in the header too. I'm using the html comment now and it's working fine. However, you might not always want the first part of the post to be the excerpt. You might want to write a summary of the post that was different from the first paragraph. Also, some of my posts actually started off with an H1 "Introduction" which I had to delete. Not a big thing, but having the excerpt separate in the header would give maximum flexibility... What do you think?

@phillip-haydon
Copy link
Member

I should be able to get the dynamic stuff in tonight, that will at-least sort the image out for now.

Then I think what I can add is a split structure, so you can define a excerpt section.

i.e

Example 1

---
layout: post
title: My new blog post
---

---excerpt
Everything that goes here will be defined as the excerpt of your blog post...
---end

Everything defined here will be the actual blog post

Example 2

---
layout: post
title: My new blog post
excerptimage: /images/banana.jpg
---

Everything here is the blog post

And more content

<!--excerpt-->

And even more content...

MOAR content.

Example 1 gives you the flexibility to do what ever you want.

Example 2 allows for the normal way + the addition of properties you want to include.

@mwhelan
Copy link
Author

mwhelan commented Apr 4, 2014

That would be amazing! Thanks Phillip. Look forward to seeing it!

@phillip-haydon
Copy link
Member

NP, after these features I need to stop working on new stuff so I can get the SignalR / Owin middleware so the test server can auto update!

@phillip-haydon
Copy link
Member

Just an update. It's a little more work than I initially thought, since the views now need to use dynamic instead of the view models. So I need to make it backward compatible for existing blogs.

As a rough cut tho I have a basic scenario working.

@mwhelan
Copy link
Author

mwhelan commented Apr 11, 2014

Hey @phillip-haydon, thanks very much for getting the Excerpt functionality in so quickly. I look forward to trying it out.

To upgrade to this new version do I just compile the latest source and copy the new Snow.exe and Nancy .dlls into my blog's Snow_compiler folder, or is there some other upgrade path?

Thanks

@phillip-haydon
Copy link
Member

Hey,

I haven't done the dynamic property stuff yet, in the middle of refactoring, so that will be done tomorrow I hope. I've made 1 theme use dynamic and 1 use the models so I can ensure its backwards compatible.

The above discussed with

---
layout: post
title: My new blog post
---

---excerpt
Everything that goes here will be defined as the excerpt of your blog post...
---end

Everything defined here will be the actual blog post

Is implemented.

To use it, just compile (release mode so its a little faster), and copy the Snow.exe and Nancy*.dlls and drop them in the _compile file (just as you thought)

And away you go!

Because I haven't done a LOT of testing yet (cos I haven't released into the Theme branch) make sure you backup the old _compile just in case it fails.

Any issues, let me know!

@mwhelan
Copy link
Author

mwhelan commented Apr 11, 2014

No problems. I applied the new excerpt syntax to my posts and it all compiled and ran just as expected. I was a bit worried I might have accidentally left the old syntax in for some posts and what might happen with both excerpt styles in the same post. Perhaps that's a test to add....

Thanks again.

@phillip-haydon
Copy link
Member

When you use the new syntax, it sets the excerpt for the Post

If the ContentExcerpt is null or empty, only then will it attempt to use the old syntax of <!--excerpt-->

So it wont hurt at all or have any weird results.

@mwhelan
Copy link
Author

mwhelan commented Apr 11, 2014

Awesome! :-)

@phillip-haydon
Copy link
Member

Just looking at your blog, if you haven't seen already, may be able to take advantage of the Series feature in the future!

https://github.com/Sandra/Sandra.Snow/wiki/Series

:)

@mwhelan
Copy link
Author

mwhelan commented Apr 11, 2014

Thanks! Yeah, it's on my list to look at.

On Fri, Apr 11, 2014 at 10:52 AM, Phillip Haydon
notifications@github.comwrote:

Just looking at your blog, if you haven't seen already, may be able to
take advantage of the Series feature in the future!

https://github.com/Sandra/Sandra.Snow/wiki/Series

:)


Reply to this email directly or view it on GitHubhttps://github.com//issues/108#issuecomment-40187792
.

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

2 participants