amit
amit

Working on making the now page dynamic. I no longer want to manually update this page – the hassle makes me do this less often.

|
Embed
Progress spinner
pratik
pratik

@amit Did you check out @mtt's homepage which is basically a Now page? I'm trying to create a Now page in your Musings theme with widgets that @mtt has created. Running into some code errors but will work on it next weekend.

This was one of the reasons I was exploring "excluding" or "only displaying" posts from a certain category. I want to write a post, categorize it with "Now" and have it display only posts from that category on the Now page. Only one post should be displayed on the Now page. That's how I envision the Now page to be updated with other widgets (movies, books, photos, bookmarks, etc.) at the bottom of that page.

|
Embed
Progress spinner
amit
amit

@pratik I did somehow manage to stitch a page which does that. The page lists the last 5 posts with the Now tag and a couple of list for last read books and watched movies (all credit to @mtt for the inspiration). But this hasn't been easy. I may have to let this settle to figure out if there's a simpler (pluginable?) way.

|
Embed
Progress spinner
pratik
pratik

@amit Yup. I tried it a bit yesterday for an hour or so but kept running into some error but yeah, a "pluginable" way would be great for us novices.

|
Embed
Progress spinner
Mtt
Mtt

@amit @pratik Let me know if I can help in anyway. I haven’t worked out how to turn into a plug-in or even a theme as of yet, not sure if it’s even possible.

|
Embed
Progress spinner
amit
amit

@Mtt I will give it try tomorrow to see if I can turn this into a plug-in. To be frank, the widgets look trickier. Other aspects might be possible, though. @pratik

|
Embed
Progress spinner
Mtt
Mtt

@amit Yeah, that’s what I was referring too. Too many unknowns with setting up individual integrations with the different services for one.

|
Embed
Progress spinner
amit
amit

@Mtt Yep, too many custom stuff here. A how-to of sorts might be easier.

|
Embed
Progress spinner
Mtt
Mtt

@amit Good call. May need to throw that together. Especially for ones that are fed with RSS.

|
Embed
Progress spinner
pratik
pratik

@Mtt @amit Not sure what I'm missing. Since Mb doesn't have a page template, I copied the layouts\single.html code into a new content\now.html as a base template.

But that in itself is throwing up a Error: Error building site: "/content/now.html:1:1": unmarshal failed: invalid character '{' looking for beginning of object key string before I start customizing it.

|
Embed
Progress spinner
ericgregorich
ericgregorich

@pratik It's a little more complicated than I thought it would be. I found a post here that has some suggestions. I'll need to play around with it more to figure it out.

|
Embed
Progress spinner
pratik
pratik

@ericgregorich How will the header and footer be referenced?

|
Embed
Progress spinner
Mtt
Mtt

@pratik Few things. The page content/now.html should be content/now.md (it is a markdown file, not HTML) and include type: now in the front matter. The actual layout page would be in layouts/now/single.html. Once that's setup, whatever you put in the .md file can be displayed by using {{ .Content }} in the layout. As an example, the html file could be:

{{ define "main" }}
<div class="page"&gt;
  <h1 class="page-title"&gt;{{ .Title }}</h1&gt;
  {{ .Content }}
</div&gt;
{{ end }}

Then add correct classes and extra content as desired.

|
Embed
Progress spinner
Mtt
Mtt

@pratik Some encoding issues in that last code snippet there, but I think you can get the idea. Eliminate teh h1&gt; type stuff.

|
Embed
Progress spinner
pratik
pratik

@Mtt Ah! I get it now. I'll try it out as soon as my son is done playing Minecraft

|
Embed
Progress spinner
pratik
pratik

@Mtt More Now questions. What do the two .js files in the *\js* folder do for the Pinboard display? Can I just create them in Mb like I did the .md file?

|
Embed
Progress spinner
Mtt
Mtt

@pratik You can duplicate those files into your theme but they need to exists as is. That’s what does the work of grabbing the bookmarks from pinboard.

|
Embed
Progress spinner
pratik
pratik

@Mtt Thanks. BTW in your github files, you still have the original Pinboard username in the pinboard.js file. Drove me nuts as to why it wasn't working until I changed that.

|
Embed
Progress spinner
Mtt
Mtt

@pratik Hmm. Do you mean in the partials? It has my username because what you're seeing on Github is the full live version of my site.

|
Embed
Progress spinner
pratik
pratik

@Mtt Nope. In the javascript files, one of the urls has a username for someone else. I changed it to mine and it worked.

|
Embed
Progress spinner
Mtt
Mtt

@pratik Alright, found what you were talking about. And that lead me down another rabbit hole. But in the end, I was able to simplify the Pinboard part even more. So fewer scripts and such than the original version. For your sake, I would just compare what you have with the modified files on Github and make the changes. Basically deleting a line on the pinboard partial and modifying one line on the pinboard.js.

|
Embed
Progress spinner
pratik
pratik

@Mtt Glad you found it ☺️ I have the movies, books, and Pinboard part working now. Thanks again.

I'll work on displaying the latest post in the “Now” category at the top of the page next. Maybe later, displaying the latest photo from my photo blog.

|
Embed
Progress spinner
Mtt
Mtt

@pratik Here ya go for Now category at top.

|
Embed
Progress spinner
In reply to
pratik
pratik

@Mtt wow! Thanks! I was hoping to work on it on the weekend 😀

|
Embed
Progress spinner