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

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

Open
f33w opened this issue Mar 31, 2024 · 0 comments
Open

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

f33w opened this issue Mar 31, 2024 · 0 comments
Labels
bug:unconfirmed Potential bug, needs confirmation. framework:astro Related to the Astro framework.

Comments

@f33w
Copy link
Contributor

f33w commented Mar 31, 2024

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' } }),
      }
    })
  },
});
@jossmac jossmac added bug:unconfirmed Potential bug, needs confirmation. framework:astro Related to the Astro framework. labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:unconfirmed Potential bug, needs confirmation. framework:astro Related to the Astro framework.
Projects
None yet
Development

No branches or pull requests

2 participants