|
| 1 | +--- |
| 2 | +title: New Home for the LoopBack Blog |
| 3 | +date: 2022-04-13 |
| 4 | +slug: new-home-for-the-loopback-blog |
| 5 | +authors: achrinza |
| 6 | +tags: [Meta] |
| 7 | +--- |
| 8 | + |
| 9 | +After a long hiatus, the LoopBack Blog has gotten a new home! Learn how it came |
| 10 | +to be and how we managed to modernise blogging stack along the way. |
| 11 | + |
| 12 | +<!--truncate--> |
| 13 | + |
| 14 | +As part of the planning for LoopBack moving to OpenJS Foundation, there have |
| 15 | +been discussions around finding a new home for the blog, parting from the |
| 16 | +strongloop.com web site. A few alternatives had brought up, such as having the |
| 17 | +blog posts as part of the loopback.io repo, using a third party blog site and |
| 18 | +creating a blog site in a separate repo. |
| 19 | + |
| 20 | +## Coming Up With a Plan |
| 21 | + |
| 22 | +Putting the blog posts in the loopback.io repo is a natural progression, since |
| 23 | +all the documentation and text-based content will be in the same repo. The |
| 24 | +concern is that is Jekyll-based. Although it worked fine and integrated well |
| 25 | +with GitHub Pages, many of the maintainers were not well-versed in the world of |
| 26 | +Ruby. This was compounded by shell scripts that pulled data from other Git |
| 27 | +Repositories and modified the site as part of the build process. Hence, a lot of |
| 28 | +time was spent trying to understand how the website was put together and |
| 29 | +figuring out the best way to tweak it to integrate the new blog. |
| 30 | + |
| 31 | +The "Strong Blog" was also written with Jekyll and hosted on GitHub Pages. Hence |
| 32 | +lifting and shifting was a real possibility that we contemplated. However, |
| 33 | +the slow build times and the maintainers' unfamiliarity with Ruby and Jekyll |
| 34 | +meant that we realised that the website's current stack wasn't worth keeping |
| 35 | +around in the long run. At the same time, performing a full migration of the |
| 36 | +website, documentation, and blog in one go was too daunting of a task for the |
| 37 | +maintainers who were already working on the project on their own time. |
| 38 | + |
| 39 | +The idea of using a third-party service such as [Medium](https://www.medium.com) |
| 40 | +was also considered. However utlimately, the lack of control over the interface, |
| 41 | +the inability to place it in the same domain name as the main website and |
| 42 | +documentation, and the frustration that stem from a reader being forced to use |
| 43 | +a third-party service meant that it was quickly off the table. |
| 44 | + |
| 45 | +As a result, we decided to come to a compromise. |
| 46 | + |
| 47 | +## Picking A Blogging Stack |
| 48 | + |
| 49 | +After some deliberation we decided to create a hybrid stack which left the |
| 50 | +website and documentation with Jekyll, and use |
| 51 | +[Docosaurus 2](https://docusaurus.io) as the new blogging platform. We found |
| 52 | +Docusaurus to be a good fit as it is a Facebook-maintained open source project |
| 53 | +which was written on top of React. Besides its benefit of speedy build times, |
| 54 | +this JavaScript-based stack provides more opportunities for extensibility and a |
| 55 | +reduced barrier for contributing and tweaking. The first-class support for MDX |
| 56 | +was also a plus as it meant we were able to copy over most of our posts with |
| 57 | +only a few tweaks, and the ability to generate the blog as build artifacts made |
| 58 | +it compatible with the Jamstack-eque system of GitHub Pages. |
| 59 | + |
| 60 | +Thanks to the amazing work done by [Diana](https://github.com/dhmlau), all of |
| 61 | +the LoopBack 4 blog posts from 2019 and 2020 were migrated to Docusaurus. With |
| 62 | +her work, we were able to quickly build and see the new blog coming together |
| 63 | +with all of the past blog posts populating the blog. |
| 64 | + |
| 65 | +## Merging Jekyll and Docusaurus |
| 66 | + |
| 67 | +When we started building the blog, we hosted it on GitHub Pages in its own Git |
| 68 | +Repository and served it in its own sub-domain. This allowed us to quickly build |
| 69 | +and patch any bugs that may have cropped up. However the end-goal was to host it |
| 70 | +under the same domain as the main website and documentation: |
| 71 | +https://loopback.io/blog. Hence, we had to create a solution which merged the |
| 72 | +new blog with the exsitng website codebase. |
| 73 | + |
| 74 | +This solution? A shell script! |
| 75 | + |
| 76 | +Since we already had a precedence for using shell scripts to pull in data from |
| 77 | +other Git Repositories, I've decided to write one to do the same thing, but this |
| 78 | +time, specifically for the blog. This script clones the |
| 79 | +[`loopbackio/loopback-blog` Git Repository](https://github.com/loopbackio/loopback-blog), |
| 80 | +generates the blog's build artifacts, and copies it over to the `blog` directory |
| 81 | +of the Jekyll website. There's additional logic in there to make it more |
| 82 | +fool-proof and less verbose but in essence, that was what it did - Clone, build, |
| 83 | +and copy. You can also view the |
| 84 | +[source code](https://github.com/loopbackio/loopback.io/blob/8968cd6860c09a852ee4fd9ce07c7a1db3ce7771/update-blog.sh) |
| 85 | +yourself if you'd like to see how it was done. Over time, we hope to refine this |
| 86 | +further and make it more reliable, such as using Git Submodules instead of a |
| 87 | +clean clone on every build. |
| 88 | + |
| 89 | +## Future Work |
| 90 | + |
| 91 | +As it stands, we now have a blog that all of the maintainers can now contribute |
| 92 | +to. With this change, we now have revived a new way for us, the maintianers, to |
| 93 | +engage with our community and we hope that the blog posts can complement the |
| 94 | +existing documentation and community channels such as Slack, GitHub |
| 95 | +Discussions, and the mailing list. |
| 96 | + |
| 97 | +This is just the first step in modernising our website stack. There's still |
| 98 | +plenty of work to do, and it's our vision to fully migrate our stack to one |
| 99 | +powered by the JavaScript ecosystem. |
| 100 | + |
| 101 | +## Upcoming Blog Series: Maintainers' Testimonial |
| 102 | + |
| 103 | +With the launch of our new blog, we're excited to announce an upcoming blog |
| 104 | +series where the maintainers can share their expriences and journey in adopting |
| 105 | +LoopBack 4. Through this series, we hope to share with the community the unique |
| 106 | +perspectives of those who work closely on LoopBack 4, not only as users but as |
| 107 | +maintainers as well. |
| 108 | + |
| 109 | +Don't miss out on future blog posts by subscribing to our |
| 110 | +[RSS](https://loopback.io/blog/rss.xml) or |
| 111 | +[Atom](https://loopback.io/blog/atom.xml) feeds which contain the full articles. |
0 commit comments