Thinkmill / Thinkmill/keystatic

Admin panel does not work with trailingSlash: "always" in Astro js

Open
#1,042 8 comments 2 reactions 2 assignees View on GitHub

@emmatown is already working on this.

Since Jun 12, 2024.

bug:unconfirmed framework:astro
Dominant language
TypeScript
Stars
2.4k
Forks
159
Avg merge
21h 41m
Merged PRs (30d)
2

Description

Hi there, I've installed Astro through Keystatic CLI, then changed trailingslash configuration to "always", but admin panel still uses no trailing slash path. That shoots errors, 404s every now and then

Astro config

import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import markdoc from '@astrojs/markdoc';
import keystatic from '@keystatic/astro';

import mdx from "@astrojs/mdx";

// https://astro.build/config
export default defineConfig({
  trailingSlash: "always",
  integrations: [react(), markdoc(), keystatic(), mdx()],
  output: 'hybrid'
});

Keystatic config:

import { config, fields, collection } from '@keystatic/core';

export default config({
  storage: {
    kind: 'local',
  },
  collections: {
    posts: collection({
      label: 'Posts',
      slugField: 'title',
      path: 'src/content/posts/*',
      format: { contentField: 'content' },
      schema: {
        title: fields.slug({ name: {
           label: 'Title',
           description: 'modifies meta, SERP, OG',
           validation: {
            isRequired: true,
            length: { min: 58 } } 
          } }),
        description: fields.text({
          label: 'Description',
          multiline: true,
          validation: {
            isRequired: true,
            length: { min: 150, max: 160 } },
        }),
        pubDate: fields.date({ label: 'Pub Date', defaultValue: { kind: "today" }, validation: { isRequired: true } }),
        lastMod: fields.date({ label: 'Last mod', defaultValue: { kind: "today" }, validation: { isRequired: true }}),
        articleSection: fields.text({ label: 'Article section', description: 'modifies OG', defaultValue: 'retirement', validation: { isRequired: true }, }),
        content: fields.mdx ({ label: 'Content' }),
      },
    }),
    authors: collection({
      label: 'Authors',
      slugField: 'name',
      path: 'src/content/authors/*',
      schema: {
        name: fields.slug({ name: { label: 'Name' } }),
      }
    })
  },
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.