lol one does not simply…
I created layouts/shortcodes/test1-shortcode-test.html
:
{{ range .Site.Data.blogrolls.recommendations }}
<ul>
<li><a href="{{.url}}">{{ .name }}</a>: {{ .about }}</li>
</ul>
{{ end }}
which is the exact code I currently have in layouts/partials/microhook-archive-lead.html
. It works there.
Then I tried to make a post and use {{< test1-shortcode-test >}}
as short code. Nothing shows.
I’m thinking maybe I should just create the f file inside layout/partials
instead, will try this next.
edit:
OK, this seemed to have worked. I see the test shortcode list.
I don’t have descriptions (about field) on the test blog’s blogroll like I do on the main blog, so now. I’m going to replicate this process on my main blog… ![:crossed_fingers:t2: :crossed_fingers:t2:](https://help.micro.blog/images/emoji/twitter/crossed_fingers/2.png?v=12)
Not working… ![:confused: :confused:](https://help.micro.blog/images/emoji/twitter/confused.png?v=12)
I get an error - Theme error: Error building site: “content/blogroll.md:9:1”: failed to extract shortcode: template for shortcode “jtr_blogroll” not found. ( I called it differently on my main blog). I do have it under layouts/partials/jtr_blogroll.html
…any idea wahts’ going on?
…But it does… work? ![:expressionless: :expressionless:](https://help.micro.blog/images/emoji/twitter/expressionless.png?v=12)
After playing back and forth, recreating the page and trying another post, the error is gone and I can see my blogroll. What I think happens is that when I created the template, MB didn’t acdstually build it yet on the back end. After I deleted another post, the progress bar that shows you “now publishing changes to your blog” at the lower right went a bit slower, and what do you know, it’s there. So now MB actually created that template and it actually reads it.
Now sure why this happens - I could probably try to rebuild my site next time, but that seems a bit forced.
and now the site is broken ![:dizzy_face: :dizzy_face:](https://help.micro.blog/images/emoji/twitter/dizzy_face.png?v=12)
wanted to move the blogroll page out of the nav bar until I’m ready. Again, changes rolled way too fast, and no changes took place. So I decided to rebuild the site to force these changes…
…and got a “not found 404” for my main site, taonaw.com. Maybe this could have been a MB issue with pushing changes at the moment that I wasn’t aware of.
I gave up for now. I deleted the template I created and the blogroll page with the shortcode. Site is back up. Will wait for some feedback before I break more things.