Contribute

Do you have an idea for a post and want to contribute as a guest writer? That's awesome! Thanks for your contribution. The process for contributing is still being worked out. In the future, I hope to smooth out the contribution process and make it more straightforward. So, thank you for bearing with me at the moment.

For now, here is some helpful information on how you can begin contributing. If you have any questions or are having trouble with getting started, don't hesistate to reach out. Thanks again!

  1. Download the source code for this website
  2. Create a post
  3. Preview a post
  4. Submit for review

1. Download the source code for this website.

To be able to contribute as a writer or developer of this site, you will need to download the source code for the site to a local directory on your computer. The source code and posts for this website are open source. You can find the repository on GitHub.

To download the code to a local directory on your computer, perform the following steps:

  1. If you do not already have GIT installed on your computer, download and install GIT from here.
  2. Clone the source code for this website to a local directory on your computer by running the following command in a terminal on your computer.
    git clone https://github.com/philipstubbs13/next-netlify-blog.git
    Running this will create a directory called next-netlify-blog within the directory in which you ran this command.

2. Create a post

Perform the following steps to create a post.

  1. Navigate to the next-netlify-blog/posts directory of this project and create a .md file within the posts directory.

    The name of the file should be similar to the title of your blog post where each word is hyphenated (also known as snake case).

    There should be no spaces in the filename and should be all lowercase. For example, if the title of your blog post is My Awesome Post, then a good filename for the post would be my-awesome-blog-post.md.

    The naming of the file is important because the name of the file will be used to construct the url to the post content on the site. For example, a file name of my-awesome-blog-post.md will have a url of /post/my-awesome-blog-post when the post is live on the site.

  2. Inside the .md fil you just created, copy and paste the starter code from next-netlify-blog/example-post/example-post.md into your new file.

    This is the template for writing a blog post for this site. If you follow this template, you should have no problem contributing and getting a post added.

    Note that posts for this site are written in Markdown syntax. If you are unfamiliar with Markdown, refer to this guide for more information: Markdown guide.

3. Preview a post

After you have created a post, it is a good idea and highly recommended to preview your post to make sure everything looks good before it goes live on the site.

To preview your post and see what it would look like before it goes live, perform the following steps:

  1. If not already installed, install node.js on your computer from here.
  2. In a terminal on your computer, change directory to the next-netlify-blog directory of the project.
    cd next-netlify-blog
  3. Run the following command to install the project dependencies (which are listed in the package.json file if you are curious):
    npm install
  4. To start the website locally on your computer, run the following command:
    npm run dev

    If the website started correctly with no errors, you should be able to preview your post by opening up a browser and going to the following url:

    http://localhost:3000/post/example-post

    Where example-post is the name of the .md file you created.

4. Submit for review

After you have created a post, previewed it, and you are satisfied with it, follow these steps to get your changes published:

  1. Submit a pull request for your changes targeting the master branch to this repository on GitHub.
  2. Someone on the team will review it and might provide some feedback for you to address before your changes can be merged into themaster branch.
  3. After your pull request is approved and merged, an automatic deploy will be kicked off to deploy your changes to the live site, which is hosted on netlify.
  4. After the deploy finishes, it is recommended that you do a final QA check to make sure your changes are showing up correctly on the site and that there are no bugs.