chore: deduplicate permalinks; fix sitemap; organize
This commit is contained in:
parent
b40986256a
commit
ae1cb3dc5e
64 changed files with 94 additions and 31 deletions
24
src/data/blogroll.js
Normal file
24
src/data/blogroll.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const SUPABASE_URL = process.env.SUPABASE_URL
|
||||
const SUPABASE_KEY = process.env.SUPABASE_KEY
|
||||
const supabase = createClient(SUPABASE_URL, SUPABASE_KEY)
|
||||
|
||||
const fetchBlogroll = async () => {
|
||||
const { data, error } = await supabase
|
||||
.from('authors')
|
||||
.select('*')
|
||||
.eq('blogroll', true)
|
||||
.order('name', { ascending: true })
|
||||
|
||||
if (error) {
|
||||
console.error('Error fetching authors with for the blogroll:', error)
|
||||
return []
|
||||
}
|
||||
|
||||
return data.sort((a, b) => a['name'].toLowerCase().localeCompare(b['name'].toLowerCase()))
|
||||
}
|
||||
|
||||
export default async function () {
|
||||
return await fetchBlogroll()
|
||||
}
|
Reference in a new issue