2
0
Fork
You've already forked cms
0

page title is capitalized file name #17

Closed
opened 2024年06月17日 21:51:27 +02:00 by iacore · 5 comments
iacore commented 2024年06月17日 21:51:27 +02:00 (Migrated from github.com)
Copy link

for the record, that's neither the file name or the page title
is a bit confusing

image

image

for the record, that's neither the file name or the page title is a bit confusing ![image](https://github.com/lumeland/cms/assets/74560659/54b8ec95-35f7-462c-8506-2812832b47ef) ![image](https://github.com/lumeland/cms/assets/74560659/0dfab6e7-2859-4076-84a9-ec8fc5815bc1)

The list of elements is generated from the file name (removing the extension, replacing - and _ to spaces and converted to title case). This is the function.

The reason is because the real file name is not very friendly for some people. And showing the title (or any other value) requires to load and parse the file, which is slow for sites with many pages or if you're using a remote storage (like GitHub).

The list of elements is generated from the file name (removing the extension, replacing `-` and `_` to spaces and converted to title case). [This is the function](https://github.com/lumeland/cms/blob/main/core/utils/string.ts#L4-L21). The reason is because the real file name is not very friendly for some people. And showing the title (or any other value) requires to load and parse the file, which is slow for sites with many pages or if you're using a remote storage (like GitHub).
iacore commented 2024年06月18日 18:30:47 +02:00 (Migrated from github.com)
Copy link

I see. I don't have much motivation for a change since I only just started using Lume CMS.

If I have to use this CMS daily, I would much prefer showing the full filename (e.g. src/file.pug) since I can look at the block of text as-is without parsing what it means.

I see. I don't have much motivation for a change since I only just started using Lume CMS. If I have to use this CMS daily, I would much prefer showing the full filename (e.g. `src/file.pug`) since I can look at the block of text as-is without parsing what it means.

LumeCMS use the file paths omiting the collection root folder. For example, if you define a collection and the storage is src:articles/*.md, the articles/ folder is not included in entry name and this file would be displayed as First article.

But it can show subfolders. If the file is /articles/first-article/chapter-1.md it would take first-article/chapter-1.md to generate the name.

Example:
imaxe

LumeCMS use the file paths omiting the collection root folder. For example, if you define a collection and the storage is `src:articles/*.md`, the `articles/` folder is not included in entry name and this file would be displayed as `First article`. But it can show subfolders. If the file is `/articles/first-article/chapter-1.md` it would take `first-article/chapter-1.md` to generate the name. Example: <img width="437" alt="imaxe" src="https://github.com/lumeland/cms/assets/377873/71b11482-91db-4986-b979-86cf120a59ba">
iacore commented 2024年06月19日 00:22:57 +02:00 (Migrated from github.com)
Copy link

But it can show subfolders. If the file is /articles/first-article/chapter-1.md it would take first-article/chapter-1.md to generate the name.

Example: [image]

oh well

this is more confusing isn't it

the folder/file analogy is perfect, i think. there is no need to unsluggify the filenames.

using open/closed folder icon would also be better here

> But it can show subfolders. If the file is `/articles/first-article/chapter-1.md` it would take `first-article/chapter-1.md` to generate the name. > > Example: [image] oh well this is more confusing isn't it the folder/file analogy is perfect, i think. there is no need to unsluggify the filenames. using open/closed folder icon would also be better here

I've removed the autocapitalization and now it shows the real filename.

I've removed the autocapitalization and now it shows the real filename.
Sign in to join this conversation.
No Branch/Tag specified
main
lumecms/outra-versión
lumecms/proba-2
v0.15.7
v0.15.6
v0.15.5
v0.15.4
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.16
v0.14.15
v0.14.14
v0.14.13
v0.14.12
v0.14.11
v0.14.10
v0.14.9
v0.14.8
v0.14.7
v0.14.6
v0.14.5
v0.14.4
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.0
v0.13.0-beta.1
v0.13.0-beta.0
v0.12.5
v0.12.4
v0.12.3
v0.12.2
v0.12.1
v0.12.0
v0.11.5
v0.11.4
v0.11.3
v0.11.2
v0.11.1
v0.11.0
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.7
v0.7.6
v0.7.5
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.12
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.11
v0.2.10
v0.2.9
v0.2.8
v0.2.7
v0.2.6
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/cms#17
Reference in a new issue
lume/cms
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?