Working on making the now
page dynamic. I no longer want to manually update this page – the hassle makes me do this less often.
Working on making the now
page dynamic. I no longer want to manually update this page – the hassle makes me do this less often.
@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.
@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.
@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.
@amit Yeah, that’s what I was referring too. Too many unknowns with setting up individual integrations with the different services for one.
@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.
@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">
<h1 class="page-title">{{ .Title }}</h1>
{{ .Content }}
</div>
{{ end }}
Then add correct classes and extra content as desired.
@pratik Some encoding issues in that last code snippet there, but I think you can get the idea. Eliminate teh h1> type stuff.
@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?
@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.
@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.
@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.
@Mtt Nope. In the javascript files, one of the urls has a username for someone else. I changed it to mine and it worked.
@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
.
@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.