content icon indicating copy to clipboard operation
content copied to clipboard

Updating .md files in remote git repository doesn't update content on deployed site

Open tgdflav opened this issue 11 months ago • 6 comments

Environment

Version

v3.1.0

Reproduction

Description

I have a nuxt site running successfully with nuxt/content pulling md files from a remote github repository. Once the site is deployed, new md files added to the remote repository will not show up until the site is fully redeployed again.

Is this expected behavior or am I doing something wrong? The only reason to keep content in a separate repository is to update the content without having to redeploy the whole site.

Additional context

No response

Logs


tgdflav avatar Feb 03 '25 16:02 tgdflav

same here😢, any solution?

NekoWings avatar Jul 17 '25 07:07 NekoWings

I believe this is expected behavior

May I ask how you got it running on a remote repository? I followed the documentation but could not get it to work

alvivanco avatar Aug 02 '25 02:08 alvivanco

sadly i never got this running, so i swapped to using astro which does what i need

tgdflav avatar Aug 02 '25 03:08 tgdflav

ah! ok Astro is awesome as well. While you responded, I actually got it working on my end. If you're ever back at it, lmk

alvivanco avatar Aug 02 '25 03:08 alvivanco

I'm interested in your solution too @alvivanco

J3m5 avatar Aug 02 '25 16:08 J3m5

@J3m5 when creating a remote repository for content management and compatibility with Nuxt Studio, these are the general steps to follow. If you have any questions feel free to ping me on X/Twitter.

1. Create Content Repository

  • Create a new GitHub repository (private)

2. Structure Your Content Repository

  • Create folder structure: content/[collection name]
  • Add your markdown files in this folder
  • Each markdown file needs proper frontmatter with required fields

3. Generate GitHub Personal Access Token

  • Go to GitHub Settings → Developer Settings → Personal Access Tokens
  • Generate new token (classic)
  • Select scopes: repo (full repository access) and read:user
  • Copy the token (starts with ghp_)

4. Set Environment Variable

  • Add GITHUB_TOKEN=your_token_here to your .env file locally
  • Add the same environment variable to your production hosting platform

5. Configure Nuxt Content

  • Create content.config.ts in your main app repository
  • Define your collection with the remote repository URL
  • Include the GitHub token reference and file schema

6. Update Nuxt Config

  • Add Nuxt Studio preview configuration to nuxt.config.ts
  • Include your repository owner, name, and URL in the gitInfo section
  • Point to the Nuxt Studio API endpoint

7. Connect to Nuxt Studio

  • Visit nuxt.studio and sign in with GitHub
  • Connect your content repository (not your main app)

8. Test the Setup

  • Start your local development server
  • Verify content loads from the remote repository
  • Make a test edit in Nuxt Studio to confirm live preview works

9. Deploy

  • Deploy your main application with the environment variable set
  • Ensure the GitHub token has access to your content repository
  • Verify content loads in production

alvivanco avatar Aug 03 '25 06:08 alvivanco