jekyll-theme-hamilton 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42bdeffb4ae6b08b04c14534c27be8dc95b79120f4f059bec16e5e08c5a15c2a
4
- data.tar.gz: bf5ff5f7d32ba307fd9ce3e3020188b9ee2d6204572d98dead5e06c136eca620
3
+ metadata.gz: f4f676e533d624dc9ec9e904e70908b442a9a8e642fb8ac16a446ca30297562d
4
+ data.tar.gz: 257cf6ccbd3ec2b4ebd2f02ef168e939b412b13d70bd4c69bad99017068247b7
5
5
  SHA512:
6
- metadata.gz: 57ffc4c8843d390a08c8f51dfcc0519bd607c673167b4bd8aab5c4c7a6ebe104320e2794ca607348a6e57eb0b061763bba781234de187f023ecc4038066bf359
7
- data.tar.gz: 413df9789a645a2037271405447032a3cce57987606d19b5881f6bed8edb3c441d8b4850c7d5c176f7866b4ee88818d6c92b3048fc0cc7c52e27c40b8fdeccde
6
+ metadata.gz: f2b99330c99b36c56f9c41287a1bd3cf7dfaff135d341047526f233996f00bb76d64cccbc38b6533cc5e36d98f219ddcce3b9859df060902832c73aed6836162
7
+ data.tar.gz: 9a2f1dc978de613295899c0c3b5f6be6ae13b625cfe209fefe88e52ee19865ac4d33df6b184d0b5b2f096b16e1e4c8dc02cb4c421a7ff19145e47c7bc9092d68
data/README.md CHANGED
@@ -156,6 +156,23 @@ You can create a file `_data/navigation.yml` to configure links to some pages. F
156
156
  url: /tags/
157
157
  ```
158
158
 
159
+ The navigation bar also supports dropdown submenus:
160
+
161
+ ```yml
162
+ - title: About
163
+ url: /about/
164
+ - title: Categories
165
+ url: /categories/
166
+ - title: Tags
167
+ url: /tags/
168
+ - title: More
169
+ sublinks:
170
+ - title: FAQ
171
+ url: /faq/
172
+ - title: Docs
173
+ url: /docs/
174
+ ```
175
+
159
176
  ### Social Media
160
177
 
161
178
  You can create a file `_data/social.yml` to configure links to your social media. For example,
@@ -18,6 +18,10 @@
18
18
  </ul>
19
19
  </div>
20
20
 
21
+ <div class="footer-col">
22
+ <p>{{ site.description | escape }}</p>
23
+ </div>
24
+
21
25
  <div class="footer-col">
22
26
  <div class="copyright">
23
27
  {% assign year_from = site.posts[-1].date | date: '%Y' %}
@@ -35,11 +39,6 @@
35
39
  Powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/ngzhio/jekyll-theme-hamilton">Hamilton</a>
36
40
  </p>
37
41
  </div>
38
-
39
- <div class="footer-col">
40
- <p>{{ site.description | escape }}</p>
41
- </div>
42
-
43
42
  </div>
44
43
 
45
44
  {% if site.data.social %}
@@ -14,13 +14,24 @@
14
14
  </span>
15
15
  </label>
16
16
 
17
- <div class="trigger">
18
- {% for nav in site.data.navigation %}
19
- {% if nav.title %}
20
- <a class="page-link {% if page.url == nav.url %}current-page{% endif %}" href="{{ nav.url | relative_url }}">{{ nav.title | escape }}</a>
21
- {% endif %}
22
- {% endfor %}
23
- </div>
17
+ <ul class="trigger">
18
+ {%- for nav in site.data.navigation -%}
19
+ {%- if nav.title -%}
20
+ {% if nav.sublinks %}
21
+ <li class="dropdown" href="#">
22
+ <a href="javascript:void(0)" class="dropbtn">{{ nav.title | escape }}</a>
23
+ <div class="dropdown-content">
24
+ {%- for link in nav.sublinks %}
25
+ <a class="{% if page.url == link.url %}current-page{% endif %}" href="{{ link.url | relative_url }}">{{ link.title | escape }}</a>
26
+ {%- endfor %}
27
+ </div>
28
+ </li>
29
+ {% else %}
30
+ <li><a class="{% if page.url == nav.url %}current-page{% endif %}" href="{{ nav.url | relative_url }}">{{ nav.title | escape }}</a></li>
31
+ {% endif %}
32
+ {%- endif -%}
33
+ {%- endfor -%}
34
+ </ul>
24
35
  </nav>
25
36
  {% endif %}
26
37
  </div>
@@ -17,7 +17,7 @@ dl, dd, ol, ul, figure {
17
17
  */
18
18
  h1, h2, h3, h4, h5, h6,
19
19
  p, blockquote, pre,
20
- ul, ol, dl, figure,
20
+ ul, ol, dl, figure, iframe,
21
21
  %vertical-rhythm {
22
22
  margin-bottom: $spacing-unit;
23
23
  }
@@ -68,16 +68,36 @@
68
68
  padding-bottom: 5px;
69
69
  }
70
70
 
71
- .page-link {
72
- line-height: $base-line-height * $base-font-size * 1.15;
73
- display: block;
74
- padding: 5px 5px;
71
+ ul.trigger {
72
+ list-style-type: none;
73
+ margin: 0;
74
+ padding: 0;
75
+ overflow: hidden;
76
+
77
+ li a {
78
+ line-height: $base-line-height * $base-font-size * 1.15;
79
+ display: inline;
80
+ padding: 5px 10px;
81
+ margin-left: auto;
82
+ }
83
+
84
+ .dropdown-content {
85
+ display: none;
86
+ position: absolute;
87
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
88
+ z-index: 1;
89
+ }
90
+
91
+ .dropdown-content a {
92
+ padding: 5px 10px;
93
+ display: inline-block;
94
+ text-align: right;
95
+ margin-left: auto;
96
+ }
75
97
 
76
- // Gaps between nav items, but not on the last one
77
- &:not(:last-child) {
78
- margin-right: 0;
98
+ .dropdown:hover .dropdown-content {
99
+ display: block;
79
100
  }
80
- margin-left: 10px;
81
101
  }
82
102
 
83
103
  .current-page {
@@ -102,14 +122,29 @@
102
122
  display: block;
103
123
  }
104
124
 
105
- .page-link {
106
- display: inline;
107
- padding: 0;
125
+ ul.trigger {
126
+ li {
127
+ float: left;
128
+ }
129
+
130
+ li a {
131
+ display: inline-block;
132
+ text-align: center;
133
+ padding: 5px 5px;
134
+
135
+ // Gaps between nav items, but not on the last one
136
+ &:not(:last-child) {
137
+ margin-right: 0;
138
+ }
139
+ margin-left: 10px;
140
+ }
108
141
 
109
- &:not(:last-child) {
110
- margin-right: 10px;
142
+ .dropdown-content a {
143
+ display: block;
144
+ text-align: left;
145
+ padding: 5px 15px 5px 5px;
146
+ margin-left: 10px;
111
147
  }
112
- margin-left: auto;
113
148
  }
114
149
  }
115
150
  }
@@ -85,9 +85,13 @@ table {
85
85
  }
86
86
  }
87
87
 
88
- .page-link {
88
+ li a {
89
89
  color: $text-color;
90
90
  }
91
+
92
+ .dropdown-content {
93
+ background-color: $border-color-light;
94
+ }
91
95
  }
92
96
 
93
97
  .post-list {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-hamilton
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shangzhi Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-07 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  - !ruby/object:Gem::Version
156
156
  version: '0'
157
157
  requirements: []
158
- rubygems_version: 3.0.1
158
+ rubygems_version: 3.0.3
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: Another minimal style of Jekyll theme for writers