logo
n min

✍️

MDX Sample.

Posted on

Updated on

Overview

This site provides sample MDX usage. More samples will be added sequentially.

Below, MDX syntax examples are presented.

Headings

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Heading 1 is not used.

For SEO and usability reasons, start with h2 for headings. Also, avoid using headings beyond h5 as much as possible.

Styling

Bold

Italic

Bold Italic

Strikethrough

inline code

Lists

Unordered List

  • item 1

    • item 1-1
    • item 1-2
  • item 2

    Text inside the item

A link card is a component that displays information about the linked destination. By simply writing the URL, a link card is automatically generated.

Images

Dev placeholder Image

Tables

Header 1Header 2Header 3
1-11-21-3
2-12-22-3

Code Blocks

Basic

You can write a code block by enclosing it with three backticks.

By specifying the language, syntax highlighting by Shiki will be applied.

If no language is specified, it will be displayed as plain text.

Title

sample.tsx

Line Numbers

Highlight Lines

Highlight Words

Diff

Multiple Attributes

Multiple attributes can be specified simultaneously.

hello.tsx

Math

Can be written mathematic formulas.

To be added.

Inline Math

Block Math

Blockquotes

Blockquote 1

Footnotes

Footnotes 11

Horizontal Line


Comment Out

About Front Matter

Front matter is YAML-formatted metadata written at the beginning of an MDX file.

Specify information such as the title of the article and the date and time of posting.

Example

Describe the content in the following format, similar to the example enclosed by --- at the beginning of the file.

Available Properties

The following properties are available on this site.

PropertyRequiredValueDescription
publishedtruetrue or falseSpecifies whether the article is published. If not, it's in draft mode
iconUnicode Emoji
Example: &#x1F389 -> 🎉
Specifies the article's icon.
titletruestringSpecifies the article title.
datetrueYYYY-MM-DDTHH:mm:ss+09:00Specifies the article's publication date.
lastupdatedYYYY-MM-DDTHH:mm:ss+09:00Specifies the article's last update date.
categoriestrueList of CategoriesSpecifies the article's categories.
Please check available categories.
tagstrueList of TagsSpecifies the article's tags.

Categories

The following categories are available.

  • news : News
  • events : Events
  • activities : Activities

Callouts

Callouts are styles used to highlight specific text.

To be added.

Embedding

Embedding is a feature that allows you to display external content within an article. By simply writing the URL of a site that supports oEmbed, the embedding is automatically generated.

Currently, except for YouTube embeds, the content is loaded only after the user interacts with it. This is to prevent delays in the initial page load caused by external resource loading.

YouTube

You can embed YouTube videos and playlists.

  • https://www.youtube.com/watch?v=**

  • https://www.youtube.com/playlist?list=**

Canva

You can embed Canva designs and slides.

  • https://www.canva.com/design/**

[include.R] ruBridge - 最終発表

https://www.canva.com

CodePen

You can embed CodePen pens.

  • https://codepen.io/pen/

A Simple CodePen Example (feat. HTML, CSS, & JavaScript)

https://codepen.io

Spotify

You can embed Spotify playlists.

  • https://open.spotify.com/playlist/

Top 50 - Japan

https://spotify.com

MDX / JSX

MDX is a format that allows embedding React Components and JSX inside Markdown.

This site provides the following custom components by default.

Tab Layout

A component that allows switching between multiple contents using tabs.

※ This may negatively impact UX.

Counter.tsx

Two-Column Layout

A component that provides a two-column layout.

Adding Custom Components

You can add your own custom components.

Currently, due to the pre-processing of articles into JSON dynamically, components cannot be imported within MDX files using import.

Implementation Steps

  1. Create a component file inside contents/components

  2. Add the component to contents/components/index.tsx

  3. The component will now be available across posts and pages.

Footnotes

  1. Footnotes text