FsBlog icon indicating copy to clipboard operation
FsBlog copied to clipboard

Support globalization of pages/posts

Open devcrafting opened this issue 9 years ago • 3 comments

Description & expected behavior

Be able to do the same as https://www.sylvaindurand.org/making-jekyll-multilingual/ with Jekyll. It would allow to write some pages/posts in one language or multiple languages (depending on context). When there are some others languages, they can be displayed in header for example. Tags and archives pages should also depend on selected language.

Actual behavior

Multiple languages are not supported for now, or more exactly are not taken in account (you can write in any language).

Possible solutions

I would like to give a try to this feature if you are interested in (through a PR). I would like to check with some of you how you would implement it. I thought to:

  • rely on Header metadata OR folder structure: for ex, sources/en, sources/fr, sources/blog/en, sources/blog/fr...to find Language (or Culture ?)
  • add an optional Key property to BlogPost type, then take it in account for Blog listing
  • other design desicions I will discover/you already see...

What do you think ?

Thanks Clément

devcrafting avatar May 09 '16 08:05 devcrafting

This would be a great improvement!

I think this would be easier to implement if I port more of my changes I made for my own blog back into mainline/master. One of these missing pieces in master is the lack of representing the "current" blog post as part of the model, which you'd likely need in order to render the appropriate language selectors.

cdrnet avatar May 09 '16 19:05 cdrnet

I had a look at your fork. I haven't seen anything about current blog post in the model. Is it on https://github.com/cdrnet/FsBlog (master) ? BTW, we could do it as it is done in the Jekyll link I provided: in Razor view, use Model.Posts |> Seq.filter (fun p -> p.UniqueID = UniqueID) ?

devcrafting avatar May 10 '16 21:05 devcrafting

No, it is currently in a private repository only.

cdrnet avatar May 10 '16 21:05 cdrnet