Feat/rehype-citation (#270)

* feat: add rehype-citation and upgrade to next 12.0.3

* docs: update docs
This commit is contained in:
Timothy
2021-11-14 19:32:06 +08:00
committed by GitHub
parent 2239743376
commit d384d1a309
8 changed files with 426 additions and 167 deletions

View File

@@ -1,11 +1,12 @@
---
title: 'New features in v1'
date: 2021-08-07T15:32:14Z
lastmod: '2021-10-27'
lastmod: '2021-11-14'
tags: ['next-js', 'tailwind', 'guide']
draft: false
summary: 'An overview of the new features released in v1 - code block copy, multiple authors, frontmatter layout and more'
layout: PostSimple
bibliography: references-data.bib
---
## Overview
@@ -329,7 +330,7 @@ To modify the styles, change the following class selectors in the `tailwind.css`
}
```
## Newletter component
## Newletter component (v1.1.3)
Introduced in v1.1.3, the newsletter component gives you a easy way to build an audience. It integrates with the following providers:
@@ -354,6 +355,37 @@ and is not compatible with a 100% static site export. Users should either self-h
A static site compatible alternative is to substitute the route in the newsletter component with a form API endpoint provider.
## Bibliography and Citations (v1.2.1)
`rehype-citation` plugin is added to the xdm processing pipeline in v1.2.1. This allows you to easily format citations and insert bibliography from an existing bibtex or CSL-json file.
For example, the following markdown code sample:
```md
Standard citation [@Nash1950]
In-text citations e.g. @Nash1951
Multiple citations [see @Nash1950; @Nash1951, page 50]
**References:**
[^ref]
```
is rendered to the following:
Standard citation [@Nash1950]
In-text citations e.g. @Nash1951
Multiple citations [see @Nash1950; @Nash1951, page 50]
**References:**
[^ref]
A bibliography will be inserted at the end of the document, but this can be overwritten by specifying a `[^Ref]` tag at the intended location.
The plugin uses APA citation formation, but also supports the following CSLs, 'apa', 'vancouver', 'harvard1', 'chicago', 'mla', or a path to a user-specified CSL file.
See [rehype-citation readme](https://github.com/timlrx/rehype-citation) for more information on the configuration options.
## Upgrade guide
There are significant portions of the code that has been changed from v0 to v1 including support for layouts and a new mdx engine.