Skip to content

How to Add Social Icons to About Page and/or Footer? #459

Answered by Lruihao
pnwlover asked this question in Q&A
Discussion options

You must be logged in to vote

Well...There's no easier way to do this! Such so-called easier ways all involve complex processing done by those behind the scenes.

So, concerning your question, I have a piece of development advice.

  1. Create layouts/partials/custom/social-links.html in your project root, and insert the following content:

    <div class="social-links">
      {{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}}
      {{- $socialArr := slice -}}
      {{- range $key, $value := .Site.Params.social -}}
        {{- $social := $key | lower | index $socialMap | default dict -}}
        {{- if $value -}}
          {{- if reflect.IsMap $value -}}
            {{- with $value.weight -}}
              {{- $social = dict "Weight" …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@pnwlover
Comment options

Comment options

You must be logged in to vote
3 replies
@pnwlover
Comment options

@Lruihao
Comment options

@pnwlover
Comment options

Answer selected by pnwlover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Q&A question and answer
2 participants