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

Add instagram link along with the other social header links. #25

Open
somada141 opened this issue Mar 28, 2019 · 6 comments
Open

Add instagram link along with the other social header links. #25

somada141 opened this issue Mar 28, 2019 · 6 comments

Comments

@somada141
Copy link

Hi @eueung @dudil . Love the theme and decided to use it for my travel blog. However, I'd like to have an instagram link alongside the existing social links (twitter, FB, medium, etc) and I think it'd be a useful addition for others too.

I'm referring to the different header partials (eg https://github.com/eueung/hugo-casper-two/blob/master/layouts/partials/header.html#L22). Would that be possible?

Cheers!

@dixonge
Copy link

dixonge commented May 18, 2019

Since @eueung is absent, I suggest you simply copy header.html to your root hugo install under layouts/partials/ - then edit it to include an appropriate Instagram parameter. It will need a matching change inside of your main config.toml.

so in config.toml include something like igName = "" and in header.html copy one of the existing sections inside 'social links' and make it look like {{ if .Site.Params.igName }}<a class="social-link social-link-ig" href="https://www.instagram.com/{{ .Site.Params.igName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M19 6h5V0h-5c-3.86 0-7 3.14-7 7v3H8v6h4v16h6V16h5l1-6h-6V7c0-.542.458-1 1-1z"/></svg></a>{{end}}

You'll need to customize the CSS too, if you need something different for the 'social-link-ig' class...

@somada141
Copy link
Author

That's awesome thanks a lot @dixonge !

@somada141 somada141 reopened this May 19, 2019
@somada141
Copy link
Author

@dixonge actually won't that require overriding the *-sori-* header files too eg https://github.com/eueung/hugo-casper-two/blob/master/layouts/partials/header-sori.html#L25 or https://github.com/eueung/hugo-casper-two/blob/master/layouts/partials/header-sori-tag.html#L21 ?

Wil overriding header.html alone suffice?

@dixonge
Copy link

dixonge commented May 19, 2019

Yeah, actually - it looks like the .Site.Params code shows up in six different partial files - even if you don't use all of those you might as well change it everywhere, just in case. I use the awesome search/replace function of VS Code for this kind of thing.

@somada141
Copy link
Author

Hm since this is quite a large amount of overriding it might make sense to add it to the theme directly instead of overriding half of it. I've no issue doing it but it kinda defeats the purpose of the theme. Do you have write access to the repo @dixonge ? I could submit a PR instead but it seems there's a fair bit of PRs open currently so the repo seems rather inactive.

@ansin218
Copy link

ansin218 commented Oct 1, 2019

Jumping in a bit late here. However, the fix for this was simple.

I know this repository is dead and not maintained but in case if anyone is still looking on how to achieve this, my Pull Request is here: #32

Let me know if you folks need further help with other social media handles.

Repository owner deleted a comment Feb 2, 2024
Repository owner deleted a comment from H4wk-eye Feb 21, 2024
Repository owner deleted a comment from BDR-Pro Feb 23, 2024
Repository owner deleted a comment from DylanZhu2021 Feb 23, 2024
Repository owner deleted a comment from IT-Immanent Feb 28, 2024
Repository owner deleted a comment from uc-Pri Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@somada141 @dixonge @ansin218 and others