mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
rename functions
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import type { Education, JsonParsedContent, Post, Project, Skill, WorkExperience } from '~~/types'
|
||||
|
||||
export function useProjects() {
|
||||
export function getProjects() {
|
||||
return useAsyncData('content:projects', () => {
|
||||
return queryContent<Project>('projects').find()
|
||||
})
|
||||
}
|
||||
|
||||
export function useEducations() {
|
||||
export function getEducations() {
|
||||
return useAsyncData('content:educations', () => {
|
||||
return queryContent<Education>('educations')
|
||||
.sort({
|
||||
@@ -16,7 +16,7 @@ export function useEducations() {
|
||||
})
|
||||
}
|
||||
|
||||
export function useWorkExperiences() {
|
||||
export function getWorkExperiences() {
|
||||
return useAsyncData('content:experiences', () => {
|
||||
return queryContent<WorkExperience>('experiences')
|
||||
.sort({
|
||||
@@ -26,11 +26,11 @@ export function useWorkExperiences() {
|
||||
})
|
||||
}
|
||||
|
||||
export function useSkills() {
|
||||
export function getSkills() {
|
||||
return useAsyncData('content:skills', () => queryContent<JsonParsedContent<Skill[]>>('skills').findOne())
|
||||
}
|
||||
|
||||
export function usePosts() {
|
||||
export function getPosts() {
|
||||
return useAsyncData('content:posts', async () => {
|
||||
const posts = await queryContent<Post>('writing').find()
|
||||
return posts.sort((a, b) => {
|
||||
|
||||
@@ -3,9 +3,9 @@ useHead({
|
||||
title: 'About me • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { data: skills } = await useSkills()
|
||||
const { data: educations } = await useEducations()
|
||||
const { data: experiences } = await useWorkExperiences()
|
||||
const { data: skills } = await getSkills()
|
||||
const { data: educations } = await getEducations()
|
||||
const { data: experiences } = await getWorkExperiences()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -8,7 +8,7 @@ useHead({
|
||||
title: 'My work • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { data: projects } = await useProjects()
|
||||
const { data: projects } = await getProjects()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user