Skip to content

Commit

Permalink
Added site basis
Browse files Browse the repository at this point in the history
  • Loading branch information
lmmx committed Aug 18, 2016
1 parent 4aad954 commit fb088f6
Show file tree
Hide file tree
Showing 81 changed files with 6,144 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.sass-cache
.jekyll-metadata
.DS_Store
s3_website.yml
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'jekyll'
gem 'jekyll-paginate'
gem 'jekyll-compose', group: [:jekyll_plugins]
50 changes: 50 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
GEM
remote: https://rubygems.org/
specs:
celluloid (0.16.0)
timers (~> 4.0.0)
colorator (0.1)
ffi (1.9.10)
hitimes (1.2.2)
jekyll (3.1.2)
colorator (~> 0.1)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-compose (0.4.1)
jekyll (>= 2.5.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-watch (1.2.1)
listen (~> 2.7)
kramdown (1.9.0)
liquid (3.0.6)
listen (2.10.1)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.15)
timers (4.0.1)
hitimes

PLATFORMS
ruby

DEPENDENCIES
jekyll
jekyll-compose
jekyll-paginate

BUNDLED WITH
1.11.2
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2016 Lau Siaw Young

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.
13 changes: 13 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: Immaculate
description: >
:beginner: Surveyal of computer vision
baseurl: "/flow"
url: "https://github.com/spin-systems/flow"
paginate: 4 # The number of posts to show per page on your homepage
name: "Louis Maddox"
markdown: kramdown
permalink: none
kramdown:
parse_block_html: true
gems:
- jekyll-paginate
3 changes: 3 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer class="site-footer">
<section class="copyright">All content copyright <a href="mailto:{{ site.email}}">{{ site.name }}</a> &copy; {{ site.time | date: '%Y' }} &bull; All rights reserved.</section>
</footer>
29 changes: 29 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<head>
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,minimum-scale=1">

<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">

<script type="application/ld+json">
{% include metadata.json %}
</script>

<style amp-custom>
{% capture include_to_scssify %}
{% include styles.scss %}
{% endcapture %}
{{ include_to_scssify | scssify }}
</style>



<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>

<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
10 changes: 10 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<header>
<div class="page-links">
<a class="page-link" href="{{ site.baseurl }}/">Home</a>
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a>
{% endif %}
{% endfor %}
</div>
</header>
30 changes: 30 additions & 0 deletions _includes/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": "{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}",
"headline": "{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}",
"datePublished": "{% if page.date %}{{ page.date | date_to_xmlschema }}{% else %}{{ site.time | date_to_xmlschema }}{% endif %}",
"dateModified": "{% if page.date %}{{ page.date | date_to_xmlschema }}{% else %}{{ site.time | date_to_xmlschema }}{% endif %}",
"description": "{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}",
"author": {
"@type": "Person",
"name": "{{ site.name }}"
},
"publisher": {
"@type": "Organization",
"name": "{{ site.title }}",
"logo": {
"@type": "ImageObject",
"url": "{{ site.logo | prepend: site.baseurl | prepend: site.url }}",
"width": 60,
"height": 60
}
},
"image": {
"@type": "ImageObject",
"url": "{{ site.logo | prepend: site.baseurl | prepend: site.url }}",
"height": 60,
"width": 60
}
}
45 changes: 45 additions & 0 deletions _includes/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

$baseurl: '{{ site.baseurl }}';
$grey-color: #828282;

@import 'tufte';
// @import 'syntax-highlighting';

main {
margin-top: 20px;
}

amp-img {
background-color: grey;
}

article {
padding: 2.5rem 0;
}

header {
margin-top: 20px;
}

.post-meta {
margin-top: 10px;
}

pre {
width: 52.5%;
padding-left: 2.5%;
overflow-x: auto;
}

@media (max-width: 760px) {
pre {
width: 90%;
padding: 0;
}
}

code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 1.125rem;
line-height: 1.6;
}
9 changes: 9 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
{% include header.html %}

{{ content }}
</body>
</html>
17 changes: 17 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
---

<article class="post">

<div class="post-meta">
<h1 class="post-title">{{ page.title }}</h1>
</div>

<section>
{{content}}
</section>

</article>

{% include footer.html %}
20 changes: 20 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: default
---

<article>

<h2 itemprop="name"><a href="{{ site.baseurl }}{{ post.url }}" itemprop="url">{{ page.title }}</a></h2>

<div class="post-meta">
<time datetime="{{ page.date | date_to_long_string }}">{{ page.date | date_to_long_string }}</time>
</div>

<section>
{{content}}
</section>

{% include footer.html %}

</div>
</article>
93 changes: 93 additions & 0 deletions _plugins/shortcodes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@

class ImageTag < Liquid::Tag
def initialize(tag_name, args, tokens)
super
@src, @width, @height, @option = args.split
end

def render(context)
if @option == 'fw'
<<-MARKUP.strip
<figure class="fullwidth"><amp-img width="#{@width}" height="#{@height}" layout="responsive" src="#{context["site"]["baseurl"]}#{@src}"></amp-img></figure>
MARKUP
elsif @option == 'raw'
<<-MARKUP.strip
<amp-img width="#{@width}" height="#{@height}" src="#{@src}"></amp-img>
MARKUP
else
<<-MARKUP.strip
<figure><amp-img width="#{@width}" height="#{@height}" layout="responsive" src="#{context["site"]["baseurl"]}#{@src}"></amp-img></figure>
MARKUP
end
end
end

class YoutubeTag < Liquid::Tag
def initialize(tag_name, args, tokens)
super
@youtube_id, @width, @height, @option = args.split
end

def render(context)
if @option == 'fw'
<<-MARKUP.strip
<figure class="fullwidth"><amp-youtube data-videoid="#{@youtube_id}" layout="responsive" width="#{@width}" height="#{@height}"></amp-youtube></figure>
MARKUP
elsif @option == 'raw'
<<-MARKUP.strip
<amp-youtube data-videoid="#{@youtube_id}" layout="responsive" width="#{@width}" height="#{@height}"></amp-youtube>
MARKUP
else
<<-MARKUP.strip
<figure><amp-youtube data-videoid="#{@youtube_id}" layout="responsive" width="#{@width}" height="#{@height}"></amp-youtube></figure>
MARKUP
end
end
end

class SideNoteTag < Liquid::Tag
def initialize(tag_name, args, tokens)
super
@tag_identifier = args.split[0]
@sidenote = args.split.drop(1).join(" ")
end

def render(context)
<<-MARKUP.strip
<span id="#{@tag_identifier}" class="margin-toggle sidenote-number"></span>
<span class="sidenote">#{@sidenote}</span>
MARKUP
end
end

class MarginNoteTag < Liquid::Block
def initialize(tag_name, args, tokens)
super
@tag_identifier = args.split[0]
end

def render(context)
<<-MARKUP.strip
<span class="marginnote">#{super.strip}</span>
MARKUP
end
end

class BlockQuoteTag < Liquid::Block
def initialize(tag_name, args, tokens)
super
@footer = args.strip
end

def render(context)
<<-MARKUP.strip
<blockquote><p>#{super.strip}</p><p class="footer">#{@footer}</p></blockquote>
MARKUP
end
end

Liquid::Template.register_tag('image', ImageTag)
Liquid::Template.register_tag('youtube', YoutubeTag)
Liquid::Template.register_tag('sidenote', SideNoteTag)
Liquid::Template.register_tag('marginnote', MarginNoteTag)
Liquid::Template.register_tag('blockquote', BlockQuoteTag)
Loading

0 comments on commit fb088f6

Please sign in to comment.