Skip to content

Commit

Permalink
Small code modularization and aestherics improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
redtide committed Jun 7, 2019
1 parent 6b16911 commit 0007bcc
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 93 deletions.
9 changes: 0 additions & 9 deletions _assets/js/analytics.js

This file was deleted.

13 changes: 13 additions & 0 deletions _assets/js/scroll-to-top.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scrollButton").style.display = "block";
} else {
document.getElementById("scrollButton").style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
30 changes: 30 additions & 0 deletions _assets/scss/google-cse.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#searchresults {
.cse .gsc-control-cse,
.gsc-control-cse {
padding: 0;
}
.gcsc-branding,
.gsc-result-info,
.gsc-table-result,
.gsc-thumbnail-inside,
.gsc-url-top,
.gs-spelling,
.gs-promotion table {
padding-left: 0;
padding-right: 0;
}
.gsc-adBlock {
padding: 0;
}
.gsc-cursor {
font-size: 14px;
}
.gsc-cursor-page {
margin-left: -1px;
padding: 4px 10px;
border: 1px solid #ddd;
}
.gsc-results .gsc-cursor-box {
margin-top: 2em;
}
}
51 changes: 20 additions & 31 deletions _assets/scss/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
$blue: #337ab7;
$navbar-dark-color: rgba(#fff, .65);
$navbar-dark-hover-color: rgba(#fff, .90);
$navbar-dark-color: rgba(#fff, .75);
$navbar-dark-hover-color: #fff;

@import "../../node_modules/bootstrap/scss/bootstrap";
@import "syntax-highlight";
@import "google-cse";

/* Styles applied site-wide. */

Expand Down Expand Up @@ -38,33 +39,21 @@ th {
tr:nth-child(even) {
background-color: #f2f2f2;
}
#searchresults {
.cse .gsc-control-cse,
.gsc-control-cse {
padding: 0;
}
.gcsc-branding,
.gsc-result-info,
.gsc-table-result,
.gsc-thumbnail-inside,
.gsc-url-top,
.gs-spelling,
.gs-promotion table {
padding-left: 0;
padding-right: 0;
}
.gsc-adBlock {
padding: 0;
}
.gsc-cursor {
font-size: 14px;
}
.gsc-cursor-page {
margin-left: -1px;
padding: 4px 10px;
border: 1px solid #ddd;
}
.gsc-results .gsc-cursor-box {
margin-top: 2em;
}
#scrollButton {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 99;
font-size: 18px;
border: none;
outline: none;
background-color: rgba(255, 255, 255, 0.5);
color: rgba(0, 0, 0, 0.5);
cursor: pointer;
padding: 6px;
border-radius: 50%;
}
#scrollButton:hover {
background-color: rgba(255, 255, 255, 0.8);
}
24 changes: 21 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ defaults:
layout: "post"

exclude:
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
- Gemfile
- Gemfile.lock
- LICENSE
Expand All @@ -22,14 +26,28 @@ exclude:
- Rakefile
- README.md
- setup.sh
- assets/css/style.css
- TODO.md
- yarn.lock
- yarn-error.log
- assets/css/style.css

plugins:
- jekyll-sitemap

organization_name: SFZ Format

url: "https://sfzformat.github.io"

spdx_license_id: "MPL-2.0"

organization:
name: "SFZ Format"
url: "https://sfzformat.github.io"

authors:
content: "Karoryfer Samples and SFZ Format Team"
web: "RedTide and SFZ Format Team"

google:
analytics_code: UA-138937603-1
cse_code:

disqus_shortname:
8 changes: 8 additions & 0 deletions _includes/custom-scripts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script type="text/javascript" src="/assets/js/prettify/prettify.min.js"></script>
<script type="text/javascript" src="/assets/js/prettify/lang-sfz.js"></script>
<script>
$(document).ready(function(){
$('pre').addClass('prettyprint lang-sfz');
prettyPrint();
});
</script>
1 change: 1 addition & 0 deletions _includes/custom-styles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" type="text/css" href="/assets/css/prettify.css">
10 changes: 10 additions & 0 deletions _includes/favicons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Favicon Generator Icons -->
<link rel="apple-touch-icon" sizes="152x152" href="/assets/ico/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/ico/favicon-16x16.png">
<link rel="manifest" href="/assets/ico/site.webmanifest">
<link rel="mask-icon" href="/assets/ico/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/assets/ico/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/assets/ico/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
8 changes: 4 additions & 4 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<hr><footer>
<!-- p style="text-align:left;">&copy; {{ site.organization_name }} {{ site.time | date: "%Y" }}
<span style="float:right;"><a href="#top">Back to top</a></span></p-->
</footer>
<!--hr>
<footer>
<p style="text-align:left;">Copyright &copy; {{ site.time | date: "%Y" }} {{ site.organization.name }} Team</p>
</footer-->
10 changes: 10 additions & 0 deletions _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google.analytics_code }}', 'auto');
ga('send', 'pageview');
</script>
54 changes: 25 additions & 29 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<meta charset="utf-8">
<title>
{% if page.title %}
{{ page.title | escape }} - {{ site.organization_name }}
{% else %}
{{ site.organization_name }}
{% endif %}
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="{{ site.organization_name }}">
<meta charset="utf-8">

<link href="/atom.xml" rel="alternate" title="News" type="application/atom+xml" />
<title>
{%-if page.title-%}
{{ page.title | escape }} - {{ site.organization.name }}
{%-else-%}
{{ site.organization.name }}
{%-endif-%}
</title>

<link rel="apple-touch-icon" sizes="152x152" href="/assets/ico/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/ico/favicon-16x16.png">
<link rel="manifest" href="/assets/ico/site.webmanifest">
<link rel="mask-icon" href="/assets/ico/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/assets/ico/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/assets/ico/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
{% if site.authors.content %}<meta name="author" content="{{ site.authors.content }}">{% endif %}
{% if site.authors.web %}<meta name="web-author" content="{{ site.authors.web }}">{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if site.google.analytics_code %}{%-include google-analytics.html-%}{% endif %}
<!-- Atom Feeds -->
<link href="/atom.xml" rel="alternate" title="News" type="application/atom+xml" />

<link href="/assets/css/style.min.css" rel="stylesheet" media="screen">
{% for stylesheet in page.stylesheets %}
<link href="/assets/css/{{ stylesheet }}.css" rel="stylesheet">
{% endfor %}
<link rel="stylesheet" type="text/css" href="/assets/css/prettify.css">

<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/solid.js" integrity="sha384-+Ga2s7YBbhOD6nie0DzrZpJes+b2K1xkpKxTFFcx59QmVPaSA8c7pycsNaFwUK6l" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/brands.js" integrity="sha384-sCI3dTBIJuqT6AwL++zH7qL8ZdKaHpxU43dDt9SyOzimtQ9eyRhkG3B7KMl6AO19" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/fontawesome.js" integrity="sha384-7ox8Q2yzO/uWircfojVuCQOZl+ZZBg2D2J5nkpLqzH1HY0C1dHlTKIbpRz/LG23c" crossorigin="anonymous"></script>
{% include favicons.html %}
<!-- Stylesheets -->
<link href="/assets/css/style.min.css" rel="stylesheet" media="screen">
{%-for stylesheet in page.stylesheets-%}
<link href="/assets/css/{{ stylesheet }}.css" rel="stylesheet">
{% endfor %}
{% include custom-styles.html %}
<!-- Font Awesome Icons -->
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/solid.js" integrity="sha384-+Ga2s7YBbhOD6nie0DzrZpJes+b2K1xkpKxTFFcx59QmVPaSA8c7pycsNaFwUK6l" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/brands.js" integrity="sha384-sCI3dTBIJuqT6AwL++zH7qL8ZdKaHpxU43dDt9SyOzimtQ9eyRhkG3B7KMl6AO19" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/fontawesome.js" integrity="sha384-7ox8Q2yzO/uWircfojVuCQOZl+ZZBg2D2J5nkpLqzH1HY0C1dHlTKIbpRz/LG23c" crossorigin="anonymous"></script>
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% include navigation.html %}
{%-include navigation.html-%}
17 changes: 5 additions & 12 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<script src="/assets/js/scripts.min.js"></script>
{% for script in page.scripts %}
<script src="/assets/js/{{ script }}.js"></script>
{% endfor %}
<script type="text/javascript" src="/assets/js/prettify/prettify.min.js"></script>
<script type="text/javascript" src="/assets/js/prettify/lang-sfz.js"></script>
<script>
$(document).ready(function(){
$('pre').addClass('prettyprint lang-sfz');
prettyPrint();
});
</script>
<script src="/assets/js/scripts.min.js"></script>
{%-for script in page.scripts-%}
<script src="/assets/js/{{ script }}.js"></script>
{%-endfor-%}
{% include custom-scripts.html %}
8 changes: 4 additions & 4 deletions _includes/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

<script>
window.store = {
{% for page in site.pages %}
{%-for page in site.pages-%}
"{{ page.url | slugify }}": {
"title": "{{ page.title | xml_escape }}",{% assign lines = page.content | newline_to_br | split: '<br />' %}
"title": "{{ page.title | xml_escape }}",{%-assign lines = page.content | newline_to_br | split: '<br />'-%}
"content": {{ lines.first | strip_html | strip_newlines | jsonify }},
"url": "{{ page.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{%-unless forloop.last-%},{%-endunless-%}
{%-endfor-%}
};
</script>

0 comments on commit 0007bcc

Please sign in to comment.