-
Notifications
You must be signed in to change notification settings - Fork 47
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
Remove inline JavaScript from header and replace it with Jekyll directive #18
Conversation
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.
Many thanks for your contribution 😃. I just have one minor formatting remark.
docs/_layouts/default.html
Outdated
@@ -35,7 +35,7 @@ | |||
</a> | |||
<a href="{{ site.baseurl }}/" alt="Hubble Enterprise"> | |||
<img src="{{ site.baseurl }}/assets/images/logo-title.svg" class="project-logo" width="3rem" height="3rem"> | |||
<h1 class="project-name"><script type="text/javascript">document.write(gheHostname())</script> Statistics</h1> | |||
<h1 class="project-name">{{ site.url | remove:'https://' }} Statistics</h1> |
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.
Could you plase add a space after the colon and put the https://
part in double quotes for consistency with the rest?
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.
Yes, I have updated the file with your requested changes.
I’m not sure whether it would also be good to entirely get rid of the @larsxschneider, @GitHugop: What do you guys think? |
docs/_layouts/default.html
Outdated
@@ -35,7 +35,7 @@ | |||
</a> | |||
<a href="{{ site.baseurl }}/" alt="Hubble Enterprise"> | |||
<img src="{{ site.baseurl }}/assets/images/logo-title.svg" class="project-logo" width="3rem" height="3rem"> | |||
<h1 class="project-name">{{ site.url | remove:'https://' }} Statistics</h1> | |||
<h1 class="project-name"> {{ site.url | remove:"https://" }} Statistics</h1> |
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.
Sorry for being ambiguous. I meant that a space should be inserted after remove:
like this: remove: "https://"
(and not in the beginning of the title). Could you change that?
I know I’m a bit pedantic, but I want to keep the coding style consistent as much as possible 😃.
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.
Many thanks!
Let’s wait for @larsxschneider to review and merge this. @larsxschneider: Do you think it would make sense to also evaluate the server name via Jekyll for the |
You welcome. Regarding the functions, I don't think it's a great idea to mix JavaScript files with Jekyll. Something that can be done is merging both functions into one, like:
|
docs/_layouts/default.html
Outdated
@@ -35,7 +35,7 @@ | |||
</a> | |||
<a href="{{ site.baseurl }}/" alt="Hubble Enterprise"> | |||
<img src="{{ site.baseurl }}/assets/images/logo-title.svg" class="project-logo" width="3rem" height="3rem"> | |||
<h1 class="project-name"><script type="text/javascript">document.write(gheHostname())</script> Statistics</h1> | |||
<h1 class="project-name">{{ site.url | remove: "https://" }} Statistics</h1> |
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.
Thank you 👍 ! Is there a way to handle http://
URLs, too? Some GitHub Enterprise installations use just HTTP 😢
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.
Wasn’t aware of this, good catch!
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.
Testing it out.
docs/_layouts/default.html
Outdated
@@ -35,7 +35,7 @@ | |||
</a> | |||
<a href="{{ site.baseurl }}/" alt="Hubble Enterprise"> | |||
<img src="{{ site.baseurl }}/assets/images/logo-title.svg" class="project-logo" width="3rem" height="3rem"> | |||
<h1 class="project-name"><script type="text/javascript">document.write(gheHostname())</script> Statistics</h1> | |||
<h1 class="project-name">{{ site.url | remove: "http://", "https://" }} Statistics</h1> |
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 get this error with Jekyll 3.3.1 locally:
Liquid Exception: Liquid error (line 38): wrong number of arguments (given 3, expected 2) in /_layouts/default.html
Any idea what to do about it?
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.
Seems like "remove" only supports 1 argument, there doesn't seem to be another way on the Jekyll docs. We can try using both "remove" and "remove_first".
Thank you @GitHugop ! 👍 👍 👍 @pluehne Yeah, we could use the same approach in |
Ref: #16
Uses site.url and removes the "https://" part.