1 Commits
main ... tina

Author SHA1 Message Date
vorpax
6be40f5a6a tina 2026-02-02 04:14:53 +01:00
43 changed files with 11821 additions and 165 deletions

36
.env.example Normal file
View File

@@ -0,0 +1,36 @@
# ============================================
# PostgreSQL
# ============================================
POSTGRES_PASSWORD=
# ============================================
# OIDC Configuration (PocketID)
# ============================================
# URL de base de votre provider OIDC
OIDC_ISSUER=https://auth.hec-ia.com
# Credentials de l'application OIDC
OIDC_CLIENT_ID=tina-cms-client
OIDC_CLIENT_SECRET=your_client_secret_here
# URL de callback (doit correspondre à la config PocketID)
OIDC_CALLBACK_URL=https://tina.hec-ia.com/auth/callback
# Scopes demandés (séparés par des espaces)
OIDC_SCOPE=openid profile email
# ============================================
# Session Security (Iron Session)
# ============================================
# Générer avec: openssl rand -base64 32
SESSION_SECRET=
# ============================================
# GitHub Integration
# ============================================
# Personal Access Token avec scope 'repo'
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Configuration du repo
GITHUB_REPO=wiki.hec-ia.com
GITHUB_OWNER=hec-ia
# ============================================
# Local Development
# ============================================
# Mettre à true pour le développement local sans backend
TINA_PUBLIC_IS_LOCAL=false

View File

@@ -44,11 +44,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy stack
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: cd ~/

124
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,124 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [satnaingdev@gmail.com](satnaingdev@gmail.com).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at [this link](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the [FAQ](https://www.contributor-covenant.org/faq). [Translations](https://www.contributor-covenant.org/translations) are also available.

55
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,55 @@
# How to contribute to AstroPaper
Thank you for your interest in contributing to **AstroPaper**! We appreciate every contribution, whether you're fixing a typo, improving documentation, or adding a new feature.
## Types of Contributions
There are several ways to contribute to **AstroPaper**, and every contribution counts\_ whether it's a PR for a major feature or a small fix.
You can also contribute by leaving review comments on PRs, adding ideas to existing GitHub Issues and Discussions, or helping others by answering questions in GitHub Discussions.
Heres a summary of the different ways you can contribute:
- [Opening a new issue](#open-a-new-issue)
- [Submitting PRs](#feature-requests)
- [Solving an existing issue](#solving-an-issue)
- [Making changes to a blog post](#making-changes-to-a-blog-post)
- [Helping others by answering issues/discussions](#helping-with-github-issuesdiscussions)
- [Reviewing existing PRs](#reviewing-existing-prs)
- [Starting a discussion](#starting-a-discussion)
## Open a new Issue
If you find a bug or problem, first check whether a similar issue already exists. If you dont find any open issue that addresses the bug/problem youre facing, feel free to [open a new issue](https://github.com/satnaing/astro-paper/issues/new/choose).
## Feature Requests
If you have an idea for a new feature or enhancement that could improve AstroPaper, wed love to hear it! Before submitting a new feature request, please:
1. **Check existing discussions/issues**: Review the [Discussions](https://github.com/satnaing/astro-paper/discussions) or [Issues](https://github.com/satnaing/astro-paper/issues) to see if the feature has already been requested or discussed. You can contribute by adding your thoughts or upvoting existing requests.
2. **Open a new issue**: If you dont find an existing discussion, you can open a new issue using the [Feature Request Template](https://github.com/satnaing/astro-paper/issues/new?assignees=&labels=enhancement&projects=&template=%E2%9C%A8-feature-request.md&title=%5BFeature+Request%5D%3A+). Be as detailed as possible, describing the problem this feature would solve and how it would benefit AstroPaper users.
3. **Discuss first**: If youre unsure whether your idea is feasible or fits the projects goals, feel free to [start a GitHub Discussion](https://github.com/satnaing/astro-paper/discussions/new/choose) to gather feedback from the community.
## Making PRs (Pull Requests)
### Solving an Issue
Browse through the existing issues to find one that interests you. You can use labels to filter the issues. See the [Label](https://github.com/satnaing/astro-paper/labels) section for more information.
### Making Changes to a Blog Post
For small changes like typos, syntax fixes, or broken links, click the "Suggest Changes" link below the title of any blog post. This will take you to the .md file, where you can make your changes and submit a pull request for review. For more significant changes to a blog post, its recommended to open a new issue or discussion first.
## Helping with GitHub Issues/Discussions
GitHub Discussions and Issues are great places to help others. Whether you're a long-time user of AstroPaper or just have experience with a specific problem, we encourage you to answer questions or solve issues when possible.
## Reviewing Existing PRs
You can help by reviewing and providing feedback on open PRs. Different perspectives can be very helpful.
Since AstroPaper doesnt currently have automated testing, its especially useful if you can do manual testing on open PRs and provide feedback.
## Starting a Discussion
If youre unsure whether your issue warrants a fix or if you just want to share ideas and get feedback, feel free to [start a GitHub discussion](https://github.com/satnaing/astro-paper/discussions/new/choose). Its a great way to engage with the community.

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: [satnaing]
buy_me_a_coffee: satnaing

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: AstroPaper Discussions
url: https://github.com/satnaing/astro-paper/discussions
about: Please ask and answer questions here.

View File

@@ -0,0 +1,19 @@
---
name: "✨ Feature Request"
about: Suggest an idea for improving AstroPaper
title: "[Feature Request]: "
labels: enhancement
assignees: ""
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1,27 @@
---
name: "\U0001F41E Bug report"
about: Report a bug or unexpected behavior in AstroPaper
title: "[BUG]: "
labels: bug
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,16 @@
---
name: "\U0001F4DD Documentation Improvement"
about: Propose updates or improvements to the documentation/blog posts
title: "[Docs]: "
labels: documentation
assignees: ""
---
**Describe the Issue**
A clear and concise description of the documentation issue or improvement.
**Proposed Changes**
Describe what changes should be made and why they would improve the documentation.
**Additional Context**
Add any other context or screenshots about the documentation request here.

30
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,30 @@
## Description
<!-- A clear and concise description of what the pull request does. Include any relevant motivation and background. -->
## Types of changes
<!-- What types of changes does your code introduce to AstroPaper? Put an `x` in the boxes that apply -->
- [ ] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update (if none of the other choices apply)
- [ ] Others (any other types not listed above)
## Checklist
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. You can also fill these out after creating the PR. This is simply a reminder of what we are going to look for before merging your code. -->
- [ ] I have read the [Contributing Guide](https://github.com/satnaing/astro-paper/blob/main/.github/CONTRIBUTING.md)
- [ ] I have added the necessary documentation (if appropriate)
- [ ] Breaking Change (fix or feature that would cause existing functionality to not work as expected)
## Further comments
<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
## Related Issue
<!-- If this PR is related to an existing issue, link to it here. -->
Closes: #<!-- Issue number, if applicable -->

View File

@@ -1,50 +0,0 @@
name: Build and Push Docker Image - HEC IA Wiki
on:
push:
branches:
- main
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') || github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

75
.github/workflows/deploy-tina.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
name: Deploy TinaCMS Backend
on:
push:
branches: [main]
paths:
- "tina-backend/**"
- "tina/**"
- "docker-compose.yml"
- ".github/workflows/deploy-tina.yml"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/tina-backend
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./tina-backend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to VPS
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
cd /opt/wiki.hec-ia.com
docker-compose pull tina-backend
docker-compose up -d tina-backend
docker-compose exec -T tina-backend npx drizzle-kit migrate
docker system prune -f

View File

@@ -1,22 +0,0 @@
name: Deploy Docker Image
on:
push:
branches:
- main
- master
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy stack
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: cd "/home/${secrets.USERNAME}/docker/wiki-hecia" && git pull && docker compose -f compose.yaml pull && docker compose up -d

11
.gitignore vendored
View File

@@ -11,8 +11,6 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-store
.hist
pnpm-debug.log*
# environment variables
@@ -29,3 +27,12 @@ pnpm-debug.log*
public/pagefind
SETUP.md
# TinaCMS
.tina/__generated__
admin
PLAN.md
QUICKSTART.md
TINA.md
.pnpm-store
.hist

View File

@@ -1,12 +0,0 @@
services:
app:
build: .
restart: unless-stopped
expose:
- 80
networks:
- public
networks:
public:
name: public
external: true

View File

@@ -1,12 +0,0 @@
services:
app:
build: .
restart: unless-stopped
expose:
- 80
networks:
- public
networks:
public:
name: public
external: true

18
docker-compose.tina.yml Normal file
View File

@@ -0,0 +1,18 @@
version: '3.8'
services:
tina:
image: node:20-alpine
working_dir: /app
volumes:
- .:/app
- /app/node_modules
ports:
- "4001:4001"
environment:
- NODE_ENV=production
command: >
sh -c "npm install -g pnpm &&
pnpm install &&
pnpm tinacms dev --host 0.0.0.0 --port 4001"
restart: unless-stopped

68
docker-compose.yml Normal file
View File

@@ -0,0 +1,68 @@
services:
# Service Astro existant
app:
image: node:lts
ports:
- 4321:4321
working_dir: /app
command: npm run dev -- --host 0.0.0.0
volumes:
- ./:/app
networks:
- tina-network
# PostgreSQL pour Tina
postgres:
image: postgres:16-alpine
container_name: tina-postgres
restart: unless-stopped
environment:
POSTGRES_DB: tina
POSTGRES_USER: tina
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./tina-backend/migrations:/docker-entrypoint-initdb.d:ro
networks:
- tina-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tina"]
interval: 5s
timeout: 5s
retries: 5
# Backend TinaCMS
tina-backend:
build:
context: .
dockerfile: tina-backend/Dockerfile
container_name: tina-backend
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://tina:${POSTGRES_PASSWORD}@postgres:5432/tina
OIDC_ISSUER: ${OIDC_ISSUER}
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID}
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET}
OIDC_CALLBACK_URL: ${OIDC_CALLBACK_URL}
OIDC_SCOPE: ${OIDC_SCOPE}
SESSION_SECRET: ${SESSION_SECRET}
GITHUB_TOKEN: ${GITHUB_TOKEN}
GITHUB_REPO: ${GITHUB_REPO}
GITHUB_OWNER: ${GITHUB_OWNER}
GITHUB_BRANCH: main
depends_on:
postgres:
condition: service_healthy
networks:
- tina-network
ports:
- "3000:3000"
volumes:
postgres_data:
networks:
tina-network:
driver: bridge

View File

@@ -10,22 +10,39 @@
"astro": "astro",
"format:check": "prettier --check .",
"format": "prettier --write .",
"lint": "eslint ."
"lint": "eslint .",
"tinacms": "tinacms",
"tina:dev": "tinacms dev -c 'astro dev'",
"tina:build": "tinacms build"
},
"dependencies": {
"@astrojs/rss": "^4.0.14",
"@astrojs/sitemap": "^3.6.0",
"@fastify/cookie": "^11.0.2",
"@fastify/static": "^9.0.0",
"@resvg/resvg-js": "^2.6.2",
"@tailwindcss/vite": "^4.1.18",
"@tinacms/cli": "^2.1.3",
"@tinacms/datalayer": "^2.0.7",
"abstract-level": "^3.1.1",
"astro": "^5.16.6",
"dayjs": "^1.11.19",
"drizzle-kit": "^0.31.8",
"drizzle-orm": "^0.45.1",
"fastify": "^5.7.2",
"iron-session": "^8.0.4",
"lodash.kebabcase": "^4.1.1",
"openid-client": "^6.8.1",
"pg": "^8.18.0",
"remark-collapse": "^0.1.2",
"remark-toc": "^9.0.0",
"satori": "^0.18.3",
"sharp": "^0.34.5",
"slugify": "^1.6.6",
"tailwindcss": "^4.1.18"
"tailwindcss": "^4.1.18",
"tinacms": "^3.4.0",
"tinacms-gitprovider-github": "^4.0.7",
"zod": "^4.3.6"
},
"devDependencies": {
"@astrojs/check": "^0.9.6",

9916
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
onlyBuiltDependencies:
- esbuild

12
public/admin.html Normal file
View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HEC IA Wiki - Admin</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/admin/index.js"></script>
</body>
</html>

BIN
public/astropaper-og.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@@ -0,0 +1,49 @@
---
title: "HEC IA Annual AI Summit 2026"
description: "Join us for our biggest event of the year featuring industry leaders, researchers, and AI practitioners."
author: "HEC IA"
pubDatetime: 2026-01-20T09:00:00Z
eventDate: 2026-03-15T09:00:00Z
eventEndDate: 2026-03-15T18:00:00Z
location: "HEC Paris Campus, Jouy-en-Josas"
tags: ["summit", "conference", "networking"]
featured: true
registrationLink: "https://hec-ia.com/summit-2026"
---
## About the Summit
The HEC IA Annual AI Summit brings together students, professionals, and researchers to explore the latest developments in artificial intelligence and its impact on business and society.
## Keynote Speakers
- **Dr. Sarah Chen** - Director of AI Research at Google DeepMind
- **Prof. Jean Dupont** - AI Ethics Researcher, Sorbonne University
- **Marie Laurent** - Head of AI Strategy, Total Energies
## Event Schedule
### Morning Session (9:00 - 12:30)
- Opening remarks
- Keynote: "The Future of AI in Business"
- Panel discussion: "AI Ethics and Governance"
### Afternoon Session (14:00 - 18:00)
- Technical workshops
- Startup showcase
- Networking reception
## Who Should Attend
- Students interested in AI careers
- Professionals working with AI
- Researchers and academics
- Entrepreneurs in the AI space
## Registration
Early bird tickets available until February 15th. Student discounts available with valid ID.
**Price**: €50 (Students: €25)

View File

@@ -0,0 +1,36 @@
---
title: "HEC IA Wins Best Student Association Award"
description: "Our association has been recognized for excellence in promoting AI education and innovation."
author: "HEC IA"
pubDatetime: 2026-01-25T10:00:00Z
tags: ["awards", "recognition", "community"]
featured: true
---
## Award Recognition
We're thrilled to announce that HEC IA has been awarded the "Best Student Association" prize at the 2026 French Higher Education Excellence Awards!
## What This Means
This recognition validates our commitment to:
- Providing high-quality AI education to students
- Creating opportunities for hands-on learning
- Building bridges between academia and industry
- Fostering an inclusive AI community
## Looking Forward
This award motivates us to continue our mission of making AI education accessible and engaging. We have exciting plans for 2026, including:
- Expanded workshop series
- New partnership announcements
- Launch of our mentorship program
- International collaboration initiatives
## Thank You
We couldn't have achieved this without our dedicated team, supportive faculty, industry partners, and engaged community members. Thank you all!
Stay tuned for more updates and upcoming events.

View File

@@ -1,10 +0,0 @@
---
title: "Open Clawd : Between brainrot and self-consciousness"
description: "Have we reached AGI ?"
author: "HEC IA"
pubDatetime: 2026-01-25T10:00:00Z
tags: ["agi", "claude", "open-clawd","molt-bot","clawd-bot"]
featured: true
---
## TBA

33
start-tina.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# Script de démarrage TinaCMS pour HEC IA Wiki
# Usage: ./start-tina.sh [dev|prod]
set -e
MODE=${1:-dev}
if [ "$MODE" = "dev" ]; then
echo "🚀 Démarrage de TinaCMS + Astro en mode développement..."
echo "L'interface sera accessible sur http://localhost:4001/admin"
echo ""
pnpm tina:dev
elif [ "$MODE" = "prod" ]; then
echo "🚀 Démarrage de TinaCMS en mode production (self-hosted)..."
echo "Assurez-vous d'avoir configuré Pangolin et PocketID"
echo ""
pnpm tinacms dev --host 0.0.0.0 --port 4001
elif [ "$MODE" = "docker" ]; then
echo "🐳 Démarrage avec Docker Compose..."
docker-compose -f docker-compose.tina.yml up -d
echo ""
echo "TinaCMS est démarré sur http://localhost:4001"
echo "Pour voir les logs: docker-compose -f docker-compose.tina.yml logs -f"
else
echo "Usage: ./start-tina.sh [dev|prod|docker]"
echo ""
echo " dev - Mode développement local (Tina + Astro)"
echo " prod - Mode production (Tina seul, à sécuriser avec Pangolin)"
echo " docker - Démarrage via Docker Compose"
exit 1
fi

47
tina-backend/Dockerfile Normal file
View File

@@ -0,0 +1,47 @@
# Étape 1: Build de l'admin Tina
FROM node:24-alpine AS tina-builder
WORKDIR /app
# Copie des fichiers nécessaires pour Tina
COPY package*.json ./
COPY tina ./tina
COPY public ./public
COPY tsconfig.json ./
# Installation des dépendances
RUN npm install
# Build de l'admin Tina
RUN npx tinacms build
# Étape 2: Build du backend Fastify
FROM node:20-alpine AS backend-builder
WORKDIR /app
COPY tina-backend/package*.json ./
RUN npm install
COPY tina-backend/tsconfig.json ./
COPY tina-backend/src ./src
COPY tina-backend/drizzle.config.ts ./
RUN npm run build
# Étape 3: Image finale
FROM node:20-alpine AS runner
WORKDIR /app
# Copie du backend buildé
COPY --from=backend-builder /app/dist ./dist
COPY --from=backend-builder /app/node_modules ./node_modules
COPY --from=backend-builder /app/package*.json ./
# Copie de l'admin Tina buildé
COPY --from=tina-builder /app/admin ./admin
EXPOSE 3000
CMD ["node", "dist/index.js"]

View File

@@ -0,0 +1,10 @@
import type { Config } from "drizzle-kit";
export default {
schema: "./src/db/schema.ts",
out: "./migrations",
driver: "pg",
dbCredentials: {
connectionString: process.env.DATABASE_URL || "",
},
} satisfies Config;

View File

@@ -0,0 +1,25 @@
CREATE TABLE IF NOT EXISTS tina_kv (
key VARCHAR(512) NOT NULL,
value JSONB NOT NULL,
namespace VARCHAR(100) NOT NULL DEFAULT 'main',
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (key, namespace)
);
CREATE INDEX IF NOT EXISTS idx_namespace ON tina_kv(namespace);
CREATE INDEX IF NOT EXISTS idx_updated ON tina_kv(updated_at);
-- Fonction pour mise à jour automatique du updated_at
CREATE OR REPLACE FUNCTION update_updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = CURRENT_TIMESTAMP;
RETURN NEW;
END;
$$ language 'plpgsql';
CREATE TRIGGER update_tina_kv_updated_at
BEFORE UPDATE ON tina_kv
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();

33
tina-backend/package.json Normal file
View File

@@ -0,0 +1,33 @@
{
"name": "tina-backend",
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate"
},
"dependencies": {
"@fastify/cookie": "^9.3.1",
"@fastify/cors": "^9.0.1",
"@fastify/static": "^7.0.1",
"@tinacms/datalayer": "^1.2.0",
"abstract-level": "^1.0.4",
"drizzle-orm": "^0.30.0",
"fastify": "^4.26.0",
"iron-session": "^8.0.1",
"openid-client": "^5.6.0",
"pg": "^8.11.0",
"tinacms-gitprovider-github": "^1.0.0",
"zod": "^3.22.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@types/pg": "^8.11.0",
"drizzle-kit": "^0.20.0",
"tsx": "^4.7.0",
"typescript": "^5.3.0"
}
}

View File

@@ -0,0 +1,147 @@
import { BackendAuthProvider } from "@tinacms/datalayer";
import { FastifyRequest, FastifyReply } from "fastify";
import { getSession } from "./session";
import { Issuer, generators } from "openid-client";
// Stockage temporaire des states (en production, utiliser Redis)
const stateStore = new Map<string, { timestamp: number }>();
// Nettoyage périodique des states expirés (5 minutes)
setInterval(() => {
const now = Date.now();
for (const [state, data] of stateStore.entries()) {
if (now - data.timestamp > 5 * 60 * 1000) {
stateStore.delete(state);
}
}
}, 60 * 1000);
async function getOIDCClient() {
const issuer = await Issuer.discover(process.env.OIDC_ISSUER!);
return new issuer.Client({
client_id: process.env.OIDC_CLIENT_ID!,
client_secret: process.env.OIDC_CLIENT_SECRET!,
redirect_uris: [process.env.OIDC_CALLBACK_URL!],
response_types: ["code"],
});
}
function generateState(): string {
const state = generators.state();
stateStore.set(state, { timestamp: Date.now() });
return state;
}
function validateState(state: string): boolean {
const data = stateStore.get(state);
if (!data) return false;
// Vérifier que le state n'est pas expiré (5 minutes)
if (Date.now() - data.timestamp > 5 * 60 * 1000) {
stateStore.delete(state);
return false;
}
stateStore.delete(state);
return true;
}
export const createOIDCBackendAuth = (): BackendAuthProvider => {
return {
isAuthorized: async (req: FastifyRequest, res: FastifyReply) => {
const session = await getSession(req, res);
if (!session.user) {
return {
isAuthorized: false,
errorMessage: "Unauthorized",
errorCode: 401,
};
}
return { isAuthorized: true };
},
extraRoutes: {
"/auth/login": {
secure: false,
handler: async (req, res) => {
const client = await getOIDCClient();
const state = generateState();
const authorizationUrl = client.authorizationUrl({
scope: process.env.OIDC_SCOPE || "openid profile email",
state,
});
res.redirect(authorizationUrl);
},
},
"/auth/callback": {
secure: false,
handler: async (req, res) => {
try {
const client = await getOIDCClient();
const params = client.callbackParams(req.raw);
// Vérifier le state pour prévenir les attaques CSRF
if (!params.state || !validateState(params.state)) {
return res.status(400).send({ error: "Invalid state parameter" });
}
// Échanger le code contre des tokens
const tokenSet = await client.callback(
process.env.OIDC_CALLBACK_URL!,
params,
{ state: params.state }
);
// Valider et extraire les claims
const claims = tokenSet.claims();
// Créer la session
const session = await getSession(req, res);
session.user = {
id: claims.sub,
email: claims.email || "",
name: claims.name || claims.preferred_username || "",
};
session.accessToken = tokenSet.access_token;
session.idToken = tokenSet.id_token;
await session.save();
// Rediriger vers l'admin
res.redirect("/admin");
} catch (error) {
console.error("OIDC callback error:", error);
res.status(500).send({ error: "Authentication failed" });
}
},
},
"/auth/logout": {
secure: false,
handler: async (req, res) => {
const session = await getSession(req, res);
session.destroy();
res.redirect("/admin");
},
},
"/api/me": {
secure: false,
handler: async (req, res) => {
const session = await getSession(req, res);
if (!session.user) {
return res.status(401).send({ error: "Not authenticated" });
}
return session.user;
},
},
},
};
};

View File

@@ -0,0 +1,27 @@
import { getIronSession, IronSessionOptions } from "iron-session";
import { FastifyRequest, FastifyReply } from "fastify";
export interface SessionData {
user?: {
id: string;
email: string;
name: string;
};
accessToken?: string;
idToken?: string;
}
const sessionOptions: IronSessionOptions = {
password: process.env.SESSION_SECRET!,
cookieName: "tina_session",
cookieOptions: {
secure: process.env.NODE_ENV === "production",
httpOnly: true,
sameSite: "lax",
maxAge: 60 * 60 * 24 * 7, // 7 jours
},
};
export async function getSession(req: FastifyRequest, res: FastifyReply) {
return getIronSession<SessionData>(req.raw, res.raw, sessionOptions);
}

View File

@@ -0,0 +1,28 @@
import { z } from "zod";
const configSchema = z.object({
// Database
DATABASE_URL: z.string().url(),
// OIDC Configuration
OIDC_ISSUER: z.string().url(),
OIDC_CLIENT_ID: z.string(),
OIDC_CLIENT_SECRET: z.string(),
OIDC_CALLBACK_URL: z.string().url(),
OIDC_SCOPE: z.string().default("openid profile email"),
// Session (Iron)
SESSION_SECRET: z.string().min(32),
// GitHub
GITHUB_TOKEN: z.string(),
GITHUB_REPO: z.string(),
GITHUB_OWNER: z.string(),
GITHUB_BRANCH: z.string().default("main"),
// Server
PORT: z.string().default("3000"),
NODE_ENV: z.enum(["development", "production"]).default("development"),
});
export const config = configSchema.parse(process.env);

View File

@@ -0,0 +1,234 @@
import { AbstractLevel, AbstractIterator, AbstractDatabaseOptions } from "abstract-level";
import { db } from "../db";
import { tinaKv } from "../db/schema";
import { eq, and, gte, lt, sql } from "drizzle-orm";
// Types
interface NodeCallback<T> {
(err: Error | null, result?: T): void;
}
interface IteratorOptions {
gt?: string;
gte?: string;
lt?: string;
lte?: string;
reverse?: boolean;
limit?: number;
keys?: boolean;
values?: boolean;
}
interface PostgresLevelOptions {
connectionString: string;
namespace?: string;
}
// Iterator personnalisé pour PostgreSQL
class PostgresIterator extends AbstractIterator<string, any> {
private namespace: string;
private options: IteratorOptions;
private results: { key: string; value: any }[] = [];
private currentIndex = 0;
private initialized = false;
constructor(db: any, options: IteratorOptions, namespace: string) {
super(db);
this.options = options;
this.namespace = namespace;
}
private async initialize(): Promise<void> {
if (this.initialized) return;
// Construire la requête
let query = db
.select({
key: tinaKv.key,
value: tinaKv.value,
})
.from(tinaKv)
.where(eq(tinaKv.namespace, this.namespace));
// Gestion des bounds
const conditions = [];
if (this.options.gt !== undefined) {
conditions.push(sql`${tinaKv.key} > ${this.options.gt}`);
}
if (this.options.gte !== undefined) {
conditions.push(sql`${tinaKv.key} >= ${this.options.gte}`);
}
if (this.options.lt !== undefined) {
conditions.push(sql`${tinaKv.key} < ${this.options.lt}`);
}
if (this.options.lte !== undefined) {
conditions.push(sql`${tinaKv.key} <= ${this.options.lte}`);
}
if (conditions.length > 0) {
query = query.where(and(...conditions, eq(tinaKv.namespace, this.namespace)));
}
// Ordre
if (this.options.reverse) {
query = query.orderBy(sql`${tinaKv.key} DESC`);
} else {
query = query.orderBy(tinaKv.key);
}
// Limite
if (this.options.limit !== undefined && this.options.limit > 0) {
query = query.limit(this.options.limit);
}
this.results = await query;
this.initialized = true;
}
async _next(callback: NodeCallback<{ key: string; value: any }>): Promise<void> {
try {
await this.initialize();
if (this.currentIndex >= this.results.length) {
return callback(null, undefined as any);
}
const item = this.results[this.currentIndex++];
// Gestion des options keys/values
const result: { key?: string; value?: any } = {};
if (this.options.keys !== false) {
result.key = item.key;
}
if (this.options.values !== false) {
result.value = item.value;
}
callback(null, result as { key: string; value: any });
} catch (error) {
callback(error as Error);
}
}
_seek(target: string): void {
this.currentIndex = this.results.findIndex(r => r.key >= target);
if (this.currentIndex < 0) {
this.currentIndex = this.results.length;
}
}
_end(callback: NodeCallback<void>): void {
this.results = [];
this.initialized = false;
callback(null);
}
}
// Classe principale PostgreSQL Level
export class PostgresLevel extends AbstractLevel<string, any> {
private namespace: string;
constructor(options: PostgresLevelOptions) {
// @ts-ignore - abstract-level constructor accepte des options
super({
keyEncoding: "utf8",
valueEncoding: "json",
});
this.namespace = options.namespace || "main";
}
async _put(key: string, value: any): Promise<void> {
await db
.insert(tinaKv)
.values({
key,
value,
namespace: this.namespace,
})
.onConflictDoUpdate({
target: [tinaKv.key, tinaKv.namespace],
set: { value },
});
}
async _get(key: string): Promise<any> {
const result = await db
.select({ value: tinaKv.value })
.from(tinaKv)
.where(and(eq(tinaKv.key, key), eq(tinaKv.namespace, this.namespace)))
.limit(1);
if (result.length === 0) {
const error = new Error(`Key not found: ${key}`) as Error & { notFound?: boolean; status?: number };
error.notFound = true;
error.status = 404;
throw error;
}
return result[0].value;
}
async _del(key: string): Promise<void> {
await db
.delete(tinaKv)
.where(and(eq(tinaKv.key, key), eq(tinaKv.namespace, this.namespace)));
}
async _batch(operations: Array<{ type: "put" | "del"; key: string; value?: any }>): Promise<void> {
// Utiliser une transaction pour les opérations batch
await db.transaction(async (tx) => {
for (const op of operations) {
if (op.type === "put") {
await tx
.insert(tinaKv)
.values({
key: op.key,
value: op.value,
namespace: this.namespace,
})
.onConflictDoUpdate({
target: [tinaKv.key, tinaKv.namespace],
set: { value: op.value },
});
} else if (op.type === "del") {
await tx
.delete(tinaKv)
.where(and(eq(tinaKv.key, op.key), eq(tinaKv.namespace, this.namespace)));
}
}
});
}
_iterator(options: IteratorOptions): PostgresIterator {
return new PostgresIterator(this, options, this.namespace);
}
async _clear(options: { gt?: string; gte?: string; lt?: string; lte?: string }): Promise<void> {
let query = db.delete(tinaKv).where(eq(tinaKv.namespace, this.namespace));
const conditions = [];
if (options.gt !== undefined) {
conditions.push(sql`${tinaKv.key} > ${options.gt}`);
}
if (options.gte !== undefined) {
conditions.push(sql`${tinaKv.key} >= ${options.gte}`);
}
if (options.lt !== undefined) {
conditions.push(sql`${tinaKv.key} < ${options.lt}`);
}
if (options.lte !== undefined) {
conditions.push(sql`${tinaKv.key} <= ${options.lte}`);
}
if (conditions.length > 0) {
query = db
.delete(tinaKv)
.where(and(...conditions, eq(tinaKv.namespace, this.namespace)));
}
await query;
}
}

View File

@@ -0,0 +1,9 @@
import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
import * as schema from "./schema";
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export const db = drizzle(pool, { schema });

View File

@@ -0,0 +1,11 @@
import { pgTable, varchar, jsonb, timestamp, primaryKey } from "drizzle-orm/pg-core";
export const tinaKv = pgTable("tina_kv", {
key: varchar("key", { length: 512 }).notNull(),
value: jsonb("value").notNull(),
namespace: varchar("namespace", { length: 100 }).notNull().default("main"),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow(),
}, (table) => ({
pk: primaryKey({ columns: [table.key, table.namespace] }),
}));

79
tina-backend/src/index.ts Normal file
View File

@@ -0,0 +1,79 @@
import Fastify from "fastify";
import cors from "@fastify/cors";
import cookie from "@fastify/cookie";
import staticFiles from "@fastify/static";
import path from "path";
import { fileURLToPath } from "url";
import { TinaNodeBackend, createDatabase } from "@tinacms/datalayer";
import { GitHubProvider } from "tinacms-gitprovider-github";
import { createOIDCBackendAuth } from "./auth/oidc-backend.js";
import { PostgresLevel } from "./database/postgres-adapter.js";
import { config } from "./config.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const fastify = Fastify({
logger: true,
});
// Plugins
await fastify.register(cors, {
origin: true,
credentials: true,
});
await fastify.register(cookie);
// Static files (Tina Admin build)
await fastify.register(staticFiles, {
root: path.join(__dirname, "../admin"),
prefix: "/admin/",
});
// Database Adapter
const dbAdapter = new PostgresLevel({
connectionString: config.DATABASE_URL,
namespace: config.GITHUB_BRANCH,
});
// Git Provider
const gitProvider = new GitHubProvider({
repo: config.GITHUB_REPO,
owner: config.GITHUB_OWNER,
token: config.GITHUB_TOKEN,
branch: config.GITHUB_BRANCH,
});
// Create Database
const database = createDatabase({
gitProvider,
databaseAdapter: dbAdapter,
});
// Tina Backend Handler
const tinaBackend = TinaNodeBackend({
authProvider: createOIDCBackendAuth(),
databaseClient: database,
});
// Routes
fastify.all("/api/tina/*", async (request, reply) => {
await tinaBackend(request.raw, reply.raw);
});
// Route racine pour /admin
fastify.get("/admin", async (request, reply) => {
return reply.sendFile("index.html");
});
// Health check
fastify.get("/health", async () => {
return { status: "ok" };
});
// Start server
fastify.listen({
port: parseInt(config.PORT),
host: "0.0.0.0",
});

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"resolveJsonModule": true,
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}

4
tina/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
__generated__
node_modules
.env
*.log

View File

@@ -0,0 +1,27 @@
import { AbstractAuthProvider } from "tinacms";
export class OIDCAuthProvider extends AbstractAuthProvider {
async authenticate(): Promise<any> {
window.location.href = "/auth/login";
}
async getUser(): Promise<any> {
// Appel à une route /api/me pour récupérer l'utilisateur
const res = await fetch("/api/me", {
credentials: "include",
});
if (res.ok) {
return await res.json();
}
return null;
}
async getToken(): Promise<{ id_token: string }> {
// Le token est géré par les cookies, pas besoin de le retourner
return { id_token: "" };
}
async logout(): Promise<void> {
window.location.href = "/auth/logout";
}
}

617
tina/config.ts Normal file
View File

@@ -0,0 +1,617 @@
import { defineConfig, LocalAuthProvider } from "tinacms";
import { OIDCAuthProvider } from "./auth/oidc-provider";
const isLocal = process.env.TINA_PUBLIC_IS_LOCAL === "true";
export default defineConfig({
branch: "main",
// Self-hosted: pas de clientId/token
contentApiUrlOverride: isLocal
? undefined
: "https://tina.hec-ia.com/api/tina/gql",
authProvider: isLocal
? new LocalAuthProvider()
: new OIDCAuthProvider(),
build: {
outputFolder: "admin",
publicFolder: "public",
},
media: {
tina: {
mediaRoot: "uploads",
publicFolder: "public",
},
},
search: {
tina: {
indexerToken: "", // Mode local
stopwordLanguages: ["fra"],
},
},
schema: {
collections: [
{
name: "blog",
label: "Articles de blog",
path: "src/data/blog",
format: "md",
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.title
?.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-");
},
},
},
fields: [
{
type: "string" as const,
name: "title",
label: "Titre",
isTitle: true,
required: true,
},
{
type: "string" as const,
name: "description",
label: "Description",
required: true,
ui: {
component: "textarea",
},
},
{
type: "string" as const,
name: "author",
label: "Auteur",
required: false,
},
{
type: "datetime" as const,
name: "pubDatetime",
label: "Date de publication",
required: true,
},
{
type: "datetime" as const,
name: "modDatetime",
label: "Date de modification",
required: false,
},
{
type: "string" as const,
name: "tags",
label: "Tags",
list: true,
required: false,
},
{
type: "boolean" as const,
name: "draft",
label: "Brouillon",
required: false,
},
{
type: "boolean" as const,
name: "featured",
label: "Mis en avant",
required: false,
},
{
type: "string" as const,
name: "canonicalURL",
label: "URL canonique",
required: false,
},
{
type: "boolean" as const,
name: "hideEditPost",
label: "Cacher le lien d'édition",
required: false,
},
{
type: "string" as const,
name: "timezone",
label: "Fuseau horaire",
required: false,
},
{
type: "image" as const,
name: "ogImage",
label: "Image Open Graph",
required: false,
},
{
type: "rich-text" as const,
name: "body",
label: "Contenu",
isBody: true,
},
],
},
{
name: "events",
label: "Événements",
path: "src/data/events",
format: "md",
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.title
?.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-");
},
},
},
fields: [
{
type: "string" as const,
name: "title",
label: "Titre",
isTitle: true,
required: true,
},
{
type: "string" as const,
name: "description",
label: "Description",
required: true,
ui: {
component: "textarea",
},
},
{
type: "string" as const,
name: "author",
label: "Auteur",
required: false,
},
{
type: "datetime" as const,
name: "pubDatetime",
label: "Date de publication",
required: true,
},
{
type: "datetime" as const,
name: "modDatetime",
label: "Date de modification",
required: false,
},
{
type: "string" as const,
name: "tags",
label: "Tags",
list: true,
required: false,
},
{
type: "boolean" as const,
name: "draft",
label: "Brouillon",
required: false,
},
{
type: "boolean" as const,
name: "featured",
label: "Mis en avant",
required: false,
},
{
type: "string" as const,
name: "canonicalURL",
label: "URL canonique",
required: false,
},
{
type: "boolean" as const,
name: "hideEditPost",
label: "Cacher le lien d'édition",
required: false,
},
{
type: "string" as const,
name: "timezone",
label: "Fuseau horaire",
required: false,
},
{
type: "datetime" as const,
name: "eventDate",
label: "Date de l'événement",
required: true,
},
{
type: "datetime" as const,
name: "eventEndDate",
label: "Date de fin",
required: false,
},
{
type: "string" as const,
name: "location",
label: "Lieu",
required: false,
},
{
type: "string" as const,
name: "registrationLink",
label: "Lien d'inscription",
required: false,
},
{
type: "image" as const,
name: "ogImage",
label: "Image Open Graph",
required: false,
},
{
type: "rich-text" as const,
name: "body",
label: "Contenu",
isBody: true,
},
],
},
{
name: "workshops",
label: "Ateliers",
path: "src/data/workshops",
format: "md",
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.title
?.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-");
},
},
},
fields: [
{
type: "string" as const,
name: "title",
label: "Titre",
isTitle: true,
required: true,
},
{
type: "string" as const,
name: "description",
label: "Description",
required: true,
ui: {
component: "textarea",
},
},
{
type: "string" as const,
name: "author",
label: "Auteur",
required: false,
},
{
type: "datetime" as const,
name: "pubDatetime",
label: "Date de publication",
required: true,
},
{
type: "datetime" as const,
name: "modDatetime",
label: "Date de modification",
required: false,
},
{
type: "string" as const,
name: "tags",
label: "Tags",
list: true,
required: false,
},
{
type: "boolean" as const,
name: "draft",
label: "Brouillon",
required: false,
},
{
type: "boolean" as const,
name: "featured",
label: "Mis en avant",
required: false,
},
{
type: "string" as const,
name: "canonicalURL",
label: "URL canonique",
required: false,
},
{
type: "boolean" as const,
name: "hideEditPost",
label: "Cacher le lien d'édition",
required: false,
},
{
type: "string" as const,
name: "timezone",
label: "Fuseau horaire",
required: false,
},
{
type: "datetime" as const,
name: "workshopDate",
label: "Date de l'atelier",
required: true,
},
{
type: "string" as const,
name: "duration",
label: "Durée",
required: false,
},
{
type: "string" as const,
name: "level",
label: "Niveau",
options: [
{ label: "Débutant", value: "beginner" },
{ label: "Intermédiaire", value: "intermediate" },
{ label: "Avancé", value: "advanced" },
],
required: false,
},
{
type: "string" as const,
name: "materials",
label: "Matériaux/Supports",
required: false,
},
{
type: "image" as const,
name: "ogImage",
label: "Image Open Graph",
required: false,
},
{
type: "rich-text" as const,
name: "body",
label: "Contenu",
isBody: true,
},
],
},
{
name: "news",
label: "Actualités",
path: "src/data/news",
format: "md",
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.title
?.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-");
},
},
},
fields: [
{
type: "string" as const,
name: "title",
label: "Titre",
isTitle: true,
required: true,
},
{
type: "string" as const,
name: "description",
label: "Description",
required: true,
ui: {
component: "textarea",
},
},
{
type: "string" as const,
name: "author",
label: "Auteur",
required: false,
},
{
type: "datetime" as const,
name: "pubDatetime",
label: "Date de publication",
required: true,
},
{
type: "datetime" as const,
name: "modDatetime",
label: "Date de modification",
required: false,
},
{
type: "string" as const,
name: "tags",
label: "Tags",
list: true,
required: false,
},
{
type: "boolean" as const,
name: "draft",
label: "Brouillon",
required: false,
},
{
type: "boolean" as const,
name: "featured",
label: "Mis en avant",
required: false,
},
{
type: "string" as const,
name: "canonicalURL",
label: "URL canonique",
required: false,
},
{
type: "boolean" as const,
name: "hideEditPost",
label: "Cacher le lien d'édition",
required: false,
},
{
type: "string" as const,
name: "timezone",
label: "Fuseau horaire",
required: false,
},
{
type: "image" as const,
name: "ogImage",
label: "Image Open Graph",
required: false,
},
{
type: "rich-text" as const,
name: "body",
label: "Contenu",
isBody: true,
},
],
},
{
name: "technical",
label: "Articles techniques",
path: "src/data/technical",
format: "md",
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.title
?.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-");
},
},
},
fields: [
{
type: "string" as const,
name: "title",
label: "Titre",
isTitle: true,
required: true,
},
{
type: "string" as const,
name: "description",
label: "Description",
required: true,
ui: {
component: "textarea",
},
},
{
type: "string" as const,
name: "author",
label: "Auteur",
required: false,
},
{
type: "datetime" as const,
name: "pubDatetime",
label: "Date de publication",
required: true,
},
{
type: "datetime" as const,
name: "modDatetime",
label: "Date de modification",
required: false,
},
{
type: "string" as const,
name: "tags",
label: "Tags",
list: true,
required: false,
},
{
type: "boolean" as const,
name: "draft",
label: "Brouillon",
required: false,
},
{
type: "boolean" as const,
name: "featured",
label: "Mis en avant",
required: false,
},
{
type: "string" as const,
name: "canonicalURL",
label: "URL canonique",
required: false,
},
{
type: "boolean" as const,
name: "hideEditPost",
label: "Cacher le lien d'édition",
required: false,
},
{
type: "string" as const,
name: "timezone",
label: "Fuseau horaire",
required: false,
},
{
type: "string" as const,
name: "difficulty",
label: "Difficulté",
options: [
{ label: "Débutant", value: "beginner" },
{ label: "Intermédiaire", value: "intermediate" },
{ label: "Avancé", value: "advanced" },
],
required: false,
},
{
type: "string" as const,
name: "readingTime",
label: "Temps de lecture",
required: false,
},
{
type: "image" as const,
name: "ogImage",
label: "Image Open Graph",
required: false,
},
{
type: "rich-text" as const,
name: "body",
label: "Contenu",
isBody: true,
},
],
},
],
},
});

1
tina/tina-lock.json Normal file

File diff suppressed because one or more lines are too long