earthlab / dev-earthlab-site

Development of active learning focused data intensive university classroom materials.
MIT License
0 stars 3 forks source link

Categories vs Collections to Sort content? #5

Closed lwasser closed 7 years ago

lwasser commented 7 years ago

Currently i'm using "tutorials to list tutorials on this site rather than blogposts. Need to sit down with @mbjoseph to assign a uniform category to all things "data-lesson" / code tutorial. I'm inclined to consider using data-lessons for everything that is a tutorial or classroom type of thing for the time being!

any thoughts on this, max?

mbjoseph commented 7 years ago

I think the answer depends on how we decide to build out our yaml frontmatter. Talk about it Monday?

lwasser commented 7 years ago

sounds good! talk later! I got the author code figured out on friday!! just 3 lines did the trick - i was making it way too complex before. :)

lwasser commented 7 years ago

@mbjoseph i just remembered why collections may be difficult for posts. if you want a list of "all stuff" it becomes more challenging to write the code that loops through 1. all collections and 2. all short tutorials, and then sorts then chronologically just with how liquid works. that is why i created a proper "post" page for each collection landing page.

You are then trying to list posts and pages into the same liquid loop.

Also - it becomes a bit tricky when you want to list all things authored by a person - to list both pages and posts UNLESS we don't care about date.

mbjoseph commented 7 years ago

It seems like we are likely to want "all stuff" or "all stuff authored by X" at some point.

What do you think about using posts with multiple categories instead of collections? For instance the front matter for your open science posts might be:

...
categories: [tool, open science, classroom activity]
...

Then we have the option to generate pages that loop over all of the posts that match one of the categories to generate pages that show all lessons for the open science module, classroom activities, or tools via https://amakelov.github.io/2015/11/24/multiple-categories-for-jekyll-posts.html

We would also be able to more easily sort all the things by date or author since everything would be a post.

Would that work?

mbjoseph commented 7 years ago

^ would also make it easier to programmatically generate a list of authors for #4 , since everything would be in the same _posts directory.

lwasser commented 7 years ago

yes - agreed on all accounts. This is what i've done previously and i think it may be a better approach. collections are good for discrete sets of things. But this is why i created a post for the collection landing page which may or may not end up being useful.

So - we have categories: specific to the content type (ie how the page is designed)

 categories: [ tutorials, tools, blog-posts, event]

tags: an open framework for various types

tags: [open-science, class-activity, data] 

anything else?

language: [r, python, sql] 

anything else?

author: [author-one, author-two]
mbjoseph commented 7 years ago

Other than the usual suspects like title, layout, date, etc., we probably also could make use of:

library: [rgdal, spdep]
lwasser commented 7 years ago
---
layout: single
author: [Leah A. Wasser, Naupaka Zimmerman]
dateModified: 2016-06-17
title: 'Intro to Open Science'
excerpt: 'short description of page here'
categories: [tools, tutorial, event]
tags: [open-science, class-activity, data] 
software:
-lang: r 
  lib:
     -rgdal
     -raster
-lang: python
  lib:
     -h5py
     -gdal
sidebar:   <<- optional
  nav: 'open-science'
author_profile: false
comments: true
---
lwasser commented 7 years ago

@mbjoseph are you open to reassigning all blogposts --> tutorial for the time being? I then propose we keep class lessons in the tutorial category as well. I'll for the time being create collections for sub content within the lessons - we can pull them out down the road if we need to.

lwasser commented 7 years ago

yaml ---

- language: r
   - libraries:
        -rgdal
        -raster
lwasser commented 7 years ago

hey @mbjoseph i've tweaked the yaml yet again.

have a look at the site - and specifically the yaml here https://github.com/earthlab/dev-earthlab-site/blob/master/_posts/new-lessons/2016-10-07-example-yaml.md

---
layout: single
title: 'Title in Single Quotes'
authors: [Matt Oakley, Author Two]
category: [tutorials]
excerpt: 'Please write 1-3 sentence exerpt summarizing the tutorial here. '
sidebar:
  nav:
author_profile: false
comments: true
lang: [r, python]
lib: [base, rpy2, h5py]
---

Test out the side bar functionality and see if it works. Note - it's not styled yet, just functional (i hope) https://earthlab.github.io/dev-earthlab-site/tutorials/

The page that lists just R tutorials has aside bar with r packages. The page that lists all tutorials just has r and python (the languages). we could add tags to that if we want .

see what you think.

Also note - we need to add an "exerpt" yaml element so the post description is shorter! lemme know what you think. i'll style the sidebar when we r happy with the functionality.

lwasser commented 7 years ago

new note -- we will use excerpt in the xml feed as well. @mbjoseph please let me know if that language is ok OR if you'd rather us call it "description". here is what the basic feed looks like now:

https://earthlab.github.io/dev-earthlab-site/tutorial-feed.xml

mbjoseph commented 7 years ago

That sounds good - I have no preference between excerpt and description!

lwasser commented 7 years ago

ok. then let's leave it as is. excerpt will be the short description for the tutorial or page. In the case of the author pages - it could be their bio read in from a csv file if we have a bio (just an idea).

mbjoseph commented 7 years ago

New issue for bios? Seems like a separate thing from the front matter of posts.

lwasser commented 7 years ago

let's make a new issue for bios! i could see the bio being written into the excerpt for each author.md page and then rendered on the page accordingly . But this could be a nice feature - not one we need to go live!

lwasser commented 7 years ago

Ok -- can we close this issue at this point? the nested looping is driving me insane. i know there's a way to do it but i can't get it to work. what do you think @mbjoseph i could make a new issue as a future feature request. i posted on SO too.

mbjoseph commented 7 years ago

I think we can close it. Just to confirm, is this the final format for the yaml?

---
layout: single
title: 'Title in Single Quotes'
authors: [Matt Oakley, Author Two]
category: [tutorials]
excerpt: 'Please write 1-3 sentence exerpt summarizing the tutorial here. '
sidebar:
  nav:
author_profile: false
comments: true
lang: [r, python]
lib: [base, rpy2, h5py]
---
lwasser commented 7 years ago

Ok 2 questions.

  1. In the previous site I used the permalink element to specify the link. But w this site the file name determines the link. Is that correct?
  2. The libraries. I'm still working on the nested code but it's still causing issues. So are you OK with implementation for the next few months atleast?
mbjoseph commented 7 years ago

Yes to both questions! Do you have the stack overflow link?

lwasser commented 7 years ago

Yup!

http://stackoverflow.com/q/40362726/3908816

I've tried to restructure the yaml list on the page to

Tool: -lang: r Lib:[]

Too and got a bit further but still my brain is getting confused in all of the looping. No one has tried to answer it! L.

Leah A. Wasser

Director, Earth Analytics Education Initiative Earth Lab, CU Boulder twitter: @leahawasser


From: Max Joseph notifications@github.com Sent: Wednesday, November 2, 2016 11:31:30 AM To: earthlab/dev-earthlab-site Cc: Leah Wasser; Author Subject: Re: [earthlab/dev-earthlab-site] Categories vs Collections to Sort content? (#5)

Yes to both questions! Do you have the stack overflow link?

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/earthlab/dev-earthlab-site/issues/5#issuecomment-257938782, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHS3qlcR7cMFK7mpiFLVWnlgrxDNFDIiks5q6MjygaJpZM4KXdl_.

mbjoseph commented 7 years ago

I think we're good to close this, eh?

lwasser commented 7 years ago

Yippppeeeee!

From: Max Joseph notifications@github.com Reply-To: earthlab/dev-earthlab-site reply@reply.github.com Date: Wednesday, November 16, 2016 at 3:42 PM To: earthlab/dev-earthlab-site dev-earthlab-site@noreply.github.com Cc: Leah Wasser Leah.Wasser@Colorado.EDU, Author author@noreply.github.com Subject: Re: [earthlab/dev-earthlab-site] Categories vs Collections to Sort content? (#5)

I think we're good to close this, eh?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/earthlab/dev-earthlab-site/issues/5#issuecomment-261096533, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHS3qpilgY7CPZhVSWMJ3EjFTrR3xHBGks5q-4bggaJpZM4KXdl_.