Skip to content

How to edit MDX files?

Yasin edited this page Nov 5, 2024 · 1 revision

Guide to Editing .mdx Files on GitHub

This guide will help you edit .mdx files directly on GitHub, which is useful for making small changes without needing to clone the repository locally.

1. Navigate to the Repository

  1. Log in to GitHub.
  2. Go to the repository where the .mdx file you want to edit is located.

All the content is located in: https://github.com/ELIXIR-NO/website/blob/main/src/content

2. Access the .mdx File

  1. Once inside the repository, navigate through the directory structure to locate the .mdx file.
  2. Click on the file name to open it.

3. Edit the .mdx File

  1. With the file open, look for a pencil icon (✏️) in the top-right corner, labeled Edit this file. Click it to open the file in edit mode. where is the edit button

  2. Make the necessary edits in the GitHub editor. GitHub supports Markdown and basic MDX syntax, so you can edit text, add links, and insert MDX components directly here.

    • Note: If your MDX file includes complex components or imports, you might not get a preview on GitHub, but basic Markdown elements will render.

4. Preview Changes (Optional)

GitHub doesn’t currently support MDX previews. If you need to see how your changes will render, you should locally run the source code before finalizing your edits.

5. Commit Your Changes

  1. Find the Commit changes button. image
  2. Add a brief commit message describing your edits. image
  3. Choose between:
    • Commit directly to the main branch to apply changes immediately (DO NOT Choose this option).
    • Create a new branch for this commit and start a pull request for review (Recommended option ) image
  4. Click Propose changes to save your edits. image
  5. Now GitHub will present you with the PR creation stage. image

6. Review and Merge (if Applicable)

If you created a pull request (PR):

  1. Go to the Pull Requests tab.
  2. Open your new PR to review changes.
  3. A maintainer should review and approve your change.
  4. Once, everything looks good, maintainers will deploy the changes.