+
+
+
+
+
+
+
+
-
-
No results
+
+
+
+ Your search didn't return any results. Please try again.
+
@@ -90,7 +121,8 @@ query($page: Int){
import PostListItem from "~/components/custom/Cards/PostListItem.vue";
import Pagination from "~/components/custom/Pagination.vue";
import NewsFilterHeader from "~/components/custom/NewsFilterHeader.vue";
-
+import SearchBox from "~/components/custom/SearchBox.vue";
+import FilterDropdown from "~/components/custom/FilterDropdown.vue";
export default {
data() {
const allMonths = [
@@ -114,13 +146,14 @@ export default {
r.forEach((year) => years.push(String(year)));
return {
- selectedTopic: "All Topics",
+ selectedTopic: "Popular Topics",
selectedYear: "All Years",
selectedMonth: "All Months",
months: allMonths,
years: years,
listArchive: false,
archiveButtonText: "Archive",
+ search: "",
};
},
@@ -174,6 +207,8 @@ export default {
PostListItem,
Pagination,
NewsFilterHeader,
+ SearchBox,
+ FilterDropdown,
},
methods: {
setTopic: function (topic) {
@@ -186,7 +221,7 @@ export default {
this.selectedMonth = month;
},
resetAll() {
- this.selectedTopic = "All Topics";
+ this.selectedTopic = "Popular Topics";
this.selectedYear = "All Years";
this.selectedMonth = "All Months";
},
@@ -237,7 +272,7 @@ export default {
},
computed: {
topics: function () {
- var res = ["All Topics"];
+ var res = ["Popular Topics"];
this.$page.topics.edges.forEach((edge) => res.push(edge.node.title));
return res;
},
@@ -265,7 +300,7 @@ export default {
var node = old.edges[i].node;
// Now check topic
- var topics = ["All Topics"];
+ var topics = ["Popular Topics"];
node.tags.forEach((tag) => topics.push(tag.title));
var nodeDate = new Date(node.datetime);
@@ -286,6 +321,13 @@ export default {
baseurl() {
return "/blog/";
},
+ searchResults() {
+ return this.$page.entries.edges.filter((blog) => {
+ return blog.node.title
+ .toLowerCase()
+ .includes(this.search.toLowerCase().trim());
+ });
+ },
},
};
diff --git a/src/pages/News.vue b/src/pages/News.vue
index b9c73caac..fc8cea506 100644
--- a/src/pages/News.vue
+++ b/src/pages/News.vue
@@ -1,6 +1,6 @@
-
+ /> -->
-
+
+
+
+
+
+
+
+
-
-
No results
+
+
+ Your search didn't return any results. Please try again.
+
@@ -85,7 +107,8 @@ query($page: Int){
import NewsFilterHeader from "~/components/custom/NewsFilterHeader.vue";
import PostListItem from "~/components/custom/Cards/PostListItem.vue";
import Pagination from "~/components/custom/Pagination.vue";
-
+import SearchBox from "~/components/custom/SearchBox.vue";
+import FilterDropdown from "~/components/custom/FilterDropdown.vue";
export default {
data() {
const allMonths = [
@@ -109,13 +132,14 @@ export default {
r.forEach((year) => years.push(String(year)));
return {
- selectedTopic: "All Topics",
+ selectedTopic: "Popular Topics",
selectedYear: "All Years",
selectedMonth: "All Months",
months: allMonths,
years: years,
listArchive: false,
archiveButtonText: "Archive",
+ search: "",
};
},
@@ -166,6 +190,8 @@ export default {
PostListItem,
Pagination,
NewsFilterHeader,
+ SearchBox,
+ FilterDropdown,
},
methods: {
setTopic: function (topic) {
@@ -178,7 +204,7 @@ export default {
this.selectedMonth = month;
},
resetAll() {
- this.selectedTopic = "All Topics";
+ this.selectedTopic = "Popular Topics";
this.selectedYear = "All Years";
this.selectedMonth = "All Months";
},
@@ -245,7 +271,7 @@ export default {
},
computed: {
topics: function () {
- var res = ["All Topics"];
+ var res = ["Popular Topics"];
this.$page.topics.edges.forEach((edge) => res.push(edge.node.title));
return res;
},
@@ -277,7 +303,7 @@ export default {
// if (!selected) continue;
// Now check topic
- var topics = ["All Topics"];
+ var topics = ["Popular Topics"];
node.tags.forEach((tag) => topics.push(tag.title));
if (!topics.includes(this.selectedTopic)) continue;
@@ -306,6 +332,13 @@ export default {
}
return img;
},
+ searchResults() {
+ return this.$page.entries.edges.filter((post) => {
+ return post.node.excerpt
+ .toLowerCase()
+ .includes(this.search.toLowerCase().trim());
+ });
+ },
},
};