Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sveltia cms setup #76

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/assets/public/admin/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
backend:
name: github
repo: aloxe/reunionweb # Path to your GitHub repository
branch: test
branch: ecrire
base_url: https://my.reunionweb.org # Path to ext auth provider
media_folder: "media/uploads"

Expand Down Expand Up @@ -32,3 +32,19 @@ collections:
- {label: "Publish Date", name: "date", widget: "datetime", time_format: false, date_format: "YYYY-MM", format: "YYYY-MM"}
- {label: "categorie", name: "categorie", widget: "array"}
- {label: "Body", name: "body", widget: "markdown"}
- label: "Settings"
name: "settings"
editor:
preview: false
files:
- label: "Liens"
name: "liens"
file: "src/data/liens.yaml"
fields:
- { label: Id, name: id, widget: number }
- { label: title, name: title, widget: string }
- { label: url, name: url, widget: string }
- { label: parent, name: parent, widget: string }
- { label: importance, name: importance, widget: number }
- { label: description, name: description, widget: string }
- { label: article, name: article, widget: array }
2 changes: 1 addition & 1 deletion src/layouts/macros/title.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<a href="{{url}}">{{post.data.short or post.data.title}}</a>
{% endif %}
{% if post.data.date and url === post.data.date.split("-").join('') %} {# articles #}
{# .split("-").join('') | date("yyyy-MM") %} #}
{# .split("-").join('') | date("YYYY-MM") %} #}
<a href="/{{ post.data.title | slugify }}/">{{ post.data.title }}</a>
{% endif %}
{% endfor %}
Expand Down
10 changes: 5 additions & 5 deletions src/layouts/sitemap.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{%- for item in collections.article %}
<url>
<loc>{{ item.url | absoluteUrl(meta.url) }}</loc>
<lastmod>{{ item.date | date("yyyy-MM-dd")}}</lastmod>
<lastmod>{{ item.date | date("YYYY-MM-dd")}}</lastmod>
<changefreq>{{ item.data.sitemapChangefreq | default("monthly") }}</changefreq>
<priority>{{ item.data.sitemapPriority | default(0.8) }}</priority>
</url>
Expand All @@ -14,23 +14,23 @@
{%- if item.url.split("/")[1] === "" %}
<url>
<loc>{{ item.url | absoluteUrl(meta.url) }}</loc>
<lastmod>{{ item.date | date("yyyy-MM-dd")}}</lastmod>
<lastmod>{{ item.date | date("YYYY-MM-dd")}}</lastmod>
<changefreq>{{ item.data.sitemapChangefreq | default("weekly") }}</changefreq>
<priority>{{ item.data.sitemapPriority | default(0.8) }}</priority>
</url>
{%- endif -%}
{%- if item.url.split("/")[1] === "decouverte" %}
<url>
<loc>{{ item.url | absoluteUrl(meta.url) }}</loc>
<lastmod>{{ item.date | date("yyyy-MM-dd")}}</lastmod>
<lastmod>{{ item.date | date("YYYY-MM-dd")}}</lastmod>
<changefreq>{{ item.data.sitemapChangefreq | default("yearly") }}</changefreq>
<priority>{{ item.data.sitemapPriority | default(0.7) }}</priority>
</url>
{%- endif -%}
{%- if item.url.split("/")[1] === "liens" %}
<url>
<loc>{{ item.url | absoluteUrl(meta.url) }}</loc>
<lastmod>{{ item.date | date("yyyy-MM-dd")}}</lastmod>
<lastmod>{{ item.date | date("YYYY-MM-dd")}}</lastmod>
<changefreq>{{ item.data.sitemapChangefreq | default("monthly") }}</changefreq>
<priority>{{ item.data.sitemapPriority | default(0.5) }}</priority>
</url>
Expand All @@ -41,7 +41,7 @@
{%- set snipeturl = "/"+categoryUrl(item.slug) | trim %}
<url>
<loc>{{ snipeturl | absoluteUrl(meta.url) }}</loc>
<lastmod>{{ page.date | date("yyyy-MM-dd")}}</lastmod>
<lastmod>{{ page.date | date("YYYY-MM-dd")}}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.3</priority>
</url>
Expand Down
Loading