Blogpost Guide
Here you can find all the information needed to write and publish a new blog post on rescript-lang.org.
Requirements
Clone the rescript-lang.org repo and follow the README instructions to run the local development server.
Open the localhost:3000/blog page to see the blog page.
Create a new file
Blogposts are located in the ./_blogposts directory. File name starts with the date to maintain a natural sort order:
_blogposts/YYYY-MM-DD-[title].mdx
For example, let's create a new file:
SHtouch _blogposts/2020-01-30-my-new-blog-post.mdx
Refresh your browser within /blog. You should now see a warning for some malformed frontmatter data. Let's fix this!
Add Frontmatter Data
Each blogpost requires a certain set of meta information (so called "frontmatter"), otherwise it can't be displayed in the blog.
Frontmatter is put on the top of your file. Here is a fully working example of all available attributes:
--- author: hongbo co-authors: - chenglou - ryyppy date: "2017-10-01" previewImg: badge: release title: Bloomberg announces BuckleScript 1.0 description: | some multiline description ---
author: An author alias as defined in./data/blog_authors.jsonco-authors: A list of co-author aliases (same aliases allowed as in theauthorfield)date: A string date (always make sure to use the", otherwise yaml will parse it as adate). The date format is"YYYY-MM-DD hh:mm". All blog posts are ordered ascending by date.previewImg: The image shown in the blog overview, which will also be used as a link preview imagebadge: An additional badge on the blog, on top of the preview image. Available values arerelease,testing,preview,roadmaptitle: The title of the article (h1 headline)description: A description, which will be shown in the Featured blog post in the blog overview, and also as an introductory text in the blog article
For Maintainers: The implementation for the frontmatter logic can be found in the
common/BlogFrontmatter.resmodule.
Writing Markdown Content
You can use all the markdown features available to this documentation platform.
Check out our markdown guide to get an overview
over all available UI components.
Special _blogposts/archive directory
All blog posts that are put into the _blogposts/archive directory will be flagged as archived and not show up on the blog overview page.
We keep this directory around to hide old blog posts.