埼玉県質屋組合連合会(Saitama Pawnbrokers Association)
加盟店情報を配信する公式ホームページです。

test

test

So far elm-pages is working greatly including Netlify CMS integration. Great ! I have been using Go Hugo but I was always thinking if I could write their logics in Elm. Just Go is not my favoirte. Anyway I think this isssue is one of the main obstacle for moving from another blog systems. This just my naive idea but it is possible to implement I think.

How about representing record field name with encoded strings something like Base58 which only contains alpha numerics ? The following is an example, a prefix character 'b' is added to avoid errors in case of the encoded string with digit.

type pages =
    { b6M4uDp2 = (buildPage ["blog"])) -- Base58 encoded /blog
    , b3uzqYXfA4pnsTNPsY9GppLNZxJyZy = (buildPage ["blog", "test-2020-02-20"] -- Base58 encoded /blog/test-2020-02-20
    }

The reason

  1. I think it is almost impossible to represent all filenames as Elm record fields. Not only starting digit but spaces, special charactgers etc. will also cause error. And it is inpractical to force ordinary users to upload files with elm friendly filenames.
  2. Yes it is not possible to remmber the field name. However I often need to open Pages.elm and check the actual field name in the current implementation. I can remember the rules such as - is mapped to CamelCase but _ is not changed etc, but if you add more rules I am not sure if I could remembere everything !

Since this is a breaking chage, adding an command line option to choose which naming scheme is possible.

Thanks !