Skip to content

Instantly share code, notes, and snippets.

View navilan's full-sized avatar

Navilan navilan

View GitHub Profile
@navilan
navilan / enter_qwerty.txt
Created January 12, 2020 15:55
Kinesis Advantage 2
[caps]>[escape]
[lshift]>[=]
[up]>[obrack]
[down]>[cbrack]
[obrack]>[up]
[cbrack]>[down]
[scroll]>[shutdn]
[right]>[intl-\]
[left]>[`]
[intl-\]>[right]
#!/usr/bin/env awk -f
function rel2abs(req, dir, root)
{
"readlink --canonicalize " root|getline res
"sh -c \"cd " dir " && readlink --canonicalize " req "\""|getline resolved
gsub(res, "", resolved)
gsub(/^\//,"", resolved)
return resolved
}
diff --git a/content/media/js/meta.yaml b/content/media/js/meta.yaml
new file mode 100644
index 0000000..057bf05
--- /dev/null
+++ b/content/media/js/meta.yaml
@@ -0,0 +1 @@
+uses_template: False
diff --git a/layout/blog.j2 b/layout/blog.j2
index 8c3aec0..3697716 100644
--- a/layout/blog.j2
diff --git a/content/en/blog/index.html b/content/en/blog/index.html
index 9c7d08d..ff91543 100644
--- a/content/en/blog/index.html
+++ b/content/en/blog/index.html
@@ -7,8 +7,6 @@ paginator:
size: 10
file_pattern: page$PAGE$EXT
---
-{% set post_list = resource.page.posts %}
-
diff --git a/layout/blog-list.j2 b/layout/blog-list.j2
index 30175dd..214b0a3 100644
--- a/layout/blog-list.j2
+++ b/layout/blog-list.j2
@@ -1,5 +1,17 @@
{% extends "base.j2" %}
+{% set tag_dict = {} %}
+{% for tag, meta in site.tagger.tags %}
+ {% set tag_res = [] %}
diff --git a/layout/blog-list.j2 b/layout/blog-list.j2
index 30175dd..926434e 100644
--- a/layout/blog-list.j2
+++ b/layout/blog-list.j2
@@ -1,5 +1,16 @@
{% extends "base.j2" %}
+{% set tag_dict = {} %}
+{% for tag, meta in site.tagger.tags %}
+ {% set tag_res = [] %}
@navilan
navilan / base.j2.patch
Created October 30, 2015 13:47
hyde: Multilingual dynamic menu
diff --git a/layout/base.j2 b/layout/base.j2
index d2ad76b..4abfdf9 100644
--- a/layout/base.j2
+++ b/layout/base.j2
@@ -85,7 +85,8 @@
<ul class="nav navbar-nav pull-right">
{#{% for menu_item in site.content.child_nodes|sort(attribute='name') %}#}
{#{% if menu_item.name != "media" %}#}
- {% for menu_item in site.content.child_nodes|sort(attribute='name') %}
+ {% set lang_root = site.content.node_from_relative_path(resource.meta.language|default('en')) %}
@navilan
navilan / #how_to_test.md
Last active December 17, 2015 18:09
How to create draft posts using hyde.

This shows how to add draft posts feature to hyde. This will be a part of hyde 0.8.7.

Create a fresh hyde test site using hyde 0.8.6

mkdir ~/test_drafts
cd ~/test_drafts
hyde create
@navilan
navilan / how_to.md
Last active December 10, 2015 02:58
A simple plugin to rename file extensions. See: https://groups.google.com/forum/#!topic/hyde-dev/EtJ7bRUQEBA.

How to test:

  1. Create a new hyde site hyde -s test create
  2. Overwrite the generated site.yaml with the one in the gist
  3. Add site_plugins.py to the root folder
  4. Rename *.html under content to *.md
  5. Run hyde hyde gen -r