retypeapp / retype

Retype is an ✨ ultra-high-performance✨ static site generator that builds a website based on simple text files.
https://retype.com
Other
1.01k stars 201 forks source link

Folder Names With Numbers Result In Incorrectly Displayed name #650

Closed mmalcolmprismcontrols closed 7 months ago

mmalcolmprismcontrols commented 8 months ago

Retype version 3.5.0, installed with dotnet.

retype.yml file:

input: .
output: .retype
branding:
  title: CLI
  label: Docs
links:
- text: Getting Started
  link: https://retype.com/guides/getting-started/
footer:
  copyright: "© Copyright {{ year }}. All rights reserved."

My directory tree:

└── /repo_root/
    └── docs/
        └── Usage/

When I rename the Usage folder to anything starting with a number followed by a dot (e.g: 1. Usage OR 2. Usage or 3. Usage, I see the HTML elements instead of the actual folder name:

image

geoffreymcgill commented 8 months ago

Thanks for the report. I will test and try to reproduce the issue.

mmalcolmprismcontrols commented 8 months ago

Thanks for the report. I will test and try to reproduce the issue.

I also just noticed that numbers don't appear at all even when the filenames are named such:

Here are the filenames:

└── /repo_root/
    └── docs/
        └── Usage/
        └── 1. Getting Started.md 
        └── 2. Deployment.md 

Here is what it displays as in the browser: image

This is rectified by changing the first title of the md file to the name I want:

  1. Deployment.md
    # 2. Deployment

I think this is expected behavior based on the documentation, however :).

geoffreymcgill commented 8 months ago

Interesting. I was able to reproduce the defect. We will investigate and try to include a fix in the upcoming Retype v3.6.0 release.

As a temp work-around, you can try either of the following techniques:

Use 1. Usage as the folder name

Screen Shot 2023-10-25 at 11 35 15 AM

Set label on index.yml

Screen Shot 2023-10-25 at 11 23 11 AM
label: 1. Usage

Either option above will output a better node label in the navigation tree:

Screen Shot 2023-10-25 at 11 23 39 AM

Here is a usage-test.zip sample demonstrating the failing scenario and options to work-around.

geoffreymcgill commented 8 months ago

I think this is expected behavior based on the documentation, however :).

Maybe, but it's still not working exactly as I thought it would. Where did you read this?

mmalcolmprismcontrols commented 8 months ago

I think this is expected behavior based on the documentation, however :).

Maybe, but it's still not working exactly as I thought it would. Where did you read this?

The implication, from my point of view, was in the first section of Page Configuration https://retype.com/configuration/page/#page-configuration

This could have easily just been a misunderstanding on my part.

geoffreymcgill commented 7 months ago

This defect has been fixed and will be included in the next release of Retype.

Screenshot 2023-11-18 at 11 40 00 AM Screenshot 2023-11-18 at 11 31 18 AM