Skip to content

Commit

Permalink
Add story summary page for custom Google Search Index.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Dec 28, 2023
1 parent 26b183c commit 1bb6fb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pages/stories/summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<b-col cols="12" lg="6" class="p-0" offset-lg="3">
<div class="bg-white p-4">
<h1>Stories from Freeglers</h1>
<p>This page just exists for Google.</p>
<p>This page lets you search through stories.</p>
</div>
<div class="gcse-search"></div>
<ul class="list-unstyled">
<li v-for="story in stories" :key="'story-' + story" class="mt-2">
<nuxt-link :to="'/story/' + story">{{story}}</nuxt-link>
Expand Down Expand Up @@ -43,4 +44,10 @@ useHead(
const stories = computed(() => {
return storyStore.recent
})
onMounted(() => {
let scr = document.createElement('script')
scr.setAttribute('src', 'https://cse.google.com/cse.js?cx=424a23761185040ff')
window.document.head.appendChild(scr)
})
</script>
1 change: 1 addition & 0 deletions server/routes/sitemap.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default defineEventHandler(async (event) => {
{ url: '/privacy', changefreq: 'monthly', priority: 0.1 },
{ url: '/forgot', changefreq: 'monthly', priority: 0.1 },
{ url: '/giftaid', changefreq: 'monthly', priority: 0.1 },
{ url: '/stories/summary', changefreq: 'weekly', priority: 0.1 },
]

// Fetch all the groups.
Expand Down

0 comments on commit 1bb6fb0

Please sign in to comment.