-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Problem
When uploading guides using rdme docs upload path/to/guides, the position parameter from the Markdown frontmatter is not correctly being passed to the create/update guide endpoints1
This results in the guide pages being ordered alphabetically rather than the specified order when attempting to sync docs via the rdme CLI through the Github Action.2
I'm using the Github Action at this Git revision:
readmeio/rdme@5d702394cb1fd1dc3fab6e0769b44b56c9d425d1 # v10.6.0
Example
Let's say we have two markdown files:
---
title: A Page
slug: a-page
content:
excerpt: This is a page.
category:
uri: Get Started
position: 2 # <-- Not being passed correctly to the PATCH guide endpoint
---
## Overview
Foo A---
title: B Page
slug: b-page
content:
excerpt: This is another page.
category:
uri: Get Started
position: 1 # <-- Not being passed correctly to the PATCH guide endpoint
---
## Overview
Foo BExpected Result
We should see the pages being ordered like this:
- Get Started
- B Page
- A Page
Actual Result
We actually see the pages being ordered like this:
- Get Started
- A Page
- B Page
Debugging
As a debugging step, I had attempted to manually patch the page's "position", which worked, so there isn't anything wrong with the Patch API, but it looks like the rdme docs upload isn't correctly handling this situation.
Footnotes
-
https://docs.readme.com/main/reference/updateguide for
PATCH https://api.readme.com/v2/branches/{branch}/guides/{slug}↩