I’m currently building a site that will be have a linked list post type.
I specify the post type with type: "link" in a post’s front matter.
I have a layout for this like post type located in /layouts/link/single.html.
In each link post, I have a param linkurl that specifies an external link to link to. Is there a way to call this param in my index.html and insert it into the title of the post as the href destination?
This is what I have now, but of course it doesn’t work on index.html.
Hi, thanks for your reply. I am already using a range function to render posts on the homepage. I’m just having trouble rendering them the same way as single posts appear. For example, I’d like my post title to link to an external URL. This works fine on my single page, but I can’t figure out how to do that on the homepage. All the examples sites I’ve looked at display posts on the home page like below.
This displays my normal posts just fine, but doesn’t work for my link posts because of the {{ .Permalink }} parameter. For links posts, I want to somehow use a link parameter I have specified in the front matter. Is there a way to make that happen on the homepage?
I want to have two content types on my blog - post and link.
The post type is the usual blog post, nothing special.
The link type is meant to emulate a linkblog, where clicking the title will redirect to an external URL, which is specified in the frontmatter with a link param. This is all working fine on a linkblog posts’s single.html display.
What I’m having trouble with is figuring out how to get the external hyperlinked title to appear on the front page. Right now, I’m using this for my frontpage, which uses the post’s permalink as the destination for the title link.
What I’m trying to do is just display all posts without having to specify where the title link should go… in theory just keeping the same settings as single.html format.
In that instance, link is the name of my front matter variable. If yours is linkurl, use that instead.
And if you want any more assistance, please read Requesting Help. There is only so much we can do without a repo to look at and reproduce the issue you are having.