-
Notifications
You must be signed in to change notification settings - Fork 344
Build MVP website from README #338
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
Conversation
| ] | ||
| ``` | ||
|
|
||
| </details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that some details closing tags were missing.
4b992c2 to
55ed3a3
Compare
| source 'https://rubygems.org' do | ||
| gem "rake", "~> 13.0.0" | ||
| end | ||
| source 'https://rubygems.org' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked this file to address this warning from Bundler:
[DEPRECATED] This Gemfile does not include an explicit global source. Not using an explicit global source may result in a different lockfile being generated depending on the gems you have installed locally before bundler is run. Instead, define a global source in your Gemfile like this: source "https://rubygems.org".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
| @@ -0,0 +1,48 @@ | |||
| body { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I relied on AI to generate this styling and it looks like a good starting point to me.
| markdown: kramdown | ||
| kramdown: | ||
| input: GFM | ||
| parse_block_html: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was necessary for the code blocks to render correctly.
| @@ -0,0 +1,16 @@ | |||
| <!DOCTYPE html> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to put files that are inputs into the site under a src/ subdirectory to avoid needing to manage excludes in the _config.yml file. In this way, only files under src/ will be used to generate the site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
|
This PR is ready for review, and there is also no rush. I plan to address any feedback after Thanksgiving. |
| with: | ||
| bundler-cache: true | ||
| - name: Build site | ||
| run: bundle exec rake site:build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually deploying the site? Or just validating that it builds successfully? My guess it that it's just validating the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is validating that it builds. We'll need to add a separate workflow for deployment.
| namespace :site do | ||
| desc 'Prints the README content used to build the site' | ||
| task :filter_readme do | ||
| require_relative 'site/site_content' | ||
| puts SiteContent.new.filter_readme | ||
| end | ||
|
|
||
| desc 'Prepares index.md and syntax highlighting assets' | ||
| task :prepare do | ||
| require_relative 'site/site_content' | ||
| puts '📋 Generating index.md from README.md with frontmatter...' | ||
| SiteContent.new.write_index | ||
| puts '🎨 Generating syntax highlighting CSS...' | ||
| SiteContent.new.generate_syntax_css | ||
| end | ||
|
|
||
| desc 'Builds the static site into _site/' | ||
| task build: :prepare do | ||
| env = { 'JEKYLL_ENV' => ENV.fetch('JEKYLL_ENV', 'production') } | ||
| sh env, 'bundle exec jekyll build --source site/src' | ||
| end | ||
|
|
||
| desc 'Serves the site to support previewing its content during development' | ||
| task serve: :prepare do | ||
| env = { 'JEKYLL_ENV' => 'development' } | ||
| sh env, 'bundle exec jekyll serve --source site/src' | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would you run these commands? Do they have to be ran manually each time we make content changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for asking. I clarified two of the commands in #339. site:build is mostly for CI validation.
calda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!! Looks great! I had no idea you could pre-process Jekyll input markdown. Such a great idea.
Is the site built and deployed automatically by GitHub on every commit, or do we have to do it manually? My past experience with Jekyll makes me think it's deployed automatically, but I don't know how exactly GitHub would know to run our custom build code. It would be good to document exactly how the deployment works in the site/README.md once we know for sure it all works.
I see, we haven't set this up yet. Handling this in a follow-up works for me. I also wouldn't mind setting up this part. |
🎉 😃
Yes. Thanks for taking a look @calda ! |
#### Summary I noticed when working on #338 that the README.md has some trailing newlines. My VS Code is set up to remove these on save. I avoided removing them in that PR to keep it focused, so I'm following up to to remove them here. I'm also clarifying a couple of the tasks that I added based on [this](#338 (comment)) feedback. #### Testing CI #### Please review @airbnb/swift-styleguide-maintainers
Summary
Adds the ability to convert the README.md to a website. This productionizes #336 following positive internal feedback on the direction.
The next steps will be to set up a GitHub workflow to publish the site to GitHub Pages. We may also want to continue to polish the style.
Reasoning
A website will make the style guide more accessible. We chose to generate the website from the README so that the existing workflow for updating the style guide remains the same.
Testing
bundle exec rake site:servelocally and check the content at http://localhost:4000Please review
@airbnb/swift-styleguide-maintainers