Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tlnagy committed Jul 19, 2017
0 parents commit 6f653e5
Show file tree
Hide file tree
Showing 26 changed files with 1,241 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
*.gem
.bundle
.sass-cache
_site
Gemfile.lock
2 changes: 2 additions & 0 deletions Gemfile
@@ -0,0 +1,2 @@
source "https://rubygems.org"
gemspec
21 changes: 21 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Tamas Nagy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
@@ -0,0 +1,48 @@
# jekyll-lab-notebook

Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes` and your sass in `_sass`. To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!

TODO: Delete this and the text above, and describe your gem

## Installation

Add this line to your Jekyll site's `Gemfile`:

```ruby
gem "jekyll-lab-notebook"
```

And add this line to your Jekyll site's `_config.yml`:

```yaml
theme: jekyll-lab-notebook
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install jekyll-lab-notebook

## Usage

TODO: Write usage instructions here. Describe your available layouts, includes, and/or sass.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hello. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## Development

To set up your environment to develop this theme, run `bundle install`.

Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.

When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.

## License

The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

84 changes: 84 additions & 0 deletions _includes/calfooter.html
@@ -0,0 +1,84 @@
<script type="text/javascript">

var data = {% listdays %};

var responsiveCal = function( options ) {
var now = new Date();
if ( $(window).width() < 730 ) {
options.start = now.setMonth(now.getMonth());
options.range = 1;
options.cellSize = 20;
} else if( $(window).width() < 1400 ) {
options.start = now.setMonth(now.getMonth() - 1);
options.range = 2;
options.cellSize = 23;
} else {
options.start = now.setMonth(now.getMonth() - 2);
options.range = 3;
options.cellSize = 23;
}

if( typeof cal === "object" ) {
$('#cal-heatmap').html('');
cal = cal.destroy();
}
cal = new CalHeatMap();
cal.init( options );

}
caloptions = {
itemSelector: "#cal-heatmap",
domain: "month",
subDomain: "x_day",
data: data,
dataType: "json",
cellPadding: 5,
domainGutter: 20,
displayLegend: false,
range: 4,
highlight: "now",
considerMissingDataAsZero:false,
domainDynamicDimension: true,
previousSelector: "#cal-heatmap-PreviousDomain-selector",
nextSelector: "#cal-heatmap-NextDomain-selector",
weekStartOnMonday:false,
domainLabelFormat: function(date) {
moment.locale("en");
return moment(date).format("MMMM").toUpperCase();
},
onClick: function(date, nb) {
year = date.getFullYear();
month = ("0"+(date.getMonth()+1)).slice(-2);
day = ("0" + date.getDate()).slice(-2);
if (nb > 0){
window.location.href = "/log/" + year + "_" + month + "/#" + year + month + day;
}
},
legendColors: {
min: "lightgrey",
max: "#2a7ae2",
empty: "lightgrey"
},
subDomainTextFormat: "%d",
legend: [0,1,2,3,4,5],
label: {
position: "top"
}
};


// run first time, put in load if your scripts are in footer
responsiveCal( caloptions );

$(window).resize(function() {
if(this.resizeTO) clearTimeout(this.resizeTO);
this.resizeTO = setTimeout(function() {
$(this).trigger('resizeEnd');
}, 500);
});

//resize on resizeEnd function
$(window).bind('resizeEnd', function() {
responsiveCal( cal.options );
});
</script>
35 changes: 35 additions & 0 deletions _includes/calheader.html
@@ -0,0 +1,35 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>

<style type="text/css">
.content {
min-width: 400px;
}
#calendar {
width: 700px;
}
.subdomain-text {
fill: #fff;
}
#calendar a {
color: #999;
}
@media all and (max-width:1400px) {
#calendar {
width: 500px;
}
}
@media all and (max-width:730px) {
#calendar {
width:365px;
}
}
@media all and (max-width:420px) {
#calendar {
width:191px;
}
}
</style>
44 changes: 44 additions & 0 deletions _includes/footer.html
@@ -0,0 +1,44 @@
<footer class="site-footer">

<div class="wrapper">

<div class="footer-col-wrapper">
<div class="footer-col footer-col-1">
<ul class="contact-list">
<li>
{% if site.author %}
{{ site.author | escape }}
{% else %}
{{ site.title | escape }}
{% endif %}
</li>
{% if site.email %}
<li><a href="mailto:{{ site.email }}">{{ site.email }}</a></li>
{% endif %}
</ul>
</div>

<div class="footer-col footer-col-2">
<ul class="social-media-list">
{% if site.github_username %}
<li>
{% include icon-github.html username=site.github_username %}
</li>
{% endif %}

{% if site.twitter_username %}
<li>
{% include icon-twitter.html username=site.twitter_username %}
</li>
{% endif %}
</ul>
</div>

<div class="footer-col footer-col-3">
<p>Built on {{ site.time | date: '%Y-%m-%d %T %Z'}}</p>
</div>
</div>

</div>

</footer>
21 changes: 21 additions & 0 deletions _includes/head.html
@@ -0,0 +1,21 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>
{{ site.short-title}} |
{% if page.date %}{{ page.date | date: "%B %Y" }}
{% elsif page.title %}{{ page.title | escape }}
{% else %}{{ site.title | escape }}{% endif %}
</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">

<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}">

{% if jekyll.environment == 'production' and site.google_analytics %}
{% include google-analytics.html %}
{% endif %}
</head>
15 changes: 15 additions & 0 deletions _includes/header.html
@@ -0,0 +1,15 @@
<header class="site-header" role="banner">

<div class="wrapper">
<a class="site-title" href="{{ "/" | relative_url }}">{{ site.title }}</a>

<nav class="site-nav">
<div class="trigger">
<a class="page-link" href="/projects">Projects</a>
<a class="page-link" href="/meetings">Meetings</a>
<a class="page-link" href="http://tamasnagy.com">tamasnagy.com</a>
</div>
</nav>

</div>
</header>
1 change: 1 addition & 0 deletions _includes/icon-github.html
@@ -0,0 +1 @@
<a href="https://github.com/{{ include.username }}"><span class="icon icon--github">{% include icon-github.svg %}</span><span class="username">{{ include.username }}</span></a>
1 change: 1 addition & 0 deletions _includes/icon-github.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions _includes/icon-twitter.html
@@ -0,0 +1 @@
<a href="https://twitter.com/{{ include.username }}"><span class="icon icon--twitter">{% include icon-twitter.svg %}</span><span class="username">{{ include.username }}</span></a>
1 change: 1 addition & 0 deletions _includes/icon-twitter.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions _layouts/default.html
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{% include head.html %}

<body>

{% include header.html %}

<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
</div>
</main>

{% include footer.html %}

</body>

</html>
65 changes: 65 additions & 0 deletions _layouts/home.html
@@ -0,0 +1,65 @@
---
layout: default
---
<head>
{% include calheader.html %}
<script type="text/javascript">

// stolen from here: https://stackoverflow.com/questions/688196/how-to-use-a-link-to-call-javascript
window.onload = function() {
// hides the element specified by data-target when a link is clicked
f = function() {
var button = document.getElementById(this.id);
target = document.getElementById(button.dataset.target)
if (target.style.display === 'block') {
target.style.display = 'none';
} else {
target.style.display = 'block';
}
return false;
}

document.getElementById("protocol-link").onclick = f;
document.getElementById("misc-link").onclick = f;
}
</script>
</head>
<p>{{ site.description | escape }}</p>
<div id="calendar" style="margin:0 auto;">
<div id="cal-heatmap"></div>
<div style="padding-top: 10px;">
<a href="#" style="margin-right:10px;" id="cal-heatmap-PreviousDomain-selector">&larr;</a>
<a href="#" style="float:right;" id="cal-heatmap-NextDomain-selector">&rarr;</a>
</div>
</div>
<div id="home">
<h1>Daily log</h1>
<ul class="posts">
{% for post in site.posts %}
<li><a href="{{ site.baseurl }}{{ post.url }}">{{ post.date | date: "%B %Y" }}</a></li>
{% endfor %}
</ul>

<h1><a id="protocol-link" data-target="protocol-list" href="#">Protocols</a></h1>
<div id="protocol-list">
<ul class="posts">
{% for page in site.pages %}
{% if page.url contains 'protocols/' %}
<li><a href="{{ site.baseurl }}{{ page.url }}">{{ page.title | escape }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>

<h1><a id="misc-link" href="#" data-target="misc-list">Miscellaneous</a></h1>
<div id="misc-list">
<ul class="posts">
{% for page in site.pages %}
{% if page.url contains 'random/' %}
<li><a href="{{ site.baseurl }}{{ page.url }}">{{ page.title | escape }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% include calfooter.html %}

0 comments on commit 6f653e5

Please sign in to comment.