cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.1k stars 291 forks source link

cuelang.org: page weights should be part of filenames not front matter #2889

Open myitcv opened 7 months ago

myitcv commented 7 months ago

What version of the site were you looking at?

https://github.com/cue-lang/cuelang.org/commit/7893073c3985b59570266efc73af204274fee58d

What did you do?

@jpluscplusm created https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1177594 to adjust the weights of pages in the tour. This required editing content within markdown files for the English translation.

The weight is currently set in the front matter of a page, which is by definition for a specific translation (e.g. in the front matter of en.md).

This is less than desirable for a number of reasons:

Likely more points to fill out here.

jpluscplusm commented 7 months ago

Some nice-to-haves: it would be nice if any change that came from this issue ...

myitcv commented 7 months ago
  • permitted re-ordering by only renaming a single file or directory, without requiring page config in .cue files to be updated

That's the basic premise of this change, so yes.

  • allowed for hierarchies in which we don't care about the order of the majority of their content (e.g. content/howto/) to exist without an artificial order element being injected into their filesystem entries

Nice observation. The weight in the directory name could be optional. I think Hugo is happy without a weight, but if it wasn't we could (at least in the case you describe) derive a simple weight based on the lexical ordering of the directories.

  • came with tooling that enabled "place [this] piece of content before/after [that] piece, and fix up all the other entities to accommodate that change"

That to my mind is a later feature.