diff options
author | Bing-Sheng Chen <gundamew@gmail.com> | 2018-07-02 13:04:22 +0300 |
---|---|---|
committer | Bing-Sheng Chen <gundamew@gmail.com> | 2018-07-02 13:04:22 +0300 |
commit | 526000eee2ec55e6dff00b80af14a2074dc93f06 (patch) | |
tree | c0cf53bfb41fec34de0d4b99d484fb3f931b361e | |
parent | a57bbfe5b8b2a7bb10dccdf6e33109048171b241 (diff) |
Support Gravatar and social media icons
-rw-r--r-- | layouts/_default/social-links.html | 30 | ||||
-rw-r--r-- | layouts/index.html | 16 | ||||
-rw-r--r-- | static/css/style.css | 10 | ||||
-rw-r--r-- | static/img/facebook.svg | 1 | ||||
-rw-r--r-- | static/img/github.svg | 1 | ||||
-rw-r--r-- | static/img/instagram.svg | 1 | ||||
-rw-r--r-- | static/img/linkedin.svg | 1 | ||||
-rw-r--r-- | static/img/medium.svg | 1 | ||||
-rw-r--r-- | static/img/twitter.svg | 1 |
9 files changed, 51 insertions, 11 deletions
diff --git a/layouts/_default/social-links.html b/layouts/_default/social-links.html new file mode 100644 index 0000000..b6b1b22 --- /dev/null +++ b/layouts/_default/social-links.html @@ -0,0 +1,30 @@ +{{ with .Site.Params.github }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://github.com/{{ . }}"> + <img src="{{ "/img/github.svg" | absURL }}" alt="github"> + </a> +{{ end }} +{{ with .Site.Params.linkedin }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://www.linkedin.com/in/{{ . }}"> + <img src="{{ "/img/linkedin.svg" | absURL }}" alt="linkedin"> + </a> +{{ end }} +{{ with .Site.Params.medium }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://medium.com/{{ . }}"> + <img src="{{ "/img/medium.svg" | absURL }}" alt="medium"> + </a> +{{ end }} +{{ with .Site.Params.twitter }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://twitter.com/{{ . }}"> + <img src="{{ "/img/twitter.svg" | absURL }}" alt="twitter"> + </a> +{{ end }} +{{ with .Site.Params.facebook }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://facebook.com/{{ . }}"> + <img src="{{ "/img/facebook.svg" | absURL }}" alt="facebook"> + </a> +{{ end }} +{{ with .Site.Params.instagram }} + <a class="link dim gray dib h2 w2 br-100 mr3" href="https://instagram.com/{{ . }}"> + <img src="{{ "/img/instagram.svg" | absURL }}" alt="instagram"> + </a> +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 27c7d92..212ade7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,15 @@ {{ define "main" }} <main class="lh-copy"> - {{ .Content }} + <div class="dt"> + <div class="dtc w4 pr4 v-mid"> + <img src="https://www.gravatar.com/avatar/{{ md5 .Site.Params.email }}?s=240&d=mp" class="w-100 db br-100" alt="gravatar"> + </div> + <div class="dtc v-top"> + {{ .Content }} + {{ .Render "social-links" }} + </div> + </div> + <div class="mv4"> <h2 class="f4">Recent Posts</h2> <ul class="list pa0"> @@ -12,10 +21,5 @@ {{ end }} </ul> </div> - <div class="tc"> - {{ range .Site.Menus.social }} - <a class="link dim dark-blue f5 dib ph2" href="{{ .URL | relURL }}">{{ .Name }}</a> - {{ end }} - </div> </main> {{ end }} diff --git a/static/css/style.css b/static/css/style.css index 024060b..4ae049a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -4,15 +4,15 @@ blockquote { padding: .5rem 1rem; } -/* Override highlighter styles */ +/* Override highlighting styles */ .chroma { - border-radius: 4px; + border-radius: .25rem; } .chroma .lntd:first-child { - padding-left: .4rem; - padding-right: .8rem; + padding-left: .5rem; + padding-right: 1rem; } .chroma .ln, @@ -20,7 +20,7 @@ blockquote { opacity: .5; } -/* Copied from TACHYONS */ +/* Copied from TACHYONS styles */ a { color: #00449e; diff --git a/static/img/facebook.svg b/static/img/facebook.svg new file mode 100644 index 0000000..f55ef35 --- /dev/null +++ b/static/img/facebook.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-facebook-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-facebook-icon">Facebook icon</title><path d="M22.676 0H1.324C.593 0 0 .593 0 1.324v21.352C0 23.408.593 24 1.324 24h11.494v-9.294H9.689v-3.621h3.129V8.41c0-3.099 1.894-4.785 4.659-4.785 1.325 0 2.464.097 2.796.141v3.24h-1.921c-1.5 0-1.792.721-1.792 1.771v2.311h3.584l-.465 3.63H16.56V24h6.115c.733 0 1.325-.592 1.325-1.324V1.324C24 .593 23.408 0 22.676 0"/></svg>
\ No newline at end of file diff --git a/static/img/github.svg b/static/img/github.svg new file mode 100644 index 0000000..2f9e2d9 --- /dev/null +++ b/static/img/github.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-github-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-github-icon">GitHub icon</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
\ No newline at end of file diff --git a/static/img/instagram.svg b/static/img/instagram.svg new file mode 100644 index 0000000..a0fed10 --- /dev/null +++ b/static/img/instagram.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-instagram-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-instagram-icon">Instagram icon</title><path d="M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"/></svg>
\ No newline at end of file diff --git a/static/img/linkedin.svg b/static/img/linkedin.svg new file mode 100644 index 0000000..f8a94ef --- /dev/null +++ b/static/img/linkedin.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-linkedin-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-linkedin-icon">LinkedIn icon</title><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
\ No newline at end of file diff --git a/static/img/medium.svg b/static/img/medium.svg new file mode 100644 index 0000000..2635824 --- /dev/null +++ b/static/img/medium.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-medium-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-medium-icon">Medium icon</title><path d="M2.846 6.36c.03-.295-.083-.586-.303-.784l-2.24-2.7v-.403H7.26l5.378 11.795 4.728-11.795H24v.403l-1.917 1.837c-.165.126-.247.333-.213.538v13.5c-.034.204.048.41.213.537l1.87 1.837v.403h-9.41v-.403l1.937-1.882c.19-.19.19-.246.19-.538V7.794l-5.39 13.688h-.727L4.278 7.794v9.174c-.052.386.076.774.347 1.053l2.52 3.06v.402H0v-.403l2.52-3.06c.27-.278.39-.67.326-1.052V6.36z"/></svg>
\ No newline at end of file diff --git a/static/img/twitter.svg b/static/img/twitter.svg new file mode 100644 index 0000000..b674108 --- /dev/null +++ b/static/img/twitter.svg @@ -0,0 +1 @@ +<svg aria-labelledby="simpleicons-twitter-icon" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title id="simpleicons-twitter-icon">Twitter icon</title><path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>
\ No newline at end of file |