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

Resolved reformat of blog posts #232

Merged
merged 5 commits into from
Jan 2, 2016
Merged

Resolved reformat of blog posts #232

merged 5 commits into from
Jan 2, 2016

Conversation

phillipj
Copy link
Member

Hijacked PR #154 as it cannot be merged due to merge conflict issues and lack of response from the original authors.

This also needed cheerio added to package.json, which made the content generation to break. Not trying to make someone look bad, have forgot the same thing myself hundreds of times, but it highlights the need for smoketesting these PRs #225. That alert could have come from Travis when the initial PR was created, and of course prevented a bad merge & deploy.

UPDATED AFTER DISCUSSIONS BELOW

The original PR displayed title and first part of the blog post contents for all blog posts ever written. This PR adds pagination by year, and title + blog contents for the first 10 posts, followed by the remaining posts in that year by title only.

Screenshots showing (1) the first page of blog posts as of 2016, clicking "older" will take you to (2) all the blog posts of 2015 and (3) how blog posts look from the 10th posts and below.

1)

screen shot 2016-01-01 at 22 40 48

2)

screen shot 2016-01-01 at 22 40 59

3)

screen shot 2016-01-01 at 22 41 12

@phillipj
Copy link
Member Author

Btw the page of blog posts with these changes gets crazy long. Adding some kind of pagination later would be great!

@fhemberger
Copy link
Contributor

@phillipj Here is a pagination plugin for metalsmith: https://github.com/RobinThrift/metalsmith-paginate.

IMHO it would be nice to split blog posts into two groups:

  • Posts of the current year, using the long format proposed by this PR
  • Older posts, using the simple listing we had so far

both paginated. What do you think?

@phillipj
Copy link
Member Author

Nice, I'll have a look at that plugin @fhemberger 👍

@mrkiffie
Copy link
Contributor

I noticed that the summaries also contain the anchor links form the titles in the blog posts which I'm not sure is desirable. In addition, some of the posts have a significant document structure which doesn't really translate so well to a summary.

Here is a screenshot for reference:
blog post summary screenshot

I'm not sure if stripping the tags would suffice as a complete solution, but it could potentially clean up the presentation.

Perhaps an alternate implementation would be to use cheerio to specifically extract paragraphs?

@phillipj
Copy link
Member Author

Sorry for not getting any progress on pagination! I've tried different approaches with metalsmith-paginate, but can't get it working properly. Since I'm no metalsmith expert, time flies by while trying to wrap my head around what's happening and debug :(

* through the handlebars process and therefore has the
* entire page layout (w/<html>, <head> and <body> etc)
* wrapped around the actual blog contents :(
*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sums up my hours of trial'n'error to get this working.

@phillipj
Copy link
Member Author

Soooo... Basic pagination works now. It also exludes some specific tags to clean up the summary presentation as suggested by @mrkiffie.

skjermbilde 2015-11-18 kl 11 17 42

@phillipj
Copy link
Member Author

IMHO it would be nice to split blog posts into two groups

@fhemberger sounds like a very good idea! Would you consider it critical for the first release of this redesign or could post grouping be added later?

@fhemberger
Copy link
Contributor

I think it might be easier to start with a pagination by post year. Afterwards, try to get a different format for the current year. I have to look into this first, haven't had much time lately to look at the website issues here.

@phillipj
Copy link
Member Author

I assume you mean easier for the end-user? As technically I'm guessing we
would have to create a custom metalsmith paginator plugin for that, which
doesn't sound simpler.

On Wednesday, 18 November 2015, Frederic Hemberger notifications@github.com
wrote:

I think it might be easier to start with a pagination by post year.
Afterwards, try to get a different format for the current year. I have to
look into this first, haven't had much time lately to look at the website
issues here.


Reply to this email directly or view it on GitHub
#232 (comment).

@phillipj
Copy link
Member Author

phillipj commented Dec 1, 2015

Alright, I've been playing with this again. Started working on a metalsmith plugin which paginates by year. After seeing how many blog posts we have per year, it quickly became apparent we cannot show summary for all.

Some quick stats:

2011 had 48 blog posts
2012 had 59 blog posts
2013 had 55 blog posts
2014 had 25 blog posts
2015 had 76 blog posts

Currently working on display summary for the latest 10 blog posts per year, but only titles for the following posts. Hopefully be up-n-running by the end of this week.

@phillipj phillipj force-pushed the post-summary branch 3 times, most recently from 2c42375 to 33c92ec Compare December 4, 2015 21:23
@phillipj
Copy link
Member Author

phillipj commented Dec 4, 2015

All finished and ready to go. Ended up creating https://github.com/phillipj/metalsmith-yearly-pagination to do most of the grunt work.

PTAL

@phillipj
Copy link
Member Author

phillipj commented Jan 1, 2016

ping @fhemberger / anyone, got any thoughts on this? Just updated the PR description with up-to-date info and three screenshots.

I'd like to either merge or close this as it has been hanging around for quite some time now.

@ghost
Copy link

ghost commented Jan 1, 2016

@phillipj can you remove the standard list style formatting? i think it looks too 'vanilla html'

@phillipj
Copy link
Member Author

phillipj commented Jan 1, 2016

@sup sure, just pushed the changes and updated the screenshots

@ghost
Copy link

ghost commented Jan 1, 2016

yup, absolutely looks good to me! this has been mocking me for a longer time now, didn't know there was a PR for it. but from my side, we can merge

@fhemberger
Copy link
Contributor

@phillipj Looking at the screenshots and briefly scanning the code, it seems to be a neat solution. Sorry, I don't have much time for a deeper review ATM. So if no one objects, go for it.

With the new design on the blog post index,
listing all blog posts is not a viable option
anymore. This adds pagination by year and displaying
summary for the top 10 posts per page.
phillipj added a commit that referenced this pull request Jan 2, 2016
Resolved reformat of blog posts
@phillipj phillipj merged commit cbeb2a0 into master Jan 2, 2016
@phillipj phillipj deleted the post-summary branch January 2, 2016 19:34
@phillipj
Copy link
Member Author

phillipj commented Jan 2, 2016

Thanks for reviewing!

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

Successfully merging this pull request may close these issues.

5 participants