Import existing content from your repository
Bring the Markdown and MDX files already in your repository into Acrosite as Drafts, see what each file becomes before you import, and understand which files Acrosite then manages.
Already have Markdown or MDX files in your repository? You can bring them into Acrosite as Drafts instead of copying them by hand. Importing reads the files in each content type's folder on the project's connected branch and changes nothing in your repository.
Who this is for
Owners, Admins, Managers, Developers and Editors in a project whose repository is connected in GitHub Setup. Authors, Viewers and Client Reviewers cannot import, and nothing can be imported while a workspace is read-only.
Before you start
- Connect the repository and branch in GitHub Setup.
- Point each content type at the folder your site already uses: open its Repository Output under Content Structure and set the Content Folder and File Type. See Acrosite-managed content paths.
- If your files use frontmatter keys you want to keep, add a Custom Field with the same Field Key first.
Import your files
- Open the project's Content Items and choose Import From Repository. You can also start from GitHub Setup.
- Acrosite scans the newest commit of the connected branch. It lists the Markdown and MDX files directly in each content type's folder, up to 100 per page. Files in subfolders are not scanned.
- Check what happens to each file: Will link, Draft only or Skipped, with the reason and any warnings.
- Choose the files and select the import button, which shows how many files you chose, for example Import 12 as Drafts. You can import up to 50 files at a time. Scan again for the next batch.
If someone pushes to the branch between the scan and the import, Acrosite asks you to scan again, so every file is imported exactly as you reviewed it.
GitHub allows the Acrosite GitHub App a limited number of requests each hour, and publishing uses the same allowance. If few are left, Acrosite stops reading your repository before it imports anything and asks you to try again later, so your scheduled publishing keeps working.
What a linked file means
A file is linked when it sits exactly where Acrosite writes that item: in the content type's folder, with a file name that is already a slug, and with the type's file type. A linked file becomes a file Acrosite manages:
- The next publish rewrites the file in Acrosite's format (see Generated Markdown and frontmatter) instead of creating a second file.
- If you change the item's slug or its type's folder, the next publish writes the new file and removes the old one if it is unchanged.
- Unpublish removes the file from the repository. See Unpublish content.
A file that is Draft only, for example My Post.md, still becomes a Draft, but its first publish creates a new file such as my-post.md beside the original, so your site would have both. Rename the file in your repository first if you want it linked. When two files in a folder would become the same slug, such as post.md and post.mdx, the file already named the way Acrosite writes it is offered and the other is skipped.
tags, author or layout, are not written back, and a draft marker such as draft: true is not kept. publishedAt becomes the time you publish from Acrosite, so a date already in the file is replaced. The scan lists all of these before you import.What is skipped
- Files Acrosite already manages, and files whose slug an item of that type already uses, including items in Trash.
- Files Acrosite manages for an item in another project that uses the same repository and branch, so one project never overwrites or removes another project's file.
- Symbolic links, submodules, Git LFS pointers, files larger than 256 KB and files that are not UTF-8 text.
- Names that start with
.or_. - TOML or JSON frontmatter, and YAML that uses anchors, tags or repeated keys.
- Titles longer than 180 characters and bodies longer than 200,000 characters.