kishaningithub / hugo-creative-portfolio-theme

Port of the creative portfolio theme to Hugo
https://themes.gohugo.io/hugo-creative-portfolio-theme/
MIT License
447 stars 292 forks source link

Using a shortcode embed with showonlyimage type content #79

Open aniongithub opened 4 years ago

aniongithub commented 4 years ago

If I want to use this theme to display mixed content from different sites, I can't use

image = "{{< instagram B7aPuynpswZ >}}"

I'd also be ok with something like

embed = "{{< instagram B7aPuynpswZ >}}"

to create nice looking cards with embedded content that don't have a title or other superfluous items. The embedded content currently also gets cropped due to padding.

I've messed around a ton with the template (as might be evident from the time of this post :smile: ), but I can't seem to figure this out. Halp?

aniongithub commented 4 years ago

I can tell that this probably has to do with how this line uses the image metadata to directly fill in the img src, but I don't know enough Hugo to actually generate a shortcode instead of the img src in a separate if statement

{{ if and (isset .Params "embed") .Params.embed }}
    ?? Generate shortcode with .Params.embed here
{{ end }}

Since the content will have its own hyperlinking, I don't care about ahref-ing that content to its own detail page.