Skip to content

Commit

Permalink
Merge pull request #7 from kosssi/patch-1
Browse files Browse the repository at this point in the history
Add Decap CMS configuration example
  • Loading branch information
h-enk authored Dec 15, 2023
2 parents a6af2be + cbe1f44 commit 7b28082
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/content/docs/guides/cms/decap-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,59 @@ import List from '~/components/List.astro';
- [How to integrate Decap CMS with Hugo](https://decapcms.org/docs/hugo/).
- [Hugo template with Decap CMS](https://github.com/decaporg/one-click-hugo-cms)
</List>

## Example

Here is an example of a simple configuration `config.yml` :
```
locale: 'fr'
backend:
name: gitea
repo: *********/******** # Path to your Gitea repository
app_id: ********-****-****-****-************
api_root: https://*****.*****.***/api/v1 # API URL of your Gitea instance
base_url: https://*****.*****.*** # Root URL of your Gitea instance
branch: main
media_folder: static/img
public_folder: /img
collections:
- name: 'docs'
label: 'Docs'
folder: 'content/docs'
nested: { depth: 5 }
create: true
slug: '{{slug}}'
editor:
preview: false
fields:
- { label: 'Titre', name: 'title', widget: 'string' }
- { label: 'Description', name: 'description', widget: 'string' }
- { label: 'Résumé', name: 'summary', widget: 'string' }
- { label: 'Date de publication', name: 'date', widget: 'datetime' }
- { label: 'Date de mise à jour', name: 'lastmod', widget: 'datetime' }
- { label: 'Brouillon', name: 'draft', widget: 'boolean', default: true }
- {
label: 'Menu', name: 'menu', widget: 'object', required: false, collapsed: true,
fields: [
{
label: 'docs', name: 'docs', widget: 'object', required: false, collapsed: true,
fields: [
{ label: 'Parent', name: 'parent', widget: 'string' },
{ label: 'Identifiant', name: 'identifier', widget: 'string' }
]
}
]
}
- { label: 'Poid', name: 'weight', widget: 'number', value_type: 'integer' }
- { label: 'toc', name: 'toc', widget: 'boolean', default: true }
- {
label: 'SEO', name: 'seo', widget: 'object', required: false, collapsed: true,
fields: [
{ label: 'Titre', name: 'title', widget: 'string' },
{ label: 'Description', name: 'description', widget: 'string' },
{ label: 'Canonical', name: 'canonical', widget: 'string' },
{ label: 'noindex', name: 'noindex', widget: 'boolean', default: false }
]
}
- { label: 'Body', name: 'body', widget: 'markdown' }
```

0 comments on commit 7b28082

Please # to comment.