forked from jenkins-infra/jenkins.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.haml
76 lines (66 loc) · 3.96 KB
/
index.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
layout: default
title: 'The Jenkins Blog'
section: blog
---
:ruby
page_count = page.posts ? page.posts.pages.size : 0
:ruby
tags = []
site.pages.reverse_each do |page|
# Some pages don't have tags
next if page.tags.nil?
next if page.layout != 'post'
page.tags.each do |tag|
# tag is an Awestruct::Extensions::Tagger::TagStat
next if tags.include?(tag.to_s)
tags << tag.to_s
end
end
tags = tags.sort_by {|obj| obj.to_s.downcase}
%div.app-blog-page
- if page.author
= partial("author.html.haml", :author => page.author, :blogroll => true)
- else
- if (page.posts&.current_page_index || 0) > 0
%p.blog-date
Page #{page.posts.current_page_index + 1}
%div.app-app-bar
%div.app-app-bar__content
%h1
%a{:href => '/blog/', :tabindex => -1}
The Jenkins Blog
%div.app-app-bar__controls.app-mobile-hide
%div{:class => page.selected_tag ? "app-button app-tags-picker app-tags-picker--active" : "app-button app-tags-picker"}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M435.25 48h-122.9a14.46 14.46 0 00-10.2 4.2L56.45 297.9a28.85 28.85 0 000 40.7l117 117a28.85 28.85 0 0040.7 0L459.75 210a14.46 14.46 0 004.2-10.2v-123a28.66 28.66 0 00-28.7-28.8z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="40"/><path d="M384 160a32 32 0 1132-32 32 32 0 01-32 32z" fill="currentColor" /></svg>
= page.selected_tag
%select{:id => 'tag-switcher'}
%option{:value => 'all', :selected => page.selected_tag == null ? true : null}
All
%optgroup{:label => 'Tags'}
- tags.each do |tag|
%option{:value => tag, :selected => page.selected_tag == tag.to_s ? true : null}
= tag.to_s
:javascript
$(document).ready(function() {
const tagSwitcher = document.querySelector("#tag-switcher");
tagSwitcher.addEventListener('change', () => {
const value = tagSwitcher.value;
window.location.href = value === 'all' ? `/blog/` : `/blog/tags/${tagSwitcher.value}/`;
})
});
%a{:href => "https://feeds.feedburner.com/ContinuousBlog/", :class => "app-button"}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="460px" height="460px" viewBox="0 0 460 460" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(56.440081, 56.222063)" stroke="currentColor"><path d="M51.8355914,263.237609 C60.9709503,263.260732 69.2414786,266.967806 75.2384778,272.952922 C81.2358437,278.938404 84.9594026,287.202208 85.0001926,296.338927 C84.9725106,305.421743 81.2764727,313.639618 75.3166433,319.590173 C69.3466112,325.550914 61.1050301,329.236566 52.0036901,329.237536 C42.9023476,329.238505 34.6599806,325.554606 28.6886687,319.595137 C22.7173419,313.635654 19.017079,305.400589 18.9999666,296.299365 C18.9829135,287.198016 22.6522367,278.949119 28.6011501,272.967262 C34.5402452,266.995277 42.7514145,263.282855 51.8355914,263.237609 Z" stroke-width="38" fill-rule="nonzero"/><path d="M15.5639188,0 C189.695661,18.9886079 327.916779,157.508264 346.44594,331.777403" stroke-width="40" stroke-linecap="round"/><path d="M16.5639188,121.777403 C126.781388,133.796328 214.269067,221.472967 225.997183,331.777403" stroke-width="40" stroke-linecap="round"/></g></g></svg>
%a{:href => "https://twitter.com/jenkinsci", :class => "app-button"}
= File.read("content/images/symbols/x.svg")
- if page.posts
= partial('blogcardlist.html.haml', :posts => page.posts)
- if page_count > 1
= partial('pagination.html.haml', :posts => page.posts)
- else
There are no blog posts by this author yet.
- if !page.author && !page.selected_tag
.app-events-container
%h2.app-events__heading
Upcoming events
= partial('events.html.haml')