This is the website of Mieux Voter (aka Better Vote). It is available online at mieuxvoter.fr.
First, install the dependencies:
npm install
# or
yarn install
Second, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
-
Add a file on
content/blog/[slug].mdx
to write an article athttps://mieuxvoter.fr/blog/slug
. -
Add meta contents as a YAML table as the beginning of your article, such as:
---
title: 'Premier article'
author: 'Pierre-Louis Guhur'
assets:
graph:
type: json
path: 'example-plotly.json'
---
- As seen above, you can add assets (stored in
content/assets
) as dictionary of file. In this case, you will be able to access those assets in your article, such as:
<Plot {...graph} />
- Yes, you can add JSX components, but that's not completely magical. Basic coponents (such as headers and paragraphs) are imported by the MDX plugin. Other (such as Plot) are directly imported in
pages/blog/[slug].js
.
You can also a Wordpress CMS by modifying .env
.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!