Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Mattia Iavarone | b6947c6267 | 5 years ago |
@ -1 +1,4 @@ |
||||
View on GitHub: <a href="{% if site.codeurl %}{{ site.codeurl }}{% else %}{{ site.baseurl }}{% endif %}">{{ site.title }}</a> or <a href="{{ site.baseurl }}{{ site.donateurl }}">donate</a> |
||||
<footer class="text-center py-3 border-top has-divider"> |
||||
<span>View on <a href="https://github.com/{{ site.author.github }}/{{ site.github_repo }}">GitHub</a> or become <a href="{{ site.baseurl }}{{ site.donateurl }}">a sponsor</a>!</span> |
||||
<span class="d-block">Made by <a href="{{ site.author.website }}">{{ site.author.name }}</a></span> |
||||
</footer> |
||||
|
@ -1,8 +1,7 @@ |
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_id }}"></script> |
||||
<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','//www.google-analytics.com/analytics.js','ga'); |
||||
ga('create', '{{ site.google_analytics_id }}', 'auto'); |
||||
ga('send', 'pageview'); |
||||
window.dataLayer = window.dataLayer || []; |
||||
function gtag(){dataLayer.push(arguments);} |
||||
gtag('js', new Date()); |
||||
gtag('config', '{{ site.google_analytics_id }}'); |
||||
</script> |
||||
|
@ -0,0 +1,21 @@ |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
|
||||
<meta name="theme-color" content="{{ site.color }}"> |
||||
<meta name="msapplication-navbutton-color" content="{{ site.color }}"> |
||||
<meta name="msapplication-TileColor" content="{{ site.color }}"> |
||||
<meta name="apple-mobile-web-app-capable" content="yes"> |
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> |
||||
|
||||
<meta name="description" content="{{ site.description }}"> |
||||
<meta name="google-site-verification" content="{{ site.google_site_verification }}" /> |
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> |
||||
|
||||
{% seo %} |
||||
|
||||
{% if site.google_analytics_id != "" %} |
||||
{% include google_analytics.html %} |
||||
{% endif %} |
@ -1,3 +1,21 @@ |
||||
<h4><a class="brand" href="{{ site.baseurl }}/home">{{ site.title }}</a> |
||||
{% if site.subtitle %}<small>{{ site.subtitle }}</small>{% endif %} |
||||
</h4> |
||||
<header class="text-center py-3 border-bottom has-divider"> |
||||
<!-- center --> |
||||
<img class="logo align-middle" alt="Logo" src="{{ site.baseurl }}/static/icon_foreground.png"/> |
||||
<a class="h3 mx-2 align-middle text-decoration-none" href="{{ site.baseurl }}/home">{{ site.title }}</a> |
||||
|
||||
<!-- left --> |
||||
<div class="left align-middle"> |
||||
<img class="drawer-toggle p-2 mx-2 d-md-none" |
||||
alt="Menu toggle" |
||||
src="{{ site.baseurl }}/icons/menu.svg" |
||||
onclick="document.getElementById('drawer').classList.toggle('drawer-closed');"/> |
||||
</div> |
||||
|
||||
<!-- right --> |
||||
<div class="right align-middle"> |
||||
<span class="version d-none d-sm-inline-block">latest: v{{ site.github_version }}</span> |
||||
<a class="p-2 mx-2" href="https://github.com/{{ site.author.github }}/{{ site.github_repo }}"> |
||||
<img alt="GitHub" src="{{ site.baseurl }}/icons/github.svg"> |
||||
</a> |
||||
</div> |
||||
</header> |
||||
|
@ -1,16 +1,41 @@ |
||||
<ul class="nav nav-pills nav-stacked"> |
||||
<ul id="navigation" class="py-4"> |
||||
<li><a href="{{ site.baseurl }}/home">Home</a></li> |
||||
{% for section in site.sections %} |
||||
{% assign attr = section[0] %} |
||||
{% assign label = section[1] %} |
||||
|
||||
<li class="mt-3"><h5 class="mt-0 mb-1">{{ label }}</h5> |
||||
<ul> |
||||
{% for page in site.categories[attr] %} |
||||
{% if forloop.first %} |
||||
<li class="nav-header">{{ label }}</li> |
||||
{% endif %} |
||||
<li data-order="{{ page.order }}"><a href="{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a></li> |
||||
<li class="pt-2 pb-2" data-order="{{ page.order }}"> |
||||
<a href="{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a> |
||||
</li> |
||||
{% endfor %} |
||||
</ul> |
||||
</li> |
||||
{% endfor %} |
||||
<!-- List additional links. It is recommended to add a divider |
||||
e.g. <li class="divider"></li> first to break up the content. --> |
||||
</ul> |
||||
<script> |
||||
/* find current item and make it active */ |
||||
const current = document.location.href; |
||||
const links = document.querySelectorAll('#navigation a'); |
||||
links.forEach((link) => { |
||||
if (current && link && current.endsWith(link.getAttribute('href'))) { |
||||
link.parentElement.classList.add('active') |
||||
} |
||||
}); |
||||
|
||||
/* reorder elements */ |
||||
const sections = document.querySelectorAll('#navigation ul'); |
||||
sections.forEach((section) => { |
||||
const entries = section.querySelectorAll('li'); |
||||
const ordered = []; |
||||
entries.forEach((entry) => { |
||||
const order = entry.getAttribute('data-order'); |
||||
ordered.push([entry, order]); |
||||
}); |
||||
ordered.sort((a, b) => a[1] - b[1]); |
||||
ordered.forEach((entry) => { |
||||
section.appendChild(entry[0]); |
||||
}) |
||||
}); |
||||
</script> |
||||
|
@ -1,117 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<meta name="viewport" content="width=device-width"> |
||||
|
||||
<title>{{ site.title }}{% if page.title %} | {{ page.title }}{% endif %}</title> |
||||
<meta name="description" content="{{ site.subtitle }}"> |
||||
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/syntax.css"> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css"> |
||||
|
||||
{% seo %} |
||||
</head> |
||||
<body> |
||||
|
||||
<div class="container"> |
||||
<div class="row"> |
||||
<div id="header" class="col-sm-12"> |
||||
{% include header.html %} |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row"> |
||||
{% assign post_count = site.posts|size %} |
||||
{% if site.navigation != 0 and site.navigation == 1 or post_count > 0 %} |
||||
<div id="navigation" class="col-sm-2"> |
||||
{% include navigation.html %} |
||||
</div> |
||||
|
||||
<div id="content" class="col-sm-10"> |
||||
{{ content }} |
||||
</div> |
||||
{% else %} |
||||
<div id="content" class="col-sm-12"> |
||||
{{ content }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{% if page.disqus == 1 %} |
||||
<div class="row"> |
||||
{% if site.navigation == 1 or post_count > 0 %} |
||||
<div id="navigation" class="col-sm-2"></div> |
||||
<div id="disqus" class="col-sm-10"> |
||||
{% include disqus.html %} |
||||
</div> |
||||
{% else %} |
||||
<div id="disqus" class="col-sm-12"> |
||||
{% include disqus.html %} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="row"> |
||||
<div id="footer" class="col-sm-12"> |
||||
{% include footer.html %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
function orderNav() { |
||||
var list, |
||||
section, |
||||
header, |
||||
sections = [], |
||||
lists = {}, |
||||
headers = {}; |
||||
|
||||
var locationObj = document.location.href; |
||||
|
||||
var navUl = document.querySelectorAll('#navigation ul')[0], |
||||
navLis = document.querySelectorAll('#navigation ul li'); |
||||
if (!navUl) return; |
||||
for (var i = 0; i < navLis.length; i++) { |
||||
var order, li = navLis[i]; |
||||
if (li.classList.contains('nav-header')) { |
||||
section = li.textContent || li.innerText; |
||||
sections.push(section); |
||||
headers[section] = li; |
||||
continue; |
||||
} |
||||
var link = li.childNodes[0]; |
||||
if (locationObj && link && locationObj.endsWith(link.getAttribute('href'))) { |
||||
li.classList.add('active'); |
||||
} |
||||
|
||||
if (!lists[section]) { |
||||
lists[section] = []; |
||||
} |
||||
order = parseFloat(li.getAttribute('data-order')) |
||||
lists[section].push([order, li]); |
||||
} |
||||
for (var i = 0; i < sections.length; i++) { |
||||
section = sections[i]; |
||||
list = lists[section].sort(function(a, b) { |
||||
return a[0] - b[0]; |
||||
}); |
||||
if (header = headers[section]) { |
||||
navUl.appendChild(header); |
||||
} |
||||
for (var j = 0; j < list.length; j++) { |
||||
navUl.appendChild(list[j][1]); |
||||
} |
||||
} |
||||
} |
||||
if (document.querySelectorAll) orderNav(); |
||||
</script> |
||||
{% if site.google_analytics_id != "" %} |
||||
{% include google_analytics.html %} |
||||
{% endif %} |
||||
</body> |
||||
</html> |
@ -1,43 +1,30 @@ |
||||
<!DOCTYPE html> |
||||
<html style="height:100%;width:100%;margin:0px;"> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<meta name="viewport" content="width=device-width"> |
||||
|
||||
{% include head.html %} |
||||
<title>{{ site.title }}</title> |
||||
<meta name="description" content="{{ site.subtitle }}"> |
||||
<meta name="google-site-verification" content="4x49i17ABIrSvUl52SeL0-t0341aTnWWaC62-FYCRT4" /> |
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="{{ site.baseurl }}/css/syntax.css"> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css"> |
||||
|
||||
{% seo %} |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/landing.css"> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/fonts_responsive.css"> |
||||
</head> |
||||
<body id="landing"> |
||||
<div class="container" align="center"> |
||||
<div> |
||||
<img src="static/icon_foreground.png" width="45%" style="max-width:400px"> |
||||
</div> |
||||
<div id="content"> |
||||
<body> |
||||
<div class="container p-5"> |
||||
<img class="d-block mx-auto" id="logo" src="{{ site.baseurl }}/static/icon_foreground.png" alt="Logo"> |
||||
<div class="text-center"> |
||||
<h1 id="title" class="display-2 font-weight-bold mt-2">{{ site.title }}</h1> |
||||
{{ content }} |
||||
</div> |
||||
<div class="row justify-content-sm-center"> |
||||
<div class="col-xs-12 col-sm-auto"><a href="home">Documentation</a></div> |
||||
<div class="col-xs-12 col-sm-auto"><a href="about/changelog">Changelog</a></div> |
||||
<div class="col-xs-12 col-sm-auto"><a href="{{ site.codeurl }}">GitHub</a></div> |
||||
<div class="col-xs-12 col-sm-auto"><a href="extra/donate">Support</a></div> |
||||
<div class="text-center"> |
||||
<a class="btn rounded-pill px-3 py-2 mx-2 mt-2" href="{{ site.baseurl }}/home">Documentation</a> |
||||
<a class="btn rounded-pill px-3 py-2 mx-2 mt-2" href="{{ site.baseurl }}/about/changelog">Changelog</a> |
||||
<a class="btn rounded-pill px-3 py-2 mx-2 mt-2" href="https://github.com/{{ site.author.github }}/{{ site.github_repo }}">GitHub</a> |
||||
<a class="btn rounded-pill px-3 py-2 mx-2 mt-2" href="{{ site.baseurl }}{{ site.donateurl }}">Support</a> |
||||
</div> |
||||
<br/> |
||||
<div class="row" id="screenshots"> |
||||
<div class="col-sm-4"><img src="static/screen1.png"></div> |
||||
<div class="col-sm-4"><img src="static/screen2.png"></div> |
||||
<div class="col-sm-4"><img src="static/screen3.png"></div> |
||||
<div class="row"> |
||||
<div class="col-12 col-sm-4 mt-4"><img class="img-fluid" src="{{ site.baseurl }}/static/screen1.png" alt="Screenshot 1"></div> |
||||
<div class="col-12 col-sm-4 mt-4"><img class="img-fluid" src="{{ site.baseurl }}/static/screen2.png" alt="Screenshot 2"></div> |
||||
<div class="col-12 col-sm-4 mt-4"><img class="img-fluid" src="{{ site.baseurl }}/static/screen3.png" alt="Screenshot 3"></div> |
||||
</div> |
||||
</div> |
||||
|
||||
{% if site.google_analytics_id != "" %} |
||||
{% include google_analytics.html %} |
||||
{% endif %} |
||||
</body> |
||||
</html> |
||||
|
@ -0,0 +1,37 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
{% include head.html %} |
||||
<title>{{ site.title }}{% if page.title %} | {{ page.title }}{% endif %}</title> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css"> |
||||
<link rel="stylesheet" href="{{ site.baseurl }}/css/fonts_responsive.css"> |
||||
</head> |
||||
<body> |
||||
{% include header.html %} |
||||
<div class="container-fluid container-md"> |
||||
<div class="row"> |
||||
<div id="drawer" class="col-md-3 px-4 border-right has-divider drawer drawer-closed"> |
||||
{% include navigation.html %} |
||||
</div> |
||||
<div class="col-12 col-md-9"> |
||||
<div class="content py-3 px-2"> |
||||
{{ content }} |
||||
</div> |
||||
{% if page.disqus == 1 %} |
||||
<div class="mt-4"> |
||||
{% include disqus.html %} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-12 p-0"> |
||||
{% include footer.html %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,65 @@ |
||||
:root { |
||||
--color-primary: #f76c16; |
||||
--color-primary-active: #e75c16; |
||||
--color-primary-hover: #d74c16; |
||||
--color-secondary: #f7a816; |
||||
--color-accent: #0e95e3; |
||||
--color-accent-light: #f5fcff; |
||||
--color-accent-dark: #0e3375; |
||||
--color-background: #FFFFFF; |
||||
--color-code: var(--color-primary); |
||||
--color-code-background: #f8f8f8; |
||||
--color-text-muted: #6c757d; |
||||
} |
||||
|
||||
body { |
||||
background-color: var(--color-background); |
||||
} |
||||
|
||||
a { |
||||
color: var(--color-primary); |
||||
} |
||||
|
||||
code, pre { |
||||
background-color: var(--color-code-background); |
||||
} |
||||
|
||||
:not(pre) > code { |
||||
color: var(--color-code); |
||||
} |
||||
|
||||
a:hover { |
||||
color: var(--color-primary-hover) !important; |
||||
} |
||||
|
||||
.btn-primary { |
||||
background-color: var(--color-primary) !important; |
||||
border-color: var(--color-primary) !important; |
||||
color: white !important; |
||||
} |
||||
|
||||
.btn-primary.active, .btn-primary:active { |
||||
background-color: var(--color-primary-active) !important; |
||||
border-color: var(--color-primary-active) !important; |
||||
} |
||||
|
||||
.btn-primary:hover { |
||||
background-color: var(--color-primary-hover) !important; |
||||
border-color: var(--color-primary-hover) !important; |
||||
color: white !important; |
||||
} |
||||
|
||||
.btn-outline-primary { |
||||
border-color: var(--color-primary) !important; |
||||
} |
||||
|
||||
.btn-outline-primary.active, .btn-outline-primary:active { |
||||
background-color: var(--color-primary-active) !important; |
||||
border-color: var(--color-primary-active) !important; |
||||
} |
||||
|
||||
.btn-outline-primary:hover { |
||||
border-color: var(--color-primary-hover) !important; |
||||
background-color: var(--color-primary-hover) !important; |
||||
color: white !important; |
||||
} |
@ -0,0 +1,33 @@ |
||||
@import url('https://fonts.googleapis.com/css?family=Lobster+Two:400i,700i|Roboto+Mono|Source+Sans+Pro:400,700&display=swap'); |
||||
@import "fonts_responsive.css"; |
||||
|
||||
:root { |
||||
--font-mono: 'Roboto Mono'; |
||||
--font-sans: 'Source Sans Pro'; |
||||
--font-display: 'Lobster Two'; |
||||
} |
||||
|
||||
* { |
||||
font-family: var(--font-sans), sans-serif; |
||||
font-weight: 400; |
||||
} |
||||
|
||||
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { |
||||
font-family: var(--font-display), cursive; |
||||
font-style: italic; |
||||
font-weight: 700 !important; |
||||
} |
||||
|
||||
h4, .h4, h5, .h5, h6, .h6 { |
||||
font-weight: 400; |
||||
} |
||||
|
||||
button, .btn { |
||||
font-family: var(--font-display), cursive !important; |
||||
font-style: italic !important; |
||||
font-weight: 700 !important; |
||||
} |
||||
|
||||
code, code * { |
||||
font-family: var(--font-mono) !important; |
||||
} |
@ -0,0 +1,34 @@ |
||||
/* https://christianoliff.com/blog/bootstrap-with-rfs */ |
||||
/* either apply after everything else or add !important here */ |
||||
@media (max-width: 1200px) { |
||||
legend { |
||||
font-size: calc(1.275rem + 0.3vw); |
||||
} |
||||
h1, .h1 { |
||||
font-size: calc(1.375rem + 1.5vw); |
||||
} |
||||
h2, .h2 { |
||||
font-size: calc(1.325rem + 0.9vw); |
||||
} |
||||
h3, .h3 { |
||||
font-size: calc(1.3rem + 0.6vw); |
||||
} |
||||
h4, .h4 { |
||||
font-size: calc(1.275rem + 0.3vw); |
||||
} |
||||
.display-1 { |
||||
font-size: calc(1.725rem + 5.7vw); |
||||
} |
||||
.display-2 { |
||||
font-size: calc(1.675rem + 5.1vw); |
||||
} |
||||
.display-3 { |
||||
font-size: calc(1.575rem + 3.9vw); |
||||
} |
||||
.display-4 { |
||||
font-size: calc(1.475rem + 2.7vw); |
||||
} |
||||
.close { |
||||
font-size: calc(1.275rem + 0.3vw); |
||||
} |
||||
} |
@ -0,0 +1,38 @@ |
||||
@import "fonts.css"; |
||||
@import "colors.css"; |
||||
|
||||
html { |
||||
width: 100%; |
||||
height: 100%; |
||||
margin: 0; |
||||
} |
||||
|
||||
body { |
||||
background: radial-gradient(ellipse, var(--color-secondary), var(--color-primary)) fixed !important; |
||||
} |
||||
|
||||
#logo { |
||||
width: 45%; |
||||
max-width: 340px; |
||||
} |
||||
|
||||
h1 { |
||||
color: white; |
||||
} |
||||
|
||||
p { |
||||
color: rgba(255, 255, 255, 0.7); |
||||
font-size: 1.2em; |
||||
line-height: 100%; |
||||
} |
||||
|
||||
.btn { |
||||
color: white !important; |
||||
background-color: rgba(240, 240, 240, 0.25); |
||||
font-size: 1.3em; |
||||
} |
||||
|
||||
.btn:hover { |
||||
color: white !important; |
||||
background-color: rgba(240, 240, 240, 0.4); |
||||
} |
@ -1,216 +1,274 @@ |
||||
@import url('https://fonts.googleapis.com/css?family=Calistoga|Roboto+Mono|Source+Sans+Pro:400,700&display=swap'); |
||||
@import "fonts.css"; |
||||
@import "colors.css"; |
||||
@import "syntax.css"; |
||||
|
||||
body { |
||||
font-weight: 400; |
||||
font-family: 'Source Sans Pro', sans-serif; |
||||
:root { |
||||
--color-footer: var(--color-code-background); |
||||
--color-table-head: var(--color-code-background); |
||||
--color-divider: rgba(230, 230, 230, 0.7); |
||||
--header-height: 65px; /* kind of */ |
||||
--cards-radius: 4px; |
||||
} |
||||
|
||||
h1, h2, h3, h4, h5, h6, th { |
||||
font-family: 'Calistoga', sans-serif; |
||||
html, body { |
||||
height: 100%; |
||||
} |
||||
|
||||
small { |
||||
font-weight: 400; |
||||
font-family: 'Source Sans Pro', sans-serif; |
||||
} |
||||
/* dividers */ |
||||
|
||||
pre, code, pre code { |
||||
border: none; |
||||
border-radius: 0; |
||||
background-color: #fafafa; |
||||
font-size: 0.8em; |
||||
.has-divider { |
||||
border-color: var(--color-divider) !important; |
||||
} |
||||
|
||||
.highlight { |
||||
background-color: #fafafa; |
||||
border-radius: 12px; |
||||
} |
||||
/* header */ |
||||
|
||||
pre { |
||||
font-size: 1em; |
||||
header { |
||||
background: radial-gradient(ellipse, var(--color-secondary), var(--color-primary)) fixed; |
||||
position: fixed; |
||||
top: 0; |
||||
width: 100%; |
||||
z-index: 10; |
||||
} |
||||
|
||||
code { |
||||
color: inherit; |
||||
font-family: 'Roboto Mono', monospace; |
||||
color: #dd2200; |
||||
header .left { |
||||
position: absolute; |
||||
left: 0; |
||||
top: 50%; |
||||
transform: translateY(-50%); |
||||
} |
||||
|
||||
a { |
||||
color: #0e95e3; |
||||
header .right { |
||||
position: absolute; |
||||
right: 0; |
||||
top: 50%; |
||||
transform: translateY(-50%); |
||||
} |
||||
|
||||
#header { |
||||
border-bottom: 1px solid #eee; |
||||
margin-bottom: 20px; |
||||
header a { |
||||
color: white !important; |
||||
} |
||||
|
||||
#header a:hover { |
||||
text-decoration: none; |
||||
header a:hover { |
||||
color: white !important; |
||||
} |
||||
|
||||
#content { |
||||
/* bigger font */ |
||||
font-size: 1.1em; |
||||
header .logo { |
||||
height: 32px; |
||||
width: auto; |
||||
} |
||||
|
||||
#content p { |
||||
/* spacing for all paragraphs */ |
||||
margin-top: 16px; |
||||
margin-bottom: 16px; |
||||
header .version { |
||||
font-size: 0.9em; |
||||
color: rgba(255, 255, 255, 0.8); |
||||
} |
||||
|
||||
#content ul li { |
||||
/* spacing for lists */ |
||||
margin-top: 8px; |
||||
margin-bottom: 8px; |
||||
body { |
||||
/* to offset wrt sticky header */ |
||||
padding-top: var(--header-height); |
||||
} |
||||
|
||||
#content h5 { |
||||
font-size: 1.1em; |
||||
/* footer */ |
||||
|
||||
footer { |
||||
background-color: var(--color-footer); |
||||
color: var(--color-text-muted); |
||||
font-size: 0.9em; |
||||
} |
||||
|
||||
#footer { |
||||
margin: 20px 0; |
||||
font-size: 0.85em; |
||||
color: #999; |
||||
text-align: center; |
||||
/* drawer */ |
||||
|
||||
.drawer-toggle:hover { |
||||
background-color: rgba(240, 240, 240, 0.25); |
||||
border-radius: 50%; |
||||
} |
||||
|
||||
#content > .page-header:first-child { |
||||
margin-top: 0; |
||||
@media (max-width: 768px) { |
||||
.drawer { |
||||
position: fixed; |
||||
top: 0; |
||||
left: 0; |
||||
width: 300px; |
||||
height: 100%; |
||||
overflow-x: hidden; |
||||
overflow-y: auto; |
||||
background-color: var(--color-background); |
||||
transition: transform 0.4s cubic-bezier(0.4, 0, 0, 1); |
||||
z-index: 5; |
||||
padding-top: var(--header-height); |
||||
} |
||||
|
||||
.drawer-closed { |
||||
transform: translateX(-100%); |
||||
} |
||||
} |
||||
|
||||
#content > .page-header:first-child h2 { |
||||
margin-top: 0; |
||||
@media (max-width: 480px) { |
||||
.drawer { |
||||
width: 100%; |
||||
} |
||||
} |
||||
|
||||
#content .page-subtitle { |
||||
font-size: 0.45em; |
||||
.drawer ul { |
||||
list-style: none; |
||||
margin: 0; |
||||
padding: 0; |
||||
line-height: 100%; |
||||
} |
||||
|
||||
#landing { |
||||
background: radial-gradient(ellipse, #f7a816, #f76c16) !important; |
||||
background-attachment: fixed !important; |
||||
.drawer a { |
||||
color: inherit; |
||||
} |
||||
|
||||
#landing h1 { |
||||
font-size: 10vw; |
||||
color: white; |
||||
margin-top: 16px; |
||||
margin-bottom: 0px; |
||||
letter-spacing: 0.04em; |
||||
font-weight: bold; |
||||
.drawer a:hover { |
||||
color: var(--color-primary-hover) !important; |
||||
} |
||||
|
||||
@media (min-width: 576px) { |
||||
#landing h1 { |
||||
font-size: 4em; |
||||
} |
||||
.drawer li.active a { |
||||
color: var(--color-primary); |
||||
position: relative; |
||||
} |
||||
|
||||
#landing p { |
||||
font-size: 1.2em; |
||||
color: rgba(255, 255, 255, 0.7); |
||||
margin: 8px; |
||||
max-width: 80%; |
||||
line-height: 100%; |
||||
/* .drawer li.active a:hover { |
||||
color: var(--color-primary-active) !important; |
||||
text-decoration: none; |
||||
} */ |
||||
|
||||
.drawer li.active { |
||||
position: relative; |
||||
} |
||||
|
||||
#landing a { |
||||
background-color: rgba(240, 240, 240, 0.3); |
||||
color: white; |
||||
border-radius: 24px; |
||||
padding: 10px 20px 10px 20px; |
||||
margin-top: 16px; |
||||
.drawer li.active::after { |
||||
content: ''; |
||||
display: inline-block; |
||||
font-family: 'Calistoga', sans-serif; |
||||
font-size: 1.1em; |
||||
position: absolute; |
||||
right: 0; |
||||
top: 50%; |
||||
transform: translateY(-50%); |
||||
width: 8px; |
||||
height: 8px; |
||||
background-color: var(--color-primary); |
||||
border-radius: 50%; |
||||
} |
||||
|
||||
#landing #screenshots img { |
||||
max-width: 100%; |
||||
padding: 12px; |
||||
/* tables */ |
||||
|
||||
table { |
||||
/* same margins that reboot gives to pre */ |
||||
margin-top: 0; |
||||
margin-bottom: 1rem; |
||||
border-collapse: collapse; |
||||
/* make it scrollable if needed */ |
||||
display: block; |
||||
overflow-x: auto; |
||||
} |
||||
|
||||
thead { |
||||
background-color: var(--color-table-head); |
||||
} |
||||
|
||||
#landing #screenshots { |
||||
margin-top: 24px; |
||||
margin-bottom: 24px; |
||||
th { |
||||
padding: 8px; |
||||
border: 1px solid var(--color-divider); |
||||
font-family: var(--font-display), sans-serif; |
||||
font-weight: 700; |
||||
} |
||||
|
||||
#navigation { |
||||
font-size: 1.0em; |
||||
td { |
||||
padding: 8px; |
||||
border: 1px solid var(--color-divider); |
||||
} |
||||
|
||||
#navigation li a { |
||||
padding-left: 16px; |
||||
padding-right: 16px; |
||||
border-radius: 32px; |
||||
/* page and content */ |
||||
|
||||
.content a, footer a { |
||||
color: var(--color-accent); |
||||
} |
||||
|
||||
#navigation li a:hover { |
||||
background: #fafafa; |
||||
.content a:hover, footer a:hover { |
||||
color: var(--color-accent) !important; |
||||
} |
||||
|
||||
#navigation li.active a { |
||||
background: #f76c16; |
||||
color: #FFFFFF; |
||||
.content ul { |
||||
padding-left: 24px; |
||||
} |
||||
|
||||
#navigation .nav-header { |
||||
padding-top: 16px; |
||||
padding-bottom: 4px; |
||||
padding-left: 0; |
||||
padding-right: 0; |
||||
.content blockquote { |
||||
background-color: var(--color-code-background); |
||||
border-radius: var(--cards-radius); |
||||
border-left: 4px; |
||||
border-left-style: solid; |
||||
border-left-color: var(--color-accent); |
||||
font-size: 0.9em; |
||||
color: var(--color-text-muted); |
||||
padding: 0.8rem; |
||||
/* text-align: justify; |
||||
position: relative; |
||||
padding: 0.5rem 32px 0.5rem 0.5rem; |
||||
text-justify: inter-word; */ |
||||
} |
||||
|
||||
.nav-header { |
||||
font-size: 1.1em; |
||||
cursor: default; |
||||
/* text-transform: uppercase; */ |
||||
font-weight: bold; |
||||
font-family: 'Calistoga', sans-serif; |
||||
/* .content blockquote::after { |
||||
content: '!'; |
||||
position: absolute; |
||||
top: 50%; |
||||
transform: translateY(-50%); |
||||
right: 16px; |
||||
font-size: 1rem !important; |
||||
font-weight: 700 !important; |
||||
color: var(--color-accent); |
||||
} */ |
||||
|
||||
.content blockquote p, .content blockquote ul { |
||||
margin: 0; |
||||
} |
||||
|
||||
body.rtl { |
||||
direction: rtl; |
||||
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 { |
||||
margin-top: 1.4rem; |
||||
margin-bottom: 0.8rem; |
||||
} |
||||
|
||||
body.rtl #header .brand { |
||||
float: right; |
||||
margin-left: 5px; |
||||
.page-header span { |
||||
font-size: 0.9em; |
||||
color: var(--color-text-muted); |
||||
} |
||||
body.rtl .row-fluid [class*="span"] { |
||||
float: right !important; |
||||
margin-left: 0; |
||||
margin-right: 2.564102564102564%; |
||||
|
||||
/* code */ |
||||
|
||||
pre { |
||||
border-radius: var(--cards-radius); |
||||
padding: 0.8rem; |
||||
font-size: 0.8rem !important; |
||||
line-height: 1.6; |
||||
} |
||||
body.rtl .row-fluid [class*="span"]:first-child { |
||||
margin-right: 0; |
||||
|
||||
:not(pre) > code { |
||||
border-radius: var(--cards-radius); |
||||
padding: 2px; |
||||
font-weight: 700 !important; |
||||
font-size: 0.8rem !important; |
||||
} |
||||
|
||||
body.rtl ul, body.rtl ol { |
||||
margin: 0 25px 10px 0; |
||||
.language-java, .language-xml, .language-groovy { |
||||
position: relative; |
||||
} |
||||
|
||||
table { |
||||
margin-top: 25px; |
||||
margin-bottom: 25px; |
||||
border: 1px solid #e5e5e5; |
||||
border-collapse: collapse; |
||||
.language-java::after, .language-xml::after, .language-groovy::after { |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
padding: 6px; |
||||
font-size: 0.65rem; |
||||
color: var(--color-text-muted); |
||||
} |
||||
|
||||
thead { |
||||
background-color: #f9f9f9; |
||||
.language-java::after { |
||||
content: 'java'; |
||||
} |
||||
|
||||
td { |
||||
padding: .25rem .5rem; |
||||
border: 1px solid #e5e5e5; |
||||
.language-xml::after { |
||||
content: 'xml'; |
||||
} |
||||
|
||||
th { |
||||
padding: 8px 12px; |
||||
border: 1px solid #e5e5e5; |
||||
font-weight: 400; |
||||
.language-groovy::after { |
||||
content: 'groovy'; |
||||
} |
||||
|
@ -1,61 +1,86 @@ |
||||
/* https://github.com/richleland/pygments-css/ */ |
||||
@import "colors.css"; |
||||
:root { |
||||
--syntax-muted: #999999; |
||||
--syntax-annotations: #a49848; |
||||
--syntax-keyword: #007020; |
||||
--syntax-operators: #606060; |
||||
--syntax-numbers: var(--syntax-keyword); |
||||
--syntax-xml-tags: var(--syntax-keyword); |
||||
} |
||||
|
||||
.highlight .c { color: var(--syntax-muted); font-style: italic } /* Comment */ |
||||
.highlight .ch { color: var(--syntax-muted); font-style: italic } /* Comment.Hashbang */ |
||||
.highlight .cm { color: var(--syntax-muted); font-style: italic } /* Comment.Multiline */ |
||||
.highlight .cp { color: var(--syntax-muted); } /* Comment.Preproc */ |
||||
.highlight .cpf { color: var(--syntax-muted); font-style: italic } /* Comment.PreprocFile */ |
||||
.highlight .c1 { color: var(--syntax-muted); font-style: italic } /* Comment.Single */ |
||||
.highlight .cs { color: var(--syntax-muted); background-color: #fff0f0 } /* Comment.Special */ |
||||
|
||||
.highlight .nt { color: var(--syntax-xml-tags); font-weight: bold } /* Name.Tag */ |
||||
.highlight .na { color: inherit; /* var(--color-accent) */ } /* Name.Attribute */ |
||||
.highlight .nf { color: inherit; /* var(--color-accent) */ } /* Name.Function */ |
||||
|
||||
.highlight .mb { color: var(--syntax-numbers) } /* Literal.Number.Bin */ |
||||
.highlight .mf { color: var(--syntax-numbers) } /* Literal.Number.Float */ |
||||
.highlight .mh { color: var(--syntax-numbers) } /* Literal.Number.Hex */ |
||||
.highlight .mi { color: var(--syntax-numbers) } /* Literal.Number.Integer */ |
||||
.highlight .mo { color: var(--syntax-numbers) } /* Literal.Number.Oct */ |
||||
|
||||
.highlight .nd { color: var(--syntax-annotations); } /* Name.Decorator */ |
||||
|
||||
.highlight .k { color: var(--syntax-keyword); font-weight: bold } /* Keyword */ |
||||
.highlight .kd { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Declaration */ |
||||
.highlight .kt { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Type */ |
||||
.highlight .kc { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Constant */ |
||||
.highlight .kn { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Namespace */ |
||||
.highlight .kp { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Pseudo */ |
||||
.highlight .kr { color: var(--syntax-keyword); font-weight: bold } /* Keyword.Reserved */ |
||||
|
||||
.highlight .s { color: var(--color-accent-dark); background-color: var(--color-accent-light); } /* Literal.String */ |
||||
.highlight .s1 { color: var(--color-accent-dark); background-color: var(--color-accent-light); } /* Literal.String.Single */ |
||||
.highlight .sa { color: var(--color-accent-dark) } /* Literal.String.Affix */ |
||||
.highlight .sb { color: var(--color-accent-dark) } /* Literal.String.Backtick */ |
||||
.highlight .sc { color: var(--color-accent-dark) } /* Literal.String.Char */ |
||||
.highlight .dl { color: var(--color-accent-dark) } /* Literal.String.Delimiter */ |
||||
.highlight .sd { color: var(--color-accent-dark); font-style: italic } /* Literal.String.Doc */ |
||||
.highlight .s2 { color: var(--color-accent-dark) } /* Literal.String.Double */ |
||||
.highlight .se { color: var(--color-accent-dark); font-weight: bold } /* Literal.String.Escape */ |
||||
.highlight .sh { color: var(--color-accent-dark) } /* Literal.String.Heredoc */ |
||||
.highlight .si { color: var(--color-accent-dark); font-style: italic } /* Literal.String.Interpol */ |
||||
.highlight .sx { color: var(--color-accent-dark) } /* Literal.String.Other */ |
||||
.highlight .sr { color: var(--color-accent-dark) } /* Literal.String.Regex */ |
||||
.highlight .ss { color: var(--color-accent-dark) } /* Literal.String.Symbol */ |
||||
|
||||
.highlight .o { color: var(--syntax-operators) } /* Operator */ |
||||
|
||||
.highlight .hll { background-color: #ffffcc } |
||||
.highlight { background: #ffffff; } |
||||
.highlight .c { color: #888888 } /* Comment */ |
||||
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ |
||||
.highlight .k { color: #008800; font-weight: bold } /* Keyword */ |
||||
.highlight .cm { color: #888888 } /* Comment.Multiline */ |
||||
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ |
||||
.highlight .c1 { color: #888888 } /* Comment.Single */ |
||||
.highlight .cs { color: #cc0000; font-weight: bold; /* background-color: #fff0f0 */ } /* Comment.Special */ |
||||
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ |
||||
.highlight .err { border: 1px solid #FF0000 } /* Error */ |
||||
.highlight .gd { color: #A00000 } /* Generic.Deleted */ |
||||
.highlight .ge { font-style: italic } /* Generic.Emph */ |
||||
.highlight .gr { color: #aa0000 } /* Generic.Error */ |
||||
.highlight .gh { color: #333333 } /* Generic.Heading */ |
||||
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ |
||||
.highlight .gr { color: #FF0000 } /* Generic.Error */ |
||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ |
||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */ |
||||
.highlight .go { color: #888888 } /* Generic.Output */ |
||||
.highlight .gp { color: #555555 } /* Generic.Prompt */ |
||||
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ |
||||
.highlight .gs { font-weight: bold } /* Generic.Strong */ |
||||
.highlight .gu { color: #666666 } /* Generic.Subheading */ |
||||
.highlight .gt { color: #aa0000 } /* Generic.Traceback */ |
||||
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ |
||||
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ |
||||
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ |
||||
.highlight .kp { color: #008800 } /* Keyword.Pseudo */ |
||||
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ |
||||
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ |
||||
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ |
||||
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ |
||||
.highlight .na { color: #336699 } /* Name.Attribute */ |
||||
.highlight .nb { color: #003388 } /* Name.Builtin */ |
||||
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ |
||||
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ |
||||
.highlight .nd { color: #555555 } /* Name.Decorator */ |
||||
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ |
||||
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ |
||||
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */ |
||||
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ |
||||
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */ |
||||
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ |
||||
.highlight .nv { color: #336699 } /* Name.Variable */ |
||||
.highlight .ow { color: #008800 } /* Operator.Word */ |
||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ |
||||
.highlight .gt { color: #0044DD } /* Generic.Traceback */ |
||||
.highlight .m { color: #40a070 } /* Literal.Number */ |
||||
.highlight .nb { color: #007020 } /* Name.Builtin */ |
||||
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ |
||||
.highlight .no { color: #60add5 } /* Name.Constant */ |
||||
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ |
||||
.highlight .ne { color: #007020 } /* Name.Exception */ |
||||
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ |
||||
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ |
||||
.highlight .nv { color: #bb60d5 } /* Name.Variable */ |
||||
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ |
||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */ |
||||
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ |
||||
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ |
||||
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ |
||||
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ |
||||
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ |
||||
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ |
||||
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ |
||||
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ |
||||
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ |
||||
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ |
||||
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ |
||||
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ |
||||
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ |
||||
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ |
||||
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ |
||||
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ |
||||
.highlight .vc { color: #336699 } /* Name.Variable.Class */ |
||||
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */ |
||||
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */ |
||||
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ |
||||
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ |
||||
.highlight .fm { color: #06287e } /* Name.Function.Magic */ |
||||
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ |
||||
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ |
||||
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ |
||||
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ |
||||
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ |
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 395 B |
@ -1,107 +0,0 @@ |
||||
#!/usr/bin/env ruby |
||||
|
||||
require 'date' |
||||
require 'optparse' |
||||
|
||||
options = { |
||||
# Expects to be in the bin/ sub-directory by default |
||||
:path => File.dirname(File.dirname(__FILE__)) |
||||
} |
||||
|
||||
parser = OptionParser.new do |opt| |
||||
opt.banner = 'usage: jekyll-page TITLE CATEGORY [FILENAME] [OPTIONS]' |
||||
opt.separator '' |
||||
opt.separator 'Options' |
||||
opt.on('-e', '--edit', 'Edit the page') do |edit| |
||||
options[:edit] = true |
||||
end |
||||
opt.on('-l', '--link', 'Relink pages') do |link| |
||||
options[:link] = true |
||||
end |
||||
opt.on('-p PATH', '--path PATH', String, 'Path to project root') do |path| |
||||
options[:path] = path |
||||
end |
||||
opt.separator '' |
||||
end |
||||
|
||||
parser.parse! |
||||
|
||||
title = ARGV[0] |
||||
category = ARGV[1] |
||||
filename = ARGV[2] |
||||
|
||||
# Resolve any relative links |
||||
BASE_DIR = File.expand_path(options[:path]) |
||||
POSTS_DIR = "#{BASE_DIR}/_posts" |
||||
PAGES_DIR = "#{BASE_DIR}/_pages" |
||||
|
||||
# Ensure the _posts directory exists (we are in the correct directory) |
||||
if not Dir.exists?(POSTS_DIR) |
||||
puts "#{POSTS_DIR} directory does not exists" |
||||
exit |
||||
end |
||||
|
||||
# Create _pages directory if it doesn't exist |
||||
if not Dir.exists?(PAGES_DIR) |
||||
Dir.mkdir(PAGES_DIR) |
||||
end |
||||
|
||||
if options[:link] |
||||
Dir.foreach(POSTS_DIR) do |name| |
||||
next if name[0] == '.' |
||||
nodate = name[/\d{4}-\d{2}-\d{2}-(?<rest>.*)/, 'rest'] |
||||
if File.symlink?("#{PAGES_DIR}/#{nodate}") |
||||
File.delete("#{PAGES_DIR}/#{nodate}") |
||||
end |
||||
abspath = File.absolute_path("#{POSTS_DIR}/#{name}") |
||||
File.symlink(abspath, "#{PAGES_DIR}/#{nodate}") |
||||
end |
||||
end |
||||
|
||||
if not title or not category |
||||
# This flag can be used by itself, exit silently if no arguments |
||||
# are defined |
||||
if not options[:link] |
||||
puts parser |
||||
end |
||||
exit |
||||
end |
||||
|
||||
if not filename |
||||
filename = title.downcase.gsub(/[^a-z0-9\s]/, '').gsub(/\s+/, '-') |
||||
end |
||||
|
||||
today=Date.today().strftime('%F') |
||||
now=DateTime.now().strftime('%F %T') |
||||
|
||||
filepath = "#{POSTS_DIR}/#{today}-#{filename}.md" |
||||
symlink = "#{PAGES_DIR}/#{filename}.md" |
||||
|
||||
if File.exists?(filepath) |
||||
puts "File #{filepath} already exists" |
||||
exit |
||||
end |
||||
|
||||
content = <<END |
||||
--- |
||||
layout: page |
||||
title: \"#{title}\" |
||||
category: #{category} |
||||
date: #{now} |
||||
--- |
||||
END |
||||
|
||||
File.open(filepath, 'w') do |file| |
||||
file.puts content |
||||
end |
||||
|
||||
File.symlink("../_posts/#{today}-#{filename}.md", symlink) |
||||
|
||||
if options[:edit] |
||||
if not ENV['EDITOR'] |
||||
puts 'No $EDITOR variable set' |
||||
exit |
||||
end |
||||
puts ENV['EDITOR'] |
||||
exec("#{ENV['EDITOR']} #{filename}") |
||||
end |
Loading…
Reference in new issue