zjedi / hugo-scroll

Clean, responsive, single-page Hugo website theme.
https://themes.gohugo.io/hugo-scroll/
MIT License
279 stars 199 forks source link

Handle website contacts dynamically #170

Closed filippofontana closed 8 months ago

filippofontana commented 8 months ago

Hi!

This commits change the way contacts params are handled: instead of declaring them statically, they are declared as an array of tables in the TOML configuration file, then they are displayed in the two sections (homepage and footer) of the website through the {{ range }} statement.

This makes handling multiple contacts params easier and avoids the need of changing manually this two files:

Of course this results in a breaking change for the template.

I think this new mechanism could be helpful when you need to add multiple contact options to the template.

zjedi commented 8 months ago

Looks good. I've branched off stable, just in case someone needs more compatible version.

dholbach commented 8 months ago

The phone link does not seem to work.

zjedi commented 8 months ago

The phone link does not seem to work.

I see, it looks like now you have to include the meta-info directly with the parameter value, check exampleSite/config.toml, does it work if you do it this way?

dholbach commented 8 months ago

It's broken in exampleSite as well. Just try this:

gh repo clone zjedi/hugo-scroll
cd hugo-scroll/exampleSite
sed -i 's/showContactIcons\ \=\ false/showContactIcons \= true/g' config.toml 
hugo server -t ../..

grafik

zjedi commented 8 months ago

I see, the phone link is broken the same way also in the contacts section. @filippofontana Any chance you would have a look at this?

filippofontana commented 8 months ago

Yes of course, I’ll take a look.

filippofontana commented 8 months ago

Sorry guys for this bug, I don't know how I was able to miss it 🥲.

See #173 and #174 to see how I solved it.

zjedi commented 8 months ago

looks fixed in the preview now, thanks for quick action :)