Skip to content

Commit f408914

Browse files
authored
Merge pull request creativecommons#271 from Dhruvi16/update_footer
Update footer according to the vocabulary.
2 parents 891dd67 + 23bc41c commit f408914

File tree

3 files changed

+139
-43
lines changed

3 files changed

+139
-43
lines changed

themes/vocabulary_theme/templates/layout.html

+111-26
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<meta charset="utf-8">
33
<meta name="viewport" content="width=device-width, initial-scale=1" />
44
<link rel="shortcut icon" type="image/x-icon" href="{{ '/static/favicon.ico'|url }}">
5-
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
6-
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
5+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet"
6+
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
77
<link rel="stylesheet" href="{{ '/static/gen/style.css'|url }}">
88
<link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">
9+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@creativecommons/vocabulary@1.0.0-beta.14/css/vocabulary.css">
910
<meta property="og:site_name" content="Creative Commons" />
1011
<meta property="og:title" content="{{ this.title }}" />
1112
{% if this.description %}
@@ -20,22 +21,26 @@
2021
<meta property="og:url" content="{{ this|url }}" />
2122
<meta property="og:type" content="article" />
2223
{% set image = this.attachments.images.first() %}
23-
{% if image %}
24+
{% if image %}
2425
<meta property="og:image" content="{{ image|url(external=true)}}" />
25-
{% endif %}
26+
{% endif %}
2627
<meta name="twitter:card" content="summary_large_image" />
2728
<meta name="twitter:title" content="{{ this.title }}">
2829
<meta name="twitter:description" content="{{ desc }}">
29-
{% if image %}
30+
{% if image %}
3031
<meta name="twitter:image" content="{{ image|url(external=true) }}">
31-
{% endif %}
32+
{% endif %}
3233
<meta name="twitter:site" content="@creativecommons">
3334
<meta name="twitter:creator" content="@creativecommons">
34-
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
35-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
36-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
35+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
36+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
37+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
38+
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
39+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
40+
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
3741
<script type="text/javascript" src="{{ '/static/gen/script.js'|url }}"></script>
3842
<title>{% block title %}Welcome{% endblock %} — Creative Commons on GitHub</title>
43+
3944
<body>
4045
<div class="ga-script">{{ generate_google_analytics() }}</div>
4146
<header class="main-header">
@@ -52,7 +57,7 @@
5257
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
5358
<span class="navbar-toggler-icon"></span>
5459
</button>
55-
60+
5661
<div class="collapse navbar-collapse" id="navbarSupportedContent">
5762
<ul class="navbar-nav">
5863
<li class="nav-item{% if this.is_child_of('/blog') %} active{% endif%}">
@@ -68,7 +73,7 @@
6873
['/contributing-code/github-repo-guidelines', 'GitHub Repo Guidelines'],
6974
['/contributing-code/cc-search', 'CC Search'],
7075
] %}
71-
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
76+
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
7277
{% endfor %}
7378
</div>
7479
</li>
@@ -83,7 +88,7 @@
8388
['/community/code-of-conduct', 'Code of Conduct'],
8489
['/community/code-of-conduct/enforcement', 'Code of Conduct Enforcement'],
8590
] %}
86-
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
91+
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
8792
{% endfor %}
8893
</div>
8994
</li>
@@ -98,7 +103,7 @@
98103
['/internships/mentor-guide', 'Mentor Guide'],
99104
['/internships/history', 'History'],
100105
] %}
101-
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
106+
<a class="dropdown-item" href="{{ href|url }}">{{ title }}</a>
102107
{% endfor %}
103108
</div>
104109
</li>
@@ -112,7 +117,7 @@
112117
['/archives/old-tech-blog', 'CC Tech Blog (2007-2014)'],
113118
['https://lists.ibiblio.org/pipermail/cc-devel/', 'cc-devel mailing list (2005-2015)'],
114119
] %}
115-
<a class="dropdown-item" href="{{ href }}">{{ title }}</a>
120+
<a class="dropdown-item" href="{{ href }}">{{ title }}</a>
116121
{% endfor %}
117122
</div>
118123
</li>
@@ -122,7 +127,18 @@
122127
</ul>
123128
</nav>
124129
</div>
125-
<a href="https://github.com/creativecommons/creativecommons.github.io-source" target="_blank" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg>
130+
<a href="https://github.com/creativecommons/creativecommons.github.io-source" target="_blank"
131+
class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250"
132+
style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);"
133+
aria-hidden="true">
134+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
135+
<path
136+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
137+
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
138+
<path
139+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
140+
fill="currentColor" class="octo-body"></path>
141+
</svg>
126142
</a>
127143
</div>
128144
</div>
@@ -138,17 +154,86 @@ <h1 class="page-title pb-3 mb-4">{% block header %}{{ this.title }}{% endblock %
138154
</div>
139155
</div>
140156
</div>
141-
<footer class="main-footer bg-dark">
142-
<div class="container-fluid">
143-
<div class="row justify-content-md-center">
144-
<div class="col-lg-9 col-md-9 col-sm-12 footer text-light py-4 px-3">
145-
<small>
146-
<p><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License"
147-
style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a></p>
148-
<p class="text-muted">All the content on this website is licensed under a <strong><a rel="license"
149-
href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International
150-
License</a></strong> unless otherwise specified.</p>
151-
</small>
157+
<footer class="main-footer">
158+
<div class="container">
159+
<div class="columns">
160+
<div class="column">
161+
<a href="https://creativecommons.org" class="main-logo margin-bottom-bigger">
162+
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" viewBox="0 0 304 73"
163+
class=has-text-white>
164+
<use href="#logomark"></use>
165+
</svg>
166+
</a>
167+
<p>
168+
<address class="margin-bottom-normal">Creative Commons<br />PO Box 1866, Mountain View CA 94042</address>
169+
<a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a><br />
170+
<a href="tel://+1-415-429-6753" class="phone">+1-415-429-6753</a>
171+
</p>
172+
<div class="margin-vertical-large">
173+
<a href="https://www.instagram.com/creativecommons" class="social has-text-white" target="_blank"
174+
rel="noopener">
175+
<i class="icon margin-right-small is-size-4">instagram</i>
176+
</a>
177+
<a href="https://www.twitter.com/creativecommons" class="social has-text-white" target="_blank"
178+
rel="noopener">
179+
<i class="icon margin-right-small is-size-4">twitter</i>
180+
</a>
181+
<a href="https://www.facebook.com/creativecommons" class="social has-text-white" target="_blank"
182+
rel="noopener">
183+
<i class="icon margin-right-small is-size-4">facebook</i>
184+
</a>
185+
<a href="https://www.linkedin.com/company/creative-commons/" class="social has-text-white" target="_blank"
186+
rel="noopener">
187+
<i class="icon margin-right-small is-size-4">linkedin</i>
188+
</a>
189+
</div>
190+
</div>
191+
<div class="column is-half">
192+
<nav class="footer-navigation">
193+
<ul class="menu">
194+
<li>
195+
<a href="{{ '/blog'|url }}" class="menu-item">Blog</a>
196+
</li>
197+
<li>
198+
<a href="{{ '/contributing-code'|url }}" class="menu-item">Contributing Guidelines</a>
199+
</li>
200+
<li>
201+
<a href="{{ '/community/community-team'|url }}" class="menu-item">Community Teams</a>
202+
</li>
203+
<li>
204+
<a href="{{ '/contributing-code/projects'|url }}" class="menu-item">Project List</a>
205+
</li>
206+
</ul>
207+
</nav>
208+
<div class="subscription">
209+
<h5 class="b-header">Subscribe to our newsletter</h5>
210+
<form class="newsletter">
211+
<input type="text" class="input" placeholder="Your email">
212+
<input type="submit" value="subscribe" class="button small">
213+
</form>
214+
</div>
215+
<div class="attribution margin-top-bigger">
216+
<p class="caption">Except where otherwise <a href="https://creativecommons.org/policies#license"
217+
target="_blank">noted</a>, content on this site is licensed under a <a
218+
href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0
219+
International license</a>. Icons by <a href="https://fontawesome.com/" target="_blank" rel="noopener"
220+
class="has-text-white">Font Awesome</a>.</p>
221+
<div class="margin-top-smaller">
222+
<i class="icon margin-right-small is-size-4">cclogo</i>
223+
<i class="icon margin-right-small is-size-4">ccby</i>
224+
</div>
225+
</div>
226+
</div>
227+
<div class="column">
228+
<aside class="donate-section">
229+
<h5>Our work relies on you!</h5>
230+
<p>Help us keep the internet free and open.</p>
231+
<a class="button small donate">
232+
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" viewBox="0 0 80 72">
233+
<use href="#letterheart"></use>
234+
</svg>Donate Now
235+
</a>
236+
</aside>
152237
</div>
153238
</div>
154239
</div>

webpack/js/main.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1-
$(document).ready(function() {
2-
$(window).scroll(function() {
1+
$(document).ready(function () {
2+
$(window).scroll(function () {
33
if ($(this).scrollTop() > 500) {
44
$('#back-to-top').fadeIn();
55
} else {
66
$('#back-to-top').fadeOut();
77
}
88
});
9+
10+
patchAssetIntoDom('/assets/logos/cc/logomark.svg');
11+
patchAssetIntoDom('/assets/logos/cc/letterheart.svg');
912
});
13+
14+
const getFullyQualifiedUrl = (path, version) => {
15+
let baseUrl = "https://unpkg.com/@creativecommons/vocabulary"
16+
if (version) {
17+
baseUrl = `${baseUrl}@${version}`
18+
}
19+
return `${baseUrl}/${path}`
20+
}
21+
22+
const patchAssetIntoDom = (asset, version = null) => {
23+
const ajax = new XMLHttpRequest();
24+
ajax.open("GET", getFullyQualifiedUrl(asset, version), true);
25+
ajax.onload = () => {
26+
var div = document.createElement("div");
27+
// Render SVG in the page
28+
div.innerHTML = ajax.responseText;
29+
div.style.display = 'none';
30+
document.body.insertBefore(div, document.body.childNodes[0]);
31+
}
32+
33+
ajax.send();
34+
}
35+

webpack/sass/main.scss

-15
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ h2 {
4646
}
4747
}
4848

49-
.footer {
50-
bottom: 0;
51-
}
52-
5349
.card-columns {
5450
column-count: 2;
5551
}
@@ -111,17 +107,6 @@ h2 {
111107
font-size: 0.8rem;
112108
}
113109

114-
#back-to-top {
115-
cursor: pointer;
116-
position: fixed;
117-
bottom: 20px;
118-
right: 20px;
119-
display: none;
120-
background-color: $blue;
121-
border: none;
122-
z-index: 1;
123-
}
124-
125110
.dropdown-item {
126111
font-size: 1.2em;
127112
text-align: left;

0 commit comments

Comments
 (0)