KEMBAR78
Porting Switch2OSM to MkDocs from Jekyll by Andygol · Pull Request #248 · switch2osm/switch2osm · GitHub
Skip to content

Conversation

@Andygol
Copy link
Contributor

@Andygol Andygol commented Nov 6, 2023

This PR closes #224.

If necessary, the translation of texts can be organized through the integration with Transifex (use transifex.yml)

Feel free to adjust this PR if needed.

PS This is a newly reproduced PR #244. See previous discussions there.

Firefishy and others added 30 commits April 12, 2023 17:26
…er-0.23.9

Bump commonmarker from 0.23.8 to 0.23.9
This reverts commit aa1f4d7.
I've also tidied the menu and the "serving tiles" index so that only
Debian 12, Ubuntu 22.04, Docker and Debian 11 remain on it.

I've changed the Debian 11 page to reflect that it has been
released for ome time now.

I've fixed some minor typos elsewhere, including in pages no longer
on the menu.

The changes for Debian 12 include:

* Changes for new versions of e.g. postgres.

* A workaround for the removal of a vanilla "etc/apache2/renderd.conf".
See openstreetmap/mod_tile#326

* Changes necessary to reflect other mod_tiles changes, including
debugging turned off by default.

* Changes necessary to reflect Debian changes, such as no
standard "/var/log/syslog".

Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Minor changes to initial "apt install" line, following soup to nuts testing.

Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Minor changes to updating pages.

Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Minor changes to updating pages.

Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.9 to 0.23.10.
- [Release notes](https://github.com/gjtorikian/commonmarker/releases)
- [Changelog](https://github.com/gjtorikian/commonmarker/blob/v0.23.10/CHANGELOG.md)
- [Commits](gjtorikian/commonmarker@v0.23.9...v0.23.10)

---
updated-dependencies:
- dependency-name: commonmarker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
Bumps [activesupport](https://github.com/rails/rails) from 7.0.4.3 to 7.0.7.2.
- [Release notes](https://github.com/rails/rails/releases)
- [Changelog](https://github.com/rails/rails/blob/v7.0.7.2/activesupport/CHANGELOG.md)
- [Commits](rails/rails@v7.0.4.3...v7.0.7.2)

---
updated-dependencies:
- dependency-name: activesupport
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ions/checkout-4

Bump actions/checkout from 3 to 4
…ort-7.0.7.2

Bump activesupport from 7.0.4.3 to 7.0.7.2
…er-0.23.10

Bump commonmarker from 0.23.9 to 0.23.10
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](docker/metadata-action@v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ker/metadata-action-5

Bump docker/metadata-action from 4 to 5
…ker/setup-qemu-action-3

Bump docker/setup-qemu-action from 2 to 3
…ker/login-action-3

Bump docker/login-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ker/build-push-action-5

Bump docker/build-push-action from 4 to 5
…ker/setup-buildx-action-3

Bump docker/setup-buildx-action from 2 to 3
See: https://packages.debian.org/bookworm/node-carto

This allows to download a lot less packages from apt as we can skip installing npm, which has a LOT of dependencies. It is also cleaner to install all of the needed tools from Debian, and allows to skip an install step.

I tested it on a fresh Debian 12 install.

    $ apt list node-carto
    Listing... Done
    node-carto/stable,now 1.2.0-4 all [installed]
    $ which carto
    /usr/bin/carto
    $ carto --version
    1.2.0

I compared with the one installed from npm and it emits the same amount of warning.
…#243)

Co-authored-by: Andy Townsend <ajtown@dell5000.atownsend.org.uk>
@Andygol
Copy link
Contributor Author

Andygol commented May 13, 2024

Hello everyone,

It appears that progress on the transition to a new platform is currently stalled. To facilitate progress, I propose the following course of action:

  • Rename the current repository to something like "switch2osm-jekyll-arch" and archive it for preservation as a historical artifact.
  • Create a new repository named "switch2osm" where the code from my existing repository (https://github.com/Andygol/switch2osm-mkdocs) will be transferred, either through forking or simple copying. Starting afresh on the mkdocs platform, we can then integrate it with Transifex to support translations and encourage broader community involvement.

If this plan seems viable, let's proceed with its implementation!

@SomeoneElseOSM
Copy link
Contributor

SomeoneElseOSM commented May 18, 2024

Firstly - thanks for all your hard work here!

If this plan seems viable, let's proceed with its implementation!

As @pnorman mentioned earlier, this PR tries to do about three different things at once:

  • move from jekyll to mkdocs
  • add support for translation
  • content changes, including adding some new "vector tile" pages

Taking these one at a time:

I've had a play around with the mkdocs versions of the pages and it seems to be easier to set up, easier to customise and more flexible with regard to formatting than jekyll - it's definitely worth moving to mkdocs for those reasons. When I tested it it was easy to deploy as a static site, so I'd imagine @Firefishy wouldn't have problems setting that up (availability of time notwithstanding).

It's not yet clear to me how the translation will work. Is the idea that initially the site is deployed statically without "live" translation (but with just a couple of pre-translated language versions) and later someone sets up translations via a service such as Transifex? That's how I read the initial comment "If necessary, the translation of texts can be organized through the integration with Transifex (use transifex.yml)". I'm not familiar with how that would work, and it'd probably be easier (as @pnorman suggested to try and do one thing at once) - move to mkdocs, and add translation later. To be clear - translation into whatever languages people are prepared to support is absolutely something that we should be doing, but we do need to understand how.

It's clear that this site is already well overdue for content changes that cover vector tile options. The priority eventually will be "whatever is available on openstreetmap.org", which I believe is going to be based on https://github.com/pnorman/tilekiln , see openstreetmap/operations#1073 and openstreetmap/operations#565 . However, there are a bunch of other vector tile approaches that people are using right now that ought to be covered too.

Eventually (and this really should be a separate PR after everything's comfortably in mkdocs and we've decided how and if to do translation) I think we'll want a top-level split on both the "using tiles" and "serving tiles" sides between "vector" and "raster" (and possibly other approaches - e.g. for Garmin). If osm.org starts serving vector tiles based on the shortbread schema then lots of people are going to want to try "using tiles" and need to understand what is in and what is not in that schema. We'll also want to cover the "serving tiles" and "using tiles" approaches used by some of the current higher profile projects such as OSM Americana.

One problem with the vector tile pages in this PR such as this is that there isn't really the level of detail that someone who is new to the process can follow. Compare "You can use tools like osm2pgsql or imposm to import OSM data into a database" on that page with the equivalent instructions on one of the raster map pages. I've tried in the past to find something that isn't dependent on a proprietary service, can be self-hosted and is well-documented, and the best I've found is the documentation around tilemaker. In contrast, with shortbread I fell at the first hurdle trying to set it up, although things may have improved** since I looked (e.g. via inclusion in osm2pgsql-themepark).

Some of the other content changes (e.g. the links in the mkdocs footer) could probably benefit from minor tweaks, but I'm sure that'll be easy to do in an mkdocs-only PR.

** edit: a quick check suggests they have.

@matkoniecz
Copy link

currently stalled

Note

the overall comments that prevent a more detailed review remain.

This has the same issue as the previous PR where it's mixing changing to MkDocs, adding translation support, adding specific language translations, content changes (e.g. new images), and contribution guideline changes.

In other words, it would be more actionable if single PR would not mix several big changes.

Would it be feasible to split it in parts?

@Andygol
Copy link
Contributor Author

Andygol commented Jun 1, 2024

One problem with the vector tile pages in this PR such as this is that there isn't really the level of detail that someone who is new to the process can follow.

** edit: a quick check suggests they have.

@SomeoneElseOSM feel free to contribute to https://github.com/Andygol/switch2osm-mkdocs

@Andygol
Copy link
Contributor Author

Andygol commented Jun 1, 2024

Mateusz and Paul, thanks for the advice on this PR. However, the problem is not in how it should be divided or organized, but in the global intention. For my part, I showed a working example (https://andygol.co.ua/switch2osm-mkdocs/) and concept (https://github.com/Andygol/switch2osm-mkdocs, https://app.transifex.com/osm-ua/swtch2osm/dashboard/#/). On the part of the maintainers, I expect certain steps towards its adaptation or a statement that this will not be done. In addition to this PR, I proposed an action plan (#248 (comment)) that only maintainers can perform.

  • Rename the current repository to something like "switch2osm-jekyll-arch" and archive it for preservation as a historical artifact.
  • Create a new repository named "switch2osm" where the code from my existing repository (https://github.com/Andygol/switch2osm-mkdocs) will be transferred, either through forking or simple copying. Starting afresh on the mkdocs platform, we can then integrate it with Transifex to support translations and encourage broader community involvement.

If this plan seems viable, let's proceed with its implementation!

PS
@grischard @Firefishy what do you think about starting a project at https://switch2.osm.org (go2.*, move2.*, run.* — anything you want)?

@SomeoneElseOSM
Copy link
Contributor

SomeoneElseOSM commented Jun 1, 2024

@SomeoneElseOSM feel free to contribute to https://github.com/Andygol/switch2osm-mkdocs

https://www.openstreetmap.org/user/SomeoneElse/diary/404191 is my first take on the level of detail required. Hopefully someone will be able to follow that rather than, say, "Make sure you have Node.js installed on your system".

That's far from the finished article though (and as mentioned above anything for the switch2osm site would be better with separate "creating vector tiles" and "showing the output for the user"). Just writing that identified a few rough edges in the existing documentation (see my recent PRs).

I'm not convinced that someone who "just wants to serve some vector tiles on their web site" would want to use a special web server just for that, whether that's VersaTiles' one or TileServer-GL (though of course there will be niches for both of those), so I went with Apache and "mod_mbtiles".

However, the problem is not in how it should be divided or organized, but in the global intention

"How to get from here to there" is key to the process. Something that looks nicer, might support translation in the future (but it isn't explained how, yet) and contains some new pages that definitely need further work is a really useful demonstrator, but isn't something that can be merged as a whole.

@pnorman pnorman self-requested a review June 3, 2024 09:16
Copy link
Contributor

@pnorman pnorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted by Andy

I've had a play around with the mkdocs versions of the pages and it seems to be easier to set up, easier to customise and more flexible with regard to formatting than jekyll - it's definitely worth moving to mkdocs for those reasons. When I tested it it was easy to deploy as a static site, so I'd imagine @Firefishy wouldn't have problems setting that up (availability of time notwithstanding).

Based on this I'm okay with moving to mkdocs. Can you prepare a PR that does that without unrelated changes?

@Andygol
Copy link
Contributor Author

Andygol commented May 14, 2025

FYI 🔊

Here are, for your attention, two GitHub Actions that I recently added to my project:

  1. .github/workflows/exctarct-en-lang.yml extracts the English locale from mkdocs.yml into docs/en/en.yml, which will then be uploaded by the Transifex bot (or any other bot) to the translation platform.
  2. .github/workflows/update-languages-in-mkdocs.yml merges languages files (docs/uk/uk.yml, docs/zh-TW/zh-TW.yml, … etc) into mkdocs.yml.

Now the workflow looks like this:

  • If there are any changes in the menu structure, the corresponding changes are made to the file mkdocs.yml.
  • Action extracts the English locale and saves it to docs/en/en.yml if changes have occurred
  • The bot of the translation platform (now Transifex) monitors changes in the repo and synchronises them with the platform
  • Users on the translation support platform are notified of new changes and perform the translation
  • As soon as certain conditions are met for a translation on the platform (completeness of the translation is at least a specified percentage, or certain material must be fully translated; reviewed; etc.), the bot creates a PR in the repo to merge with the current codebase.
  • The PR is accepted by the maintainers (or automatically, depending on the repo settings) and the translated material is added to the website.
  • To add a new language:
    • Users of the translation platform submit a request to create a new language section there;
    • The project administrator on the platform creates a new language section (or it is created automatically);
    • Users of the platform translate materials according to their priority;
    • The translated file with the localisation is extracted by the bot and through the PR or automatically added to the source repo;
    • The Action, when the locale file appears, automatically adds it to MkDocs.yml and the new language section shows up on the site
  • Users of the platform gradually continue translations and materials are transferred by the platform bot through PR or automatically to the repo source. Materials that have not yet been translated will automatically be displayed in the default language.

Ready to use code you may find here — https://github.com/Andygol/switch2osm-mkdocs/tree/main. Feel free to contact me for assistance with migration.

You can get hands-on and see what's what on a working example https://andygol.github.io/switch2osm-mkdocs/

@pnorman
Copy link
Contributor

pnorman commented May 29, 2025

Based on this I'm okay with moving to mkdocs. Can you prepare a PR that does that without unrelated changes?

Any progress on this?

@Firefishy
Copy link
Contributor

I recently updated https://welcome.openstreetmap.org/ to @Andygol new mkdocs version, it is a great improvement. I plan to change switch2osm to the mkdocs version soon if there is no push back.

It is likely that not all the mkdocs pages will have all the latest revisions from the jekyll site, I would appreciate some help syncing them up.

CC: @SomeoneElseOSM

@SomeoneElseOSM
Copy link
Contributor

@Firefishy Obviously this PR can't be merged as is (see #248 (comment) above), but if the problem content can be removed (and the translation questions answered, which can be done later once the process has been established for "Welcome Mat") I don't have a problem moving the current switch2osm content as is to mkdocs. I do have a work-in progress at https://github.com/SomeoneElseOSM/switch2osm.github.io/tree/vector_intro_01 but I can point the new content there at the new site.

@Andygol
Copy link
Contributor Author

Andygol commented Aug 8, 2025

@Firefishy @SomeoneElseOSM Latest synced with this repo content you may find here https://github.com/Andygol/switch2osm-mkdocs/tree/main

@SomeoneElseOSM
Copy link
Contributor

Latest synced with this repo content you may find here https://github.com/Andygol/switch2osm-mkdocs/tree/main

Thanks for merging those! It's missing the last couple of minor changes, but that's easily sorted.

More of a problem is that https://github.com/Andygol/switch2osm-mkdocs/blob/main/docs/en/serving-tiles/serving-vector-tiles.md still seems to be there. It's absolutely true that we need something about vector tiles but I think that that is actually a step backward rather than forward - it's simply not a set of instructions that you can follow.

If you have a look at https://community.openstreetmap.org/t/vector-tiles-are-deployed-on-openstreetmap-org/133008 and similar community threads you'll see that there's a fair bit of confusion on "how to get to vector tiles appearing in my web browser" - people aren't grasping the difference between schema and style.

A couple of "obvious starter" vector tile topics might be:

  1. how to make a change to an existing style (perhaps one for Shortbread, since OSMF's demo vector tiles are in that schema).

  2. how to generate your own vector tiles in a schema (likely derived from an existing one), and then show those changes in a (modified) style.

These need to be in the "switch2osm style" - i.e. a set of instructions that you can "just follow" without doing extra web searching. However those are things to do independently of Jekyll/MkDocs (hence my comment above)

@Firefishy
Copy link
Contributor

This has now been manually merged and the new site is live https://switch2osm.org/

@Andygol if possible please could you update the site per @SomeoneElseOSM comment here? #248 (comment)

@Firefishy
Copy link
Contributor

@SomeoneElseOSM @pnorman Apologies for my bull in a china shop style of moving the switch to mkdocs forward. The switch is worthwhile in my view. If there are any outstanding issue or you guys would like with assistance with migrating any draft content across to the new setup please do let me know.

@Andygol We need to work out a clean process for translations. For now I'd be happy for translation contributions to be primarily via outside contributor Pull Requests. Simple and not over engineered is ideal.

@Andygol
Copy link
Contributor Author

Andygol commented Aug 12, 2025

I'd be happy for translation contributions to be primarily via outside contributor Pull Requests.

🐞 👇

switch2osm/mkdocs.yml

Lines 240 to 242 in b437395

- locale: "null"
fixed_link: https://github.com/osmfoundation/welcome-mat/#translation
name: Help to translate

Until the CWG and OWG agree on which platform to use for translation work, translators can create PRs themselves. To do this, simply direct those wishing to make translations to the instructions in this repo https://github.com/switch2osm/switch2osm/tree/main?tab=readme-ov-file#translation (see misprint above).

However, this requires some GitHub skills and knowledge of Git principles. Translation platforms take much of the ‘magic’ out of working with Git. They track changes in the source, notify translators of them, and, once the translation is complete, generate a PR to add the translation to the main repo. This significantly lowers the entry threshold for the general public to join in.

In my repo, I tested this possibility of working with Transifex and it looks great. I sincerely hope that the working groups will select and set up a project for this as soon as possible on the platform that will support the work on the translation of Switch2OSM content.

UPD. As long as the translation is planned to be done by creating the PR manually, the Actions that handle changes in mkdocs.yml can be deactivated.

@pnorman
Copy link
Contributor

pnorman commented Aug 13, 2025

@SomeoneElseOSM @pnorman Apologies for my bull in a china shop style of moving the switch to mkdocs forward. The switch is worthwhile in my view. If there are any outstanding issue or you guys would like with assistance with migrating any draft content across to the new setup please do let me know.

I spent a few hours and I think I've got all the content fixed so it's like it was before.

Until the CWG and OWG agree on which platform to use for translation work

I don't see any need for any OSMF WGs. Certainly not the OWG as there are no policy, budgeting or hardware planning issues. It's a question for the s2o maintainers.

@Andygol
Copy link
Contributor Author

Andygol commented Aug 13, 2025

I don't see any need for any OSMF WGs. Certainly not the OWG as there are no policy, budgeting or hardware planning issues. It's a question for the s2o maintainers.

I really hope this will be a solution that will work well for people who want to help out with translating the site's materials and keep everything up to date. 🤗

@Andygol
Copy link
Contributor Author

Andygol commented Aug 13, 2025

@pnorman
Copy link
Contributor

pnorman commented Aug 15, 2025

ICYMI switch2osm.org is served by OSMF

Yes - but ops would only be involved if updating translations was something that happened on the OSMF servers, rather than something in this repo. The deploy process is to run the container "ghcr.io/switch2osm/switch2osm:latest", and translation processes I've seen wouldn't change that. I can't see any situation where the OWG would be involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation of the multilanguage support for Switch2OSM.