In html/about/index.html
:
{% extends "layouts/layout.njk" %}
{% set base_path = "../../" %}
{% set page_title = "about" %}
In data.json
:
In html/about/index.html
:
{% extends "layouts/layout.njk" %}
{% set base_path = "../../" %}
{% set page_title = "about" %}
In data.json
:
// | |
// Allows highlighting of code blocks in Nunjucks template. | |
// https://mozilla.github.io/nunjucks/api.html#custom-tags | |
// | |
const nunjucks = require('nunjucks'); | |
const hljs = require('highlight.js'); | |
function HighlightJsExtension() { | |
this.tags = ['highlightjs']; |
// Set cross-browser viewport height and width variable | |
viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | |
viewWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); |
{# Import macros for global use in all views #} | |
{% set components = {} %} | |
{% for component in macroFilePaths %} | |
{% import component as temp %}{% set macro = _.assign(components, temp) %} | |
{% endfor %} | |
{# end #} |
var manageEnvironment = function(environment) { | |
environment.addFilter("json", function(value) { | |
return JSON.parse(value); // convert the complete string imported by Nunjucks into JSON and return | |
}); | |
}; | |
gulp.task("nunjucks", function() { | |
// .njk files in pages | |
return ( | |
gulp |
<h1>Masonry - imagesLoaded progress, vanilla JS</h1> | |
<div class="grid"> | |
<div class="grid-sizer"></div> | |
<div class="grid-item"> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg" /> | |
</div> | |
<div class="grid-item"> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/submerged.jpg" /> | |
</div> |
gulp.task("watch-upload", function() { | |
gulp.watch("src/**/*", function(obj) { | |
if(["changed", "added"].indexOf(obj.type) !== -1) { | |
gulp.src(obj.path, {"base": "src/"}) | |
.pipe(sftp(config.sftp)); | |
} | |
}); | |
}); |
<!-- posts.json must be at root level --> | |
{{ $items := getJSON "posts.json" }} | |
{{ range $item := $items }} | |
<a href="{{ $item.url }}">{{ $item.name }}</a> | |
{{ end }} |
### Basic ### | |
# The directory to store the downloaded file. | |
dir=${HOME}/Downloads | |
# Downloads the URIs listed in FILE. | |
input-file=${HOME}/.aria2/aria2.session | |
# Save error/unfinished downloads to FILE on exit. | |
save-session=${HOME}/.aria2/aria2.session | |
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0 | |
save-session-interval=60 | |
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5 |