- Clone the engineering blog repository to your machine:
$ git clone [email protected]:farskid/farzadyz.me.git - Navigate into the engineering blog folder:
$ cd farzadyz.me - Install yarn package manager globally if you don’t already have yarn installed on your machine:
$ npm install -g yarn - Install the dependencies for this project:
$ yarn - You’re ready to run the engineering blog
- Run the development server to spawn a local server on port 3000:
$ yarn dev - Visit http://localhost:3000/ to find your server running.
Deploy to a draft URL by running yarn deploy
Deploy to prod by running yarn deploy:prod
Make sure you export the project before deploying
Blog posts are stored inside content/posts.
- Create and checkout a new Git branch for your blog post:
$ git checkout -b my-blog-post-branch-name - Use
yarn post:createto create a blog post following the CLI (command-line interface) prompts:
$ yarn post:create - Find your new blog post inside content/posts and write your blog post content using markdown format.
- Save your file to live refresh the local server and preview your post at http://localhost:3000/. If your changes aren”t visible, you may need to stop and restart the local server to trigger a rebuild:
$ ^C
$ yarn dev - Commit and push your Git branch to the eng-blog repository:
$ git commit -am "Add new blog post"
$ git push origin my-blog-post-branch-name - Create a pull request on GitHub for your Git branch to the eng-blog repository to request that the post is published to the live site.
Use yarn post:edit to update an existing blog post’s updatedAt frontmatter field. Follow the CLI prompts to choose an existing blog post from the list.
| property | description |
|---|---|
| title | post title |
| description | post description that shows on blog list view |
| tags | tags relevant to the blog post |
| publishedAt | date the post was first published |
| updatedAt | date the post was last updated |
| originalURL | original post URL if post has been copied from another platform |
| draft | whether the post is published or draft |
- Run the development server to spawn a local server on port 3000:
$ yarn dev - In another terminal tab, run
yarn test:metato spawn an instance of localtunnel listening to the same port as the development server:
$ yarn test:meta - The localtunnel process will show a URL in the terminal for a temporary deployment of the development server:
your url is: https://exampleurl.com - Use this URL with the social media platforms (or any other platform using Open Graph) below to test how they’d preview the home page or any post page meta information:
- Twitter card validator
- LinkedIn post inspector
- Facebook Sharing Debugger (requires Facebook login)
There are a few shortcodes you can use to embed content in markdown.
Use the tweet id for the id attribute. For example, in https://twitter.com/farskid/status/1461727317429043201, 1461727317429043201 is the ID.
<Tweet id="1461727317429043201" />
Use the YouTube ID for the id attribute. For example in https://www.youtube.com/watch?v=y6aGu0N8z9Q, y6aGu0N8z9Q is the ID.
<Youtube id="y6aGu0N8z9Q" />