-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fetch for file listing from repo
- Loading branch information
Showing
16 changed files
with
110 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GITHUB_AUTHORIZATION_BEARER_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
import type { HTMLAttributes } from 'astro/types' | ||
interface Props extends HTMLAttributes<'button'> { | ||
class?: string | ||
} | ||
const { class: className, ...attrs } = Astro.props | ||
--- | ||
|
||
<button | ||
{...attrs} | ||
class:list={[ | ||
'cursor-pointer w-8 h-8 hover:bg-hover transition-all rounded-full', | ||
className, | ||
]} | ||
> | ||
<slot /> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
import type { CollectionEntry } from 'astro:content' | ||
import { Icon } from 'astro-icon/components' | ||
import fetchFileList from '../../utils/fetchFileList.ts' | ||
import type { File } from '../../utils/fetchFileList.ts' | ||
let files: File[] = [] | ||
const fileListResponse = await fetchFileList('data', 'some-notes') | ||
if (fileListResponse && fileListResponse.status === 200) { | ||
files = (await fileListResponse.json()) ?? [] | ||
} | ||
interface Props { | ||
note: CollectionEntry<'notes'> | ||
} | ||
--- | ||
|
||
<ul> | ||
{ | ||
files.map((file) => ( | ||
<li> | ||
<a | ||
class="px-2 hover:underline transition-all py-1 line-clamp-1" | ||
href={file.html_url} | ||
target="_blank" | ||
> | ||
<Icon | ||
class="w-4 h-4 inline-block mr-1" | ||
name={ | ||
file.type === 'dir' | ||
? 'material-symbols:folder' | ||
: 'material-symbols:lab-profile-outline' | ||
} | ||
/> | ||
{file.name} | ||
</a> | ||
</li> | ||
)) | ||
} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> | ||
|
||
interface ImportMetaEnv { | ||
readonly GITHUB_AUTHORIZATION_BEARER_TOKEN: string | ||
} | ||
|
||
interface ImportMeta { | ||
readonly env: ImportMetaEnv | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { siteConfig } from '../config.ts' | ||
|
||
export default function (title: string) { | ||
return [title, siteConfig.title].filter(Boolean).join(' | ') | ||
return [title, siteConfig.title].join(' | ') | ||
} |