|
1 | | -# test conversion of the obf website |
| 1 | +# conversion of the obf website to GitHub pages |
2 | 2 |
|
3 | | -Exploring the migration of the OBF WP site to a static site generator |
| 3 | +Migration of the OBF WP site to a static site generator (Hugo) |
4 | 4 |
|
5 | | - |
6 | | -## Running locally |
| 5 | +## Running hugo server locally |
7 | 6 |
|
8 | 7 | 1. [Install hugo](https://gohugo.io/installation/) |
9 | | -2. Run `hugo server` from the root folder of the project to get a local server that automatically rebuilds |
| 8 | +2. Clone the GH repo: |
| 9 | +``` |
| 10 | +git clone https://github.com/OBF/OBF.github.io |
| 11 | +``` |
| 12 | +3. Initialize hugo |
| 13 | +``` |
| 14 | +cd OBF.github.io |
| 15 | +git submodule init |
| 16 | +git submodule update |
| 17 | +``` |
| 18 | +4. Run `hugo server` from the root folder of the project to get a |
| 19 | +local server that automatically rebuilds: |
| 20 | +``` |
| 21 | +hugo server & |
| 22 | +``` |
| 23 | +5. View the site in your web browser by going to [http://localhost:1313/](http://localhost:1313/) |
| 24 | +6. When you make changes, you should be able to reload http://localhost:1313/ to instantly see the changes! |
| 25 | +7. To push your changes back to the live site, remember to commit |
| 26 | +them. First you will need a |
| 27 | +[GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). Then do: |
| 28 | +``` |
| 29 | +git checkout -b BRANCH_NAME |
| 30 | +git add FILES |
| 31 | +git commit -m "my changes" |
| 32 | +git push (or you might need to do git push --set-upstream origin BRANCH_NAME) |
| 33 | +``` |
| 34 | +(Then go to https://github.com/OBF/OBF.github.io to make a PR) |
| 35 | +8. Once the PR is merged, your changes should be visible on [https://obf.github.io/](https://obf.github.io/) |
| 36 | + |
10 | 37 |
|
11 | | -## Steps taken |
| 38 | +## Steps taken to port content from old WP site |
12 | 39 |
|
13 | 40 | 1. Create XML export of existing WP site with all pages & posts |
14 | 41 | 2. Run the conversion script [wp2hugo](https://github.com/ashishb/wp2hugo) in the following way `/wp2hugo -source obf.WordPress.2025-01-30.xml -output obf-test-hugo -download-media -continue-on-media-download-error` |
|
0 commit comments