Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of Jekyll in favor of just HTML pages. #62

Merged
merged 19 commits into from
May 28, 2021

Conversation

rht
Copy link
Contributor

@rht rht commented Apr 19, 2021

No description provided.

@rht
Copy link
Contributor Author

rht commented Apr 21, 2021

https://rht.github.io/zulip-archive-sample/ for a sample.

Comment on lines -1 to -8
If you are using Jekyll, you may want to take advantage
of its [layouts](https://jekyllrb.com/docs/step-by-step/04-layouts/)
feature.

We provide a file in this directory called archive.html
that you can copy into your `_layouts` directory. You can
modify it as needed to add more branding/information to
your archive.

Choose a reason for hiding this comment

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

Is there a replacement for this when using the GHA deployment method?

If I understand the docs and the action.yml correctly, there's no way to include a settings.py file to make use of settings.html_head_title as a replacement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, right, I didn't notice. But then again, in the current master, the layouts/ dir doesn't get copied over either when executing the GHA.

I'm not entirely sure if others agree with my html_head_title implementation. They might prefer a file instead of a string. So waiting for others' opinion first.

Copy link

@SaschaMann SaschaMann Apr 21, 2021

Choose a reason for hiding this comment

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

But then again, in the current master, the layouts/ dir doesn't get copied over either when executing the GHA.

Are you sure? We've used it to "style" the Julia archive a bit and it seems to work: _layouts/archive.html and https://juliacommunity.github.io/zulip-archive/ (View Source) (I don't know why or how that works, just that it does fwiw :D)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, right, this line does the copying:

cp -rf layouts/* $_layouts_path
.

Note to others: if html_head_title were an html file instead, it has a weird property that it cannot have a </html> tag, and so would be a malformed html file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed html_head_title to page_head.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made a tracking issue for this request: #63.

@rht rht force-pushed the rm-jekyll branch 2 times, most recently from 93e4d44 to 773be1e Compare April 24, 2021 08:12
@gasche
Copy link
Contributor

gasche commented May 15, 2021

I'm not entirely sure if others agree with my html_head_title implementation. They might prefer a file instead of a string. So waiting for others' opinion first.

My opinion on the PR:

  • Overall this is a very nice simplification, I am strongly in favor; I'm just looking at deploying this script and the use of Jekyll adds complexity (for example: if I want to cache dependencies properly, I need to deal with two package managers, pip and gems, instead of just one; and removing Jekyll will reduce non-cached build time in the first place).
  • This also looks like it simplifies the implementation (no weird generation of Markdown inside HTML stuff anymore), which is definitely a plus.
  • I liked the way that the jekyll version could be customized by providing a template (layout/archive.html), and I could see people in the future hoping for more customization. Have you considered using a python Mustache implementation (I guess Mustache is the templating language that was used by Jekyll by default) to specify the page layout?

@timabbott timabbott merged commit b9a1583 into zulip:master May 28, 2021
@timabbott
Copy link
Member

Merged, huge thanks for doing this cleanup @rht! There are surely further improvements we want to make, but it seems like we'll be reasonably happy fixing forward from here.

@mattecapu
Copy link
Contributor

mattecapu commented Jun 28, 2021

I discovered this PR because my archive broke. Isn't there a versioning system preventing this?
Also I can't find any issue where this is discussed nor documentation on how to fix this. Any hint?

@rht rht deleted the rm-jekyll branch June 28, 2021 10:58
@rht
Copy link
Contributor Author

rht commented Jun 28, 2021

@mattecapu you can pin your version just like how the Julia community does it: https://github.com/JuliaCommunity/zulip-archive/blob/master/.github/workflows/deploy.yml#L14.

What is your username at chat.zulip.org? We can subscribe you to a stream where we make announcements on zulip-archive.

@rht
Copy link
Contributor Author

rht commented Jun 28, 2021

@mattecapu
Copy link
Contributor

mattecapu commented Jun 28, 2021

It's not completely broken but the very few customizations I did (minimal CSS, header and footer) are gone and there's no clue on how to restore it or why they're gone.

Thanks for the tip about pinning down a version.

@gasche
Copy link
Contributor

gasche commented Jun 28, 2021

@mattecapu in my comment above I suggested a way to regain this customization back, which is to use a simple Mustache template to customize the generated HTML, instead of going through Jekyll. (In particular, we could just use a Python implementation of Mustache, instead of having to deal with two different languages, package managers, etc.) Would you be interested in looking at contributing such an extension as a new PR?

@mattecapu
Copy link
Contributor

@gasche not really. I think Jekyll was a sensible choice since, afaiu, these archives are meant to be hosted on GH pages anyway.
Maybe there is a good reason to 'reinvent the wheel' by building a Mustache-based templating system is a better choice for zulip-archive, but I don't see it discussed anywhere.

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.

5 participants