Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added advanced search and "search by author" #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ vendor
.bundle
.sass-cache
.jekyll-metadata
.DS_Store
.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline here 🤕

2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ jekyll-archives:
kramdown:
input: GFM
hard_wrap: false

cloudsh_token: "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWVhZGI4NWItMDgwNS00MDRkLWJhYmMtOGQ5Mjc5OGYzNDliIiwiaW5kZXhfaWQiOiIyMzk3Yjk4Yy1lMTk3LTRjMGQtOTlkYS04NGIxOWEzMjk1ZjEiLCJpbmRleF91cmwiOiJodHRwOi8vcGNsdWIuaW4ifQ.49yI9ac98bXkeoIzXxW_LRA_tTJgHeAErr_aVgu1MQg"
18 changes: 18 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ <h2 class="footer-heading">{{ site.title }}</h2>
theme: "square"
};
$("#countries").easyAutocomplete(options);
var options2 = {
url: "/gblk2.json",
getValue: "author",
list: {
match: {
enabled: !0,
maxNumberOfElements: 5
}
},
template: {
type: "custom",
method: function(value, item) {
return "<a href='" + (item.url) + "' >"+ (item.title) +"</a>";
}
},
theme: "square"
};
$("#countries2").easyAutocomplete(options2);
var waterfall = new Waterfall({
containerSelector: ".wf-container",
boxSelector: ".wf-box",
Expand Down
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/assets/image/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
6 changes: 6 additions & 0 deletions _includes/widgets.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ <h1 class="page-heading">Search</h1>
<input type="text" placeholder="Search for articles..." id="countries"/>
</div>
</div>
<div class="widgetnya">
<h1 class="page-heading">Search by Author</h1>
<div class="badanwidget" style="width:0">
<input type="text" placeholder="Search by Author..." id="countries2"/>
</div>
</div>

<div class="widgetnya">
<h1 class="page-heading">Tags</h1>
Expand Down
7 changes: 7 additions & 0 deletions gblk2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
[
{% for post in site.posts %}{"title":"{{ post.title }}", "url":"{{ post.url }}", "author":"{{ post.author }}"}{% if forloop.last %}{% else %},
{% endif %}{% endfor %}
]
21 changes: 21 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: default
title: Search
---
<br><br><center>
<form id="cloudsh">
<input type="text" id="q"/>
<button>Search</button>
</form>
</center>
<h2>Results</h2>
<div id="results"></div>

<script src="https://app.cloudsh.com/js/cloudsh.js"></script>
<script>
var CshConf = {
token: "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWVhZGI4NWItMDgwNS00MDRkLWJhYmMtOGQ5Mjc5OGYzNDliIiwiaW5kZXhfaWQiOiIyMzk3Yjk4Yy1lMTk3LTRjMGQtOTlkYS04NGIxOWEzMjk1ZjEiLCJpbmRleF91cmwiOiJodHRwOi8vcGNsdWIuaW4ifQ.49yI9ac98bXkeoIzXxW_LRA_tTJgHeAErr_aVgu1MQg",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these tokens for public use?
Private tokens should not be placed in codebase.

formId: "#cloudsh",
resultsId: "#results",
};
</script>