diff --git a/source/index.html.haml b/source/index.html.haml index 24a558e509b177b4d417e752425dad9e1c1c0acc..5cb99565ea0e2337d56830297bdaf22c096a85ee 100644 --- a/source/index.html.haml +++ b/source/index.html.haml @@ -33,5 +33,6 @@ per_page: 6 .col-md-9 = partial('shared/page_articles', locals: { page_articles: page_articles, paginate: paginate }) - -#.col-md-3 - -# {{> "tags"}} + .col-md-3 + = partial('shared/tags_nav', + locals: { blog: blog, selected_tag: 'all' }) diff --git a/source/shared/_tags_nav.haml b/source/shared/_tags_nav.haml new file mode 100644 index 0000000000000000000000000000000000000000..0917224bb361abfbe4bb4e8b710968f268761d88 --- /dev/null +++ b/source/shared/_tags_nav.haml @@ -0,0 +1,11 @@ +%nav.menu.tags + - if selected_tag == 'all' + %a.menu-item.selected{"data-slug" => "all", :href => "/"} All posts + - else + %a.menu-item{"data-slug" => "all", :href => "/"} All posts + + - blog.tags.each do |tag, articles| + - if selected_tag == tag + %a.menu-item.tag.selected{"data-slug" => tag, :href => tag_path(tag)}= tag + - else + %a.menu-item.tag{"data-slug" => tag, :href => tag_path(tag)}= tag