bowman2001 / perplex

A Hugo theme to publish technical content (docs, news, blog, articles)
https://perplex.desider.at
Apache License 2.0
30 stars 13 forks source link

For render-link page resources are not found #150

Closed danielfdickinson closed 10 months ago

danielfdickinson commented 10 months ago

This is due to the use of GetMatch here:

https://github.com/bowman2001/perplex/blob/7bc8b408286de158a06515e7d3a2d81b04a8a76b/layouts/_default/_markup/render-link.html#L149

Per the Hugo docs https://gohugo.io/content-management/page-resources/#pattern-matching

GetMatch requires a glob not an exact filename.

I attempted working around this by adding using [some tarball](some-tarball.tgz*) but that did not succeed.

A possible solution (which I have used in a render-hook I was using some time ago), is to replace:

{{- with $page.Resources.GetMatch $u.Path }}

with

{{- with $page.Resources.GetMatch (printf "*%s*" $u.Path) }}
danielfdickinson commented 10 months ago

Also, thank you for all your work!

bowman2001 commented 10 months ago

I can’t follow completely. The render-link does reference files correctly --- at least sometimes as you can see in the docs. This must be some special case.

Could you provide a link to the repository and a path to the folder with this problem?

danielfdickinson commented 10 months ago

I can't reproduce now; not sure what I must have been doing wrong before. Sorry for the noise.

bowman2001 commented 10 months ago

By the way: The layout for SVGs in card previews on your personal webpage princesandmadman would be improved by a current version of the theme.

And the custom CSS gets included now by the default template for CSS. So you should probably remove (or adapt) your local project version.

danielfdickinson commented 10 months ago

Thank you for reminding me; I had noticed the changes but had gotten distracted from doing the update.

Also, for the custom CSS on other repositories where I change the colour; is there any way to have PostCSS purgecss happen without customizing the css.html? I know I can get my un-purged color.css+screen.css by saying postcss: false but it would be nice to be able to do the PostCSS thing happening with custom colour scheme without customizing that file. Just wishlist though.

Also, FYI, I've converted the last of my sites, which is a documentation site more in line with the use case for which you originally designed the theme: It is at https://www.wildtechgarden.ca and the (Git-LFS) repo is at https://gitlab.com/danielfdickinson/pp-wildtechgarden .

I did have some misbehaving featured: icon situations with deeply nested pages, but a) I was in a hurry and haven't got reproducible use cases yet AND b) I probably ought to review the organization of site and move things around to not get so deep, anyway. So I haven't filed issues yet, and may just consider it my reminder to improve my organization.

Otherwise the theme has worked beautifully.