Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle website contacts dynamically #170

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

filippofontana
Copy link
Contributor

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:

  • layouts/partials/footer.html;
  • exampleSite/content/homepage/contact.md;

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.

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:
- `layouts/partials/footer.html`;
- `exampleSite/content/homepage/contact.md`;

Signed-off-by: Filippo Fontana <[email protected]>
@zjedi
Copy link
Owner

zjedi commented Mar 10, 2024

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

@zjedi zjedi merged commit 69acce5 into zjedi:master Mar 10, 2024
6 checks passed
@filippofontana filippofontana deleted the dynamic-contacts branch March 11, 2024 08:46
@dholbach
Copy link
Contributor

The phone link does not seem to work.

@zjedi
Copy link
Owner

zjedi commented Mar 16, 2024

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
Copy link
Contributor

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
Copy link
Owner

zjedi commented Mar 17, 2024

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
Copy link
Contributor Author

Yes of course, I’ll take a look.

@filippofontana
Copy link
Contributor Author

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
Copy link
Owner

zjedi commented Mar 17, 2024

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

@zjedi zjedi added this to the v2.0 milestone Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants