Skip to content

Commit adf2548

Browse files
committed
community page(tablet+mobile)
1 parent 84f44d5 commit adf2548

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1148
-263
lines changed

_includes/toc.html

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{% capture tocWorkspace %}
2+
{% comment %}
3+
Version 1.0.4
4+
https://github.com/allejo/jekyll-toc
5+
6+
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
7+
8+
Usage:
9+
{% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
10+
11+
Parameters:
12+
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13+
14+
Optional Parameters:
15+
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
16+
* class (string) : '' - a CSS class assigned to the TOC
17+
* id (string) : '' - an ID to assigned to the TOC
18+
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
19+
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
20+
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
21+
* item_class (string) : '' - add custom class for each list item; has support for '%level%' placeholder, which is the current heading level
22+
23+
Output:
24+
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only generate the table of contents and will NOT output the markdown given to it
25+
{% endcomment %}
26+
27+
{% capture my_toc %}{% endcapture %}
28+
{% assign orderedList = include.ordered | default: false %}
29+
{% assign minHeader = include.h_min | default: 1 %}
30+
{% assign maxHeader = include.h_max | default: 6 %}
31+
{% assign nodes = include.html | split: '<h' %}
32+
{% assign firstHeader = true %}
33+
34+
{% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
35+
36+
{% for node in nodes %}
37+
{% if node == "" %}
38+
{% continue %}
39+
{% endif %}
40+
41+
{% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
42+
43+
{% if headerLevel < minHeader or headerLevel > maxHeader %}
44+
{% continue %}
45+
{% endif %}
46+
47+
{% if firstHeader %}
48+
{% assign firstHeader = false %}
49+
{% assign minHeader = headerLevel %}
50+
{% endif %}
51+
52+
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
53+
{% assign _workspace = node | split: '</h' %}
54+
55+
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
56+
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
57+
{% assign html_id = _idWorkspace[0] %}
58+
59+
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
60+
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
61+
62+
{% assign space = '' %}
63+
{% for i in (1..indentAmount) %}
64+
{% assign space = space | prepend: ' ' %}
65+
{% endfor %}
66+
67+
{% unless include.item_class == blank %}
68+
{% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
69+
{% endunless %}
70+
71+
{% capture my_toc %}{{ my_toc }}
72+
{{ space }}{{ listModifier }} {{ listItemClass }} [{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}](#{{ html_id }}){% endcapture %}
73+
74+
{% endfor %}
75+
76+
{% if include.class %}
77+
{% capture my_toc %}{:.{{ include.class }}}
78+
{{ my_toc | lstrip }}{% endcapture %}
79+
{% endif %}
80+
81+
{% if include.id %}
82+
{% capture my_toc %}{: #{{ include.id }}}
83+
{{ my_toc | lstrip }}{% endcapture %}
84+
{% endif %}
85+
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}

_sass/screen.scss

+38-11
Original file line numberDiff line numberDiff line change
@@ -1050,13 +1050,6 @@ h1 span.fa, h2 span.fa, h3 span.fa, h4 span.fa, h5 span.fa, h6 span.fa {
10501050
.starttitle a{
10511051
margin:0 20px auto;
10521052
}
1053-
.introlink{
1054-
text-align:center;
1055-
font-size:125%;
1056-
font-weight:bold;
1057-
margin-top:30px;
1058-
}
1059-
10601053
.support-card {
10611054
min-height: 395px;
10621055
}
@@ -2172,6 +2165,9 @@ button.active {
21722165
/* Resources page end */
21732166

21742167
/* Community page start */
2168+
.community {
2169+
padding: 70px 0;
2170+
}
21752171
.community-row {
21762172
flex-wrap: wrap;
21772173
justify-content: center;
@@ -2182,6 +2178,7 @@ button.active {
21822178
.community-card {
21832179
min-height: 475px;
21842180
margin-right: 30px;
2181+
width: 370px;
21852182
}
21862183
.community-card:nth-child(3n+3) {
21872184
margin-right: 30px;
@@ -2190,8 +2187,6 @@ button.active {
21902187
margin: 0 auto 60px;
21912188
text-align: center;
21922189
}
2193-
/* Community page end */
2194-
21952190
.organizations-row {
21962191
justify-content: left;
21972192
flex-wrap: wrap;
@@ -2200,22 +2195,36 @@ button.active {
22002195
width: 31.6%;
22012196
margin-right: 2.5%;
22022197
margin-bottom: 50px;
2198+
text-align: left;
22032199
}
22042200
.organizations-item:nth-child(3n+3) {
22052201
margin-right: 0;
22062202
}
2207-
.organizations-item img {
2203+
.organization-img {
22082204
width: 40px;
22092205
height: 33px;
22102206
margin-right: 28px;
22112207
}
2212-
.organizations-item h3 {
2208+
.organization-country {
22132209
margin: 0;
22142210
font-size: 137.5%;
22152211
color: #13161F;
22162212
line-height: 36px;
22172213
font-weight: 400;
22182214
}
2215+
.organization-link {
2216+
font-size: 112.5%;
2217+
color: #4D5060;
2218+
line-height: 34px;
2219+
}
2220+
.introlink{
2221+
text-align:center;
2222+
font-size: 125%;
2223+
color: #4D5060;
2224+
line-height: 34px;
2225+
}
2226+
/* Community page end */
2227+
22192228
// .resourcesorg{
22202229
// margin-bottom:40px;
22212230
// text-align:left;
@@ -3236,6 +3245,18 @@ button.active {
32363245
.notice {
32373246
margin: 0 0 10px;
32383247
}
3248+
.community-row {
3249+
justify-content: space-between;
3250+
}
3251+
.community-card:nth-child(3n+3) {
3252+
margin-right: 0;
3253+
}
3254+
.organizations-item {
3255+
width: 47.5%;
3256+
}
3257+
.organizations-item:nth-child(3n+3) {
3258+
margin-right: 2.5%;
3259+
}
32393260
}
32403261

32413262
@media handheld, only screen and ( max-width: 48em ), only screen and ( max-device-width: 48em ){
@@ -3675,6 +3696,9 @@ button.active {
36753696
border-left: none;
36763697
border-top: 1px solid #dfdfdf;
36773698
}
3699+
.community {
3700+
padding: 50px 0;
3701+
}
36783702
}
36793703
@media handheld, only screen and ( max-width: 40em ), only screen and ( max-device-width: 40em ){
36803704
p {
@@ -3958,6 +3982,9 @@ button.active {
39583982
.glossary-subpage-left>p {
39593983
margin: 0 0 10px;
39603984
}
3985+
.organizations-item {
3986+
width: 100%;
3987+
}
39613988
}
39623989

39633990
@import 'wallets';

0 commit comments

Comments
 (0)