Page MenuHomePhabricator

Create sub-directory URL for Design blog (https://design.wikimedia.org/blog)
Closed, ResolvedPublic

Description

We need a sub-directory on design.wikimedia.org that runs our blog — static files generated by Jekyll. (ref T185282)

URL: https://design.wikimedia.org/blog
Gerrit Repo: https://gerrit.wikimedia.org/r/#/admin/projects/design/blog
Directory: _site (this is where Jekyll keeps the generated files

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Prtksxna renamed this task from Create URL for Design blog to Create sub-directory URL for Design blog (https://design.wikimedia.org/blog).Jun 1 2020, 3:20 AM

Hi @Prtksxna I just cloned https://gerrit.wikimedia.org/r/design/blog to my laptop. Is that the actual content repo that should be copied to ./blog/ ? Or should i expect a directory _site inside it? I don't see one called _site yet but f.e. there is an admin directory instead which does not seem like a static site.

Change 601344 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] microsites::design: add blog subdirectory

https://gerrit.wikimedia.org/r/601344

I think you also need to add a link to the main page :)

No matter, I missed. Sorry :)

Thank you for taking this up @Dzahn 🙏🏽

Hi @Prtksxna I just cloned https://gerrit.wikimedia.org/r/design/blog to my laptop. Is that the actual content repo that should be copied to ./blog/ ? Or should i expect a directory _site inside it? I don't see one called _site yet but f.e. there is an admin directory instead which does not seem like a static site.

There should've been a directory called _site inside it, but there wasn't because I had it in .gitignore. Sorry about the oversight!

I am adding it here - https://gerrit.wikimedia.org/r/#/c/design/blog/+/601541/

Hi @Prtksxna ah, that explains it. Thanks. Could we have _only_ the contents of _site in the repo to make it a "deploy repo" so we can simply map that directly to the document root?

@Dzahn, I can see how it would make things easier, but I am not sure it would be maintainable to have the source and the built site at separate places 😞

If it helps, this directory can be removed altogether, and you could run bundle exec jekyll build to create it. But I guess that would include the added work of installing the right Ruby and Gems.

@Dzahn, I can see how it would make things easier, but I am not sure it would be maintainable to have the source and the built site at separate places 😞

This is the standard though. We usually have a deploy repo that only contains the files that need to be deployed for other sites like this.

If it helps, this directory can be removed altogether, and you could run bundle exec jekyll build to create it. But I guess that would include the added work of installing the right Ruby and Gems.

Sorry, this is not going to work. This would turn the entire process into manual deployment and having to install software and write the puppet code to execute that. Running manual commands isn't something we normally do.

I am not sure it would be maintainable to have the source and the built site at separate places 😞

By running the "bundle exec jekyll build" command locally and then uploading the resulting files?

Per our chat on IRC just now. It's not a problem. We can do it like we did for the TransparencyReport. I see there is already some code where the clone-dir is not the same as the deploy-dir. I'll handle it. Nothing to worry here.

Just one unrelated thing needs to be checked.. Gerrit permissions to make sure design team can merge things in the repo but not everybody else.

Just one unrelated thing needs to be checked.. Gerrit permissions to make sure design team can merge things in the repo but not everybody else.

This was taken care of thanks to @QChris!

Change 601344 merged by Dzahn:
[operations/puppet@production] microsites::design: add blog subdirectory

https://gerrit.wikimedia.org/r/601344

Change 602018 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] microsites::design: add git clone for blog site

https://gerrit.wikimedia.org/r/602018

Change 602018 merged by Dzahn:
[operations/puppet@production] microsites::design: add git clone for blog site

https://gerrit.wikimedia.org/r/602018

Change 602040 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] microsites::design: move repo dir out of design dir

https://gerrit.wikimedia.org/r/602040

Change 602040 merged by Dzahn:
[operations/puppet@production] microsites::design: move blog repo dir out of design dir

https://gerrit.wikimedia.org/r/602040

Change 602055 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] microsites::design: use variable for repo dir when cloning blog files

https://gerrit.wikimedia.org/r/602055

Change 602055 merged by Dzahn:
[operations/puppet@production] microsites::design: use variable for repo dir when cloning blog files

https://gerrit.wikimedia.org/r/602055

Change 602057 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] microsites::design: add httpd alias and config for blog site

https://gerrit.wikimedia.org/r/602057

Change 602057 merged by Dzahn:
[operations/puppet@production] microsites::design: add httpd alias and config for blog site

https://gerrit.wikimedia.org/r/602057

@Prtksxna The site has been setup and the content has been cloned. But you'll have to adjust the links to the CSS files or move them around in one way or another. Currently the links are to /asset under _site but /asset is one level above _site.

https://design.wikimedia.org/blog/index.html

@Prtksxna The site has been setup and the content has been cloned. But you'll have to adjust the links to the CSS files or move them around in one way or another. Currently the links are to /asset under _site but /asset is one level above _site.

Thanks @Dzahn.

There is an assets folder inside _site too. But, I guess its not accessible because the links are to /assets/… and not /blog/assets/…. Fixing that here - https://gerrit.wikimedia.org/r/#/c/design/blog/+/602210/.

Hi @Prtksxna I left some comments directly on the Gerrit change. The links to assets inside _site would have to start with a . as a relative path, so "./assets/...". (same for ./blog/ but that won't work because this is a new separate site with a separate docroot). This is part of the complication we have because the repo and docroot are not the same. Another option would be to move all the blog files into the existing design repo.

Thanks @Dzahn! So, jekyll had configurations to deal with websites that are in sub-directories and I think everything is working and linking properly now. Thank you for all your help! 🙏🏽

Great, I'm glad it worked out and it looks good to me, @Prtksxna :)

No matter, I missed. Sorry :)

Oh, I was not mistaken. Can you add a link to the blog on the main page (https://design.wikimedia.org/)? :)

Dzahn added a subscriber: Dzahn.

No matter, I missed. Sorry :)

Oh, I was not mistaken. Can you add a link to the blog on the main page (https://design.wikimedia.org/)? :)

There is still some work that we're doing on the blog site. We'll be adding it soon :)