Skip to content

Commit eb12e50

Browse files
committed
updates from master
1 parent 12eff46 commit eb12e50

File tree

5 files changed

+37
-56
lines changed

5 files changed

+37
-56
lines changed

_includes/_google_search.html

+15-52
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,16 @@
1-
<!-- Including InstantSearch.js library and styling -->
2-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.js"></script>
3-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.min.css">
4-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch-theme-algolia.min.css">
5-
6-
<script>
7-
// Instanciating InstantSearch.js with Algolia credentials
8-
const search = instantsearch({
9-
appId: '{{ site.algolia.application_id }}',
10-
apiKey: '{{ site.algolia.search_only_api_key }}',
11-
indexName: '{{ site.algolia.index_name }}',
12-
searchParameters: {
13-
restrictSearchableAttributes: [
14-
'title',
15-
'content'
16-
]
17-
}
18-
});
19-
20-
const hitTemplate = function(hit) {
21-
const url = hit.url;
22-
const title = hit._highlightResult.title.value;
23-
const content = hit._highlightResult.html.value;
24-
25-
return `
26-
<div class="list__item">
27-
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
28-
<h2 class="archive__item-title" itemprop="headline"><a href="{{ site.baseurl }}${url}">${title}</a></h2>
29-
<div class="archive__item-excerpt" itemprop="description">${content}</div>
30-
</article>
31-
</div>
32-
`;
33-
}
34-
35-
// Adding searchbar and results widgets
36-
search.addWidget(
37-
instantsearch.widgets.searchBox({
38-
container: '.search-searchbar',
39-
placeholder: 'Enter your search term...'
40-
})
41-
);
42-
search.addWidget(
43-
instantsearch.widgets.hits({
44-
container: '.search-hits',
45-
templates: {
46-
item: hitTemplate
47-
}
48-
})
49-
);
50-
51-
// Starting the search
52-
search.start();
1+
{% comment %}TODO consider https://developers.google.com/custom-search/docs/element{% endcomment %}
2+
{% capture google_search_site %}{{ site.url }}{{ site.baseurl }}/{% endcapture %}
3+
<script language="Javascript" type="text/javascript">
4+
function google_search() {
5+
var query = document.getElementById("google-search").value;
6+
window.open("https://www.google.com/search?q=" + query + "+site:" + "{{ google_search_site | cgi_escape }}");
7+
}
538
</script>
9+
10+
<form id="search" onsubmit="google_search(); return false;">
11+
<input type="text" id="google-search" placeholder="{{ site.data.language.enter_search_term }}">
12+
</form>
13+
<noscript>
14+
Search <a href="https://www.google.com/search?q=site:{{ google_search_site | cgi_escape }}" target="_blank">Google</a> for:
15+
<pre><code>search-term site:{{ google_search_site }}</code></pre>
16+
</noscript>

_includes/_improve_content.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="row">
99
<div class="small-12 columns">
1010
<div class="panel radius" style="padding-bottom: 21px;">
11-
<a class="button left r15 tiny radius" href="{{ site.improve_content }}/{{ page.path }}">{{ site.data.language.edit }}</a>
11+
<a class="button left r15 tiny radius" href="{{ site.improve_content }}/{{ page.path }}">{{ site.data.language.edit }}</a>
1212
<p style="margin-top: 3px;">
1313
{{ site.data.language.this_content_is_open_source }}
1414
<a href="{{ site.improve_content }}/{{ page.path }}">{{ site.data.language.help_improve_it }}</a>.</p>

_layouts/page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: default
3-
format: posts
3+
format: post
44
---
55
<div class="row t30">
66
<div class="medium-8 columns{% if page.sidebar == NULL %} medium-offset-2 end{% endif %}{% if page.sidebar == "left" %} medium-push-4{% endif %}">

_sass/_09_elements.scss

+12
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,15 @@ img.lazy {
148148
transition: opacity 0.7s;
149149
opacity: 1;
150150
}
151+
152+
*:target:not([id^='fn:']):not([id^='fnref:']) {
153+
&::before {
154+
content: " ";
155+
width: 0;
156+
height: 0;
157+
158+
display: block;
159+
padding-top: 50px;
160+
margin-top: -50px;
161+
}
162+
}

assets/mediaelement_js/jquery.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,9 @@ jQuery.extend = jQuery.fn.extend = function() {
349349
src = target[ name ];
350350
copy = options[ name ];
351351

352+
// Prevent Object.prototype pollution
352353
// Prevent never-ending loop
353-
if ( target === copy ) {
354+
if ( name === "__proto__" || target === copy ) {
354355
continue;
355356
}
356357

@@ -8204,6 +8205,11 @@ function ajaxConvert( s, response ) {
82048205
// Convert response if prev dataType is non-auto and differs from current
82058206
if ( prev !== "*" && prev !== current ) {
82068207

8208+
// Mitigate possible XSS vulnerability (gh-2432)
8209+
if ( s.crossDomain && current === "script" ) {
8210+
continue;
8211+
}
8212+
82078213
// Seek a direct converter
82088214
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
82098215

@@ -9594,4 +9600,4 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
95949600
define( "jquery", [], function () { return jQuery; } );
95959601
}
95969602

9597-
})( window );
9603+
})( window );

0 commit comments

Comments
 (0)