Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

feat(pages): added llms.json file (#28)

Corentin Thomassetb5b05dbe17c7
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
index a0f5818c..1b155a94 100644
--- a/src/components/Footer.astro
+++ b/src/components/Footer.astro
@@ -3,20 +3,25 @@ import { cn } from '../utils/cn';
const socials = [
{
- name: 'Bluesky',
+ label: 'Bluesky',
url: 'https://bsky.app/profile/papra.app',
icon: 'i-tabler-brand-bluesky',
},
{
- name: 'GitHub',
+ label: 'GitHub',
url: 'https://github.com/papra-hq/papra',
icon: 'i-tabler-brand-github',
},
{
- name: 'Discord',
+ label: 'Discord',
url: '/discord',
icon: 'i-tabler-brand-discord',
},
+ {
+ label: 'Reddit',
+ url: 'https://www.reddit.com/r/Papra',
+ icon: 'i-tabler-brand-reddit',
+ },
];
const sections: {
@@ -25,18 +30,7 @@ const sections: {
}[] = [
{
title: 'Community',
- links: [
- ...socials
- .filter(social => social.name !== 'GitHub')
- .map(social => ({
- label: social.name,
- url: social.url,
- })),
- {
- label: 'GitHub',
- url: 'https://github.com/papra-hq',
- },
- ],
+ links: socials,
},
{
title: 'Papra',
@@ -61,9 +55,18 @@ const sections: {
label: 'Roadmap',
url: 'https://github.com/orgs/papra-hq/projects/2',
},
+ {
+ label: 'LLMs.txt',
+ url: '/llms.txt',
+ target: '_blank',
+ },
+ {
+ label: 'Humans.txt',
+ url: '/humans.txt',
+ target: '_blank',
+ },
],
},
-
{
title: 'Open Source',
links: [
@@ -121,7 +124,7 @@ const sections: {
<div class="flex gap-2">
{
socials.map(social => (
- <a href={social.url} class="hover:text-primary transition" target="_blank" rel="noopener noreferrer" aria-label={social.name}>
+ <a href={social.url} class="hover:text-primary transition" target="_blank" rel="noopener noreferrer" aria-label={social.label}>
<div class={`${social.icon} text-2xl`} aria-hidden="true" />
</a>
))
diff --git a/src/pages/llms.txt.ts b/src/pages/llms.txt.ts
new file mode 100644
index 00000000..80517e78
--- /dev/null
+++ b/src/pages/llms.txt.ts
@@ -0,0 +1,41 @@
+import type { APIRoute } from 'astro';
+import { getCollection } from 'astro:content';
+
+const getDocsSections = (): Promise<{ label: string; items: { label: string; url: string; description: string }[] }[]> => fetch('https://docs.papra.app/docs-navigation.json').then(res => res.json());
+
+export const GET: APIRoute = async ({ site }) => {
+ const posts = await getCollection('blog');
+ const getBlogPostUrl = (slug: string) => new URL(`blog/${slug}`, site).href;
+
+ const docsSections = await getDocsSections();
+
+ const llmTxt = `
+# Papra
+
+> Papra is a minimalistic document management and archiving platform. It is designed to be simple to use and accessible to everyone. Papra is a platform for long-term document storage and management, like a digital archive for your documents.
+
+## Blog Posts
+
+${posts.map(post => `- [${post.data.title}](${getBlogPostUrl(post.slug)}): ${post.data.description}`).join('\n')}
+
+## Assets
+
+- [Papra Documentation](https://docs.papra.app): The self-hosting documentation for Papra.
+- [Papra GitHub](https://github.com/papra-hq/papra): The source code for Papra.
+- [Papra Discord](https://papra.app/discord): The official Discord server for Papra.
+- [Bluesky account](https://bsky.app/profile/papra.app): The official Bluesky account for Papra @papra.app.
+- [Support the project](https://buymeacoffee.com/cthmsst): Support the project by sponsoring the developer.
+- [Contact](https://papra.app/contact): Contact the development team.
+
+## Legal
+
+- [Privacy Policy](https://papra.app/privacy): The privacy policy for Papra.
+- [Terms of Service](https://papra.app/terms-of-service): The terms of service for Papra.
+
+## Docs
+
+${docsSections.map(section => `### ${section.label}\n\n${section.items.map(item => `- [${item.label}](${item.url}): ${item.description ?? item.label}`).join('\n')}`).join('\n\n')}
+`.trim();
+
+ return new Response(llmTxt);
+};
diff --git a/uno.config.ts b/uno.config.ts
index ee236354..19d0bdde 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -101,7 +101,7 @@ export default defineConfig({
},
},
},
- safelist: ['sm:grid-cols-1', 'sm:grid-cols-2', 'sm:grid-cols-3', 'sm:grid-cols-4'],
+ safelist: ['sm:grid-cols-1', 'sm:grid-cols-2', 'sm:grid-cols-3', 'sm:grid-cols-4', 'sm:grid-cols-5'],
preflights: [
{
getCSS: () => `