kc0bfv / autophugo

AutoPhugo [ˌɔtoʊˈfjuːgəʊ] is a gallery/photoblog theme for Hugo that's a little more automatic than Phugo.
Other
97 stars 56 forks source link

clarification / feature request => use custom link for images #36

Closed rawwerks closed 2 years ago

rawwerks commented 2 years ago

I love this theme! I want to use it to display my NFT art, ideally with a link for each image that goes to the corresponding page on OpenSea when the image is clicked. Is this possible with the current theme?

rawwerks commented 2 years ago

maybe something like this?

resources:
- src: ineffable0000.png
  alt: Ineffable 0000
  phototitle: Ineffable 0000
  description: Ineffable 0000
  link: https://opensea.io/assets/0x495f947276749ce646f68ac8c248420045cb7b5e/100630620674349904143765932308874882507547312145348185146979691623647111282689

just having trouble finding the best place to put that resource variable in the layouts & partials

rawwerks commented 2 years ago

i found a decent workaround. in case anyone else is interested in this:

 <a class="gallery-item" phototitle="<a href= {{ .linko }} target='_blank' > {{ .phototitle }} </a>"
                            description="<a href= {{ .linko }} target='_blank' > {{ .description }} </a>"
                            gallery_index="{{ .index }}"
                            id="{{ md5 $filename }}"
                            downloadable="{{ cond $downloadable "true" "false" }}"
                            {{- if $downloadable }}
                                download_file="{{ (cond $orig_download .orig .full).RelPermalink }}"
                            {{- end }}
                            orig_name="{{ $filename }}"
                            href="{{ .full.RelPermalink }}">
                        <div id="image_number_{{ .index }}" class="gallery-item-marker"></div>
                        <img src="{{ .thumb.RelPermalink }}"
                            {{ with .alt }} alt="{{ . }}"{{ end }}>
                    </a>

https://ineffable.vision is the site, if you want a live example.

kc0bfv commented 2 years ago

Yup - can do. I just made the description something interpreted as markdown. Now you can just set the description to a link, or partly a link like: description: 'Find this on OpenSea: [image link](https://example.com)'

Currently committed in cur_ver_release branch, will integrate with main soon.