-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Refactor social links #141
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
Conversation
The |
Tested this locally. No major issues. Just one personal nit: Also, it'd be great if the |
583de67
to
9502938
Compare
Ok, I wouldn't know the reason for it so I can' defend it, but the SVG icons still work now after it's removed. 👍
Ok, I've taken a first pass at documenting them in a new section in the README. |
README.md
Outdated
instagram_username: ig | ||
linkedin_username: linkedin | ||
pinterest_username: pinterest | ||
stackoverflow_username: stackoverflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is documentation, I think we'll have to point to the right way as well.
e.g. StackOverflow profiles are located at users/
i.e. for username: minima
, the profile is actually at stackoverflow.com/users/[random]/minima
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'll try to improve them.
I forgot that Stack Overflow was like this. Unfortunately, the premise of these social links is that the username doubles as both the link and the link text. :-(
We could of course minimize to this:
stackover_username: 111111/jekyll
But the link text would still be 111111/jekyll unless it was filtered out. Maybe punt on Stackoverflow for now? See if people actually want it? Stack Overflow have their own flair badges anyway, see: https://stackoverflow.com/users/flair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not overly concerned about it. Just mentioned it as an afterthought.. 😃
997ee64
to
d423070
Compare
@ashawley, what do you think about changing the format entirely?
this is in line with minimalism and also will minimally alter the footer height with addition of multiple icons. |
d423070
to
f5a9da8
Compare
As a way to get around the stackoverflow issue? I guess that could work. I may not have the design expertise to make it work. I've rebased and resolved the latest conflicts. Do you want to fork this branch and give it a try in yet another PR? |
I started a discussion for Minima 3.0 to include breaking changes (such as the idea I proposed above)
That could lead to messy git history.. I'll start fresh. |
I'm just trying to get people's contributions across the finish line. I'm happy to clean up git history if that's what keeping this from getting merged. |
You misunderstood me. Hence starting fresh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few areas where you can optimize further
_includes/social.html
Outdated
@@ -0,0 +1,14 @@ | |||
<ul class="social-media-list"> | |||
{% if site.dribbble_username %}<li><a href="https://dribbble.com/{{ site.dribbble_username | cgi_escape | escape }}"><svg class="svg-icon" xmlns="http://www.w3.org/2000/svg"><use xlink:href="/assets/icons.svg#dribbble"></use></svg> <span class="username">{{ site.dribbble_username | escape }}</span></a></li>{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can cleanup further by removing xmlns="http://www.w3.org/2000/svg
. It will be used from icons.svg
anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I can do
about.md
Outdated
|
||
You can find the source code for Jekyll at | ||
{% include icon-github.html username="jekyll" %} / | ||
[jekyll](https://github.com/jekyll/jekyll) | ||
[github.com/jekyll/jekyll](https://github.com/jekyll/jekyll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't make a difference, but please replace this with text from Jekyll 3.5's about.md
template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll look in to changing the about page to be in line with jekyll.
assets/icons.svg
Outdated
@@ -0,0 +1,27 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |||
|
|||
<symbol id="dribbble" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8 16c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm6.747-6.905c-.234-.074-2.115-.635-4.257-.292.894 2.456 1.258 4.456 1.328 4.872 1.533-1.037 2.624-2.68 2.93-4.58zM10.67 14.3c-.102-.6-.5-2.688-1.46-5.18l-.044.014C5.312 10.477 3.93 13.15 3.806 13.4c1.158.905 2.614 1.444 4.194 1.444.947 0 1.85-.194 2.67-.543zm-7.747-1.72c.155-.266 2.03-3.37 5.555-4.51.09-.03.18-.056.27-.08-.173-.39-.36-.778-.555-1.16-3.413 1.02-6.723.977-7.023.97l-.003.208c0 1.755.665 3.358 1.756 4.57zM1.31 6.61c.307.005 3.122.017 6.318-.832-1.132-2.012-2.353-3.705-2.533-3.952-1.912.902-3.34 2.664-3.784 4.785zM6.4 1.368c.188.253 1.43 1.943 2.548 4 2.43-.91 3.46-2.293 3.582-2.468C11.323 1.827 9.736 1.176 8 1.176c-.55 0-1.087.066-1.6.19zm6.89 2.322c-.145.194-1.29 1.662-3.816 2.694.16.325.31.656.453.99.05.117.1.235.147.352 2.274-.286 4.533.172 4.758.22-.015-1.613-.59-3.094-1.543-4.257z"/></symbol> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can clean up further by removing symbol
attributes other than id
.
Its better to have viewBox
attribute defined per symbol. (Note: reconfirm if the resulting SVG paths are still aligned in the browser after you make the changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the consequences of this. This wasn't brought up in the previous review of the original PR. Can someone confirm? Otherwise, we can probably do a follow-up after this is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a valid reference pointing to the dire consequences of this, but irrespective of the decision, if you want a working demo you can checkout #146
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, I don't know SVG enough to know the consequence of the change, and the original poster, @domingohui, is out of radio contact to defend the original use of symbol
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from one other place you need to make an edit, this looks okay to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some suggestions. What do you think?
assets/icons.svg
Outdated
@@ -0,0 +1,27 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |||
|
|||
<symbol id="dribbble" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M8 16c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm6.747-6.905c-.234-.074-2.115-.635-4.257-.292.894 2.456 1.258 4.456 1.328 4.872 1.533-1.037 2.624-2.68 2.93-4.58zM10.67 14.3c-.102-.6-.5-2.688-1.46-5.18l-.044.014C5.312 10.477 3.93 13.15 3.806 13.4c1.158.905 2.614 1.444 4.194 1.444.947 0 1.85-.194 2.67-.543zm-7.747-1.72c.155-.266 2.03-3.37 5.555-4.51.09-.03.18-.056.27-.08-.173-.39-.36-.778-.555-1.16-3.413 1.02-6.723.977-7.023.97l-.003.208c0 1.755.665 3.358 1.756 4.57zM1.31 6.61c.307.005 3.122.017 6.318-.832-1.132-2.012-2.353-3.705-2.533-3.952-1.912.902-3.34 2.664-3.784 4.785zM6.4 1.368c.188.253 1.43 1.943 2.548 4 2.43-.91 3.46-2.293 3.582-2.468C11.323 1.827 9.736 1.176 8 1.176c-.55 0-1.087.066-1.6.19zm6.89 2.322c-.145.194-1.29 1.662-3.816 2.694.16.325.31.656.453.99.05.117.1.235.147.352 2.274-.286 4.533.172 4.758.22-.015-1.613-.59-3.094-1.543-4.257z"/></symbol> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_config.yml
Outdated
linkedin_username: jekyll | ||
pinterest_username: jekyll | ||
youtube_username: jekyll | ||
googleplus_username: +jekyll | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather only keep existing Jekyll accounts and leave other services commented to avoid unnecessary 404s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I agree. I had done that originally, but it got reverted while testing. Commenting them out again...
_includes/social.html
Outdated
{% if site.youtube_username %}<li><a href="https://youtube.com/{{ site.youtube_username | cgi_escape | escape }}"><svg class="svg-icon"><use xlink:href="/assets/icons.svg#youtube"></use></svg> <span class="username">{{ site.youtube_username | escape }}</span></a></li>{% endif %} | ||
{% if site.googleplus_username %}<li><a href="https://plus.google.com/{{ site.googleplus_username | escape }}"><svg class="svg-icon"><use xlink:href="/assets/icons.svg#googleplus"></use></svg> <span class="username">{{ site.googleplus_username | escape }}</span></a></li>{% endif %} | ||
{% if site.rss %}<li><a href="{{ site.baseurl }}/feed.xml"><svg class="svg-icon"><use xlink:href="/assets/icons.svg#rss"></use></svg> <span>{{ site.rss | escape }}</span></a></li>{% endif %} | ||
</ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rather loop on a social
array in the config to apply DRY principle here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be a breaking change.. which is being covered (differently albeit) in #146
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I think the point of this PR is to just add new sites, but not break the existing ones, Twitter and GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than introduce 10 new top-level config flags that we know we want to break, I'd rather we implement the social hash described in #146, and have a fallback to retain support for the old foo_username
syntax for the two existing ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Is that possible? What would it take to do? Just a squirrelly if-conditional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say the hash is assigned to variable called socials
, then I think the following will do fine:
{% assign github_user = social.github | default: site.github_username %}
<li><a>{{ github_user }}</a></li>
You can find the source code for the Jekyll new theme at: | ||
{% include icon-github.html username="jekyll" %} / | ||
You can find the source code for Minima at GitHub: | ||
[jekyll][jekyll-organization] / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That approach was changed upstream to allow users switch themes via GH-Pages.
But this about.md is specific to Minima.
It also serves as a showcase page for what Minima looks like when used with jekyll new --
Confusion.. confusion..
d4b4184
to
65aa56b
Compare
Are there any other corrections? It seemed like there was a lot of enthusiasm in the original PR for improving the social links in minima. |
Hi, |
I would think adding more social links wold be possible, but the hope (at least mine is) is that this initiative is on it's way to getting merged and then adding other social sites can be taken up later. The original work on this PR began almost 6 months ago so hopefully improved social links get incorporated. |
65aa56b
to
006a676
Compare
So the SVG files used to be an include file, but this PR makes it an asset file. Is there a risk of name collisions with an asset called |
ce30656
to
cf672b8
Compare
I've rebased with the latest master commits and added an entry to the release history file. Could this get merged, soon? People are requesting other social links, but this is blocking those questions. The last status report was Oct 25, 2017 |
This changes the documentation to match the version in _config.yml in jekyll#141.
Refactor social links
This changes the documentation to match the version in _config.yml in jekyll#141.
This makes the required consolidation of social links to a single file as suggested in #112.
It required removing the use of the templates on the about page. Hopefully, others aren't depending on it.