-
Notifications
You must be signed in to change notification settings - Fork 346
[Prototype] Site built using Jekyll for GitHub page #336
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
Draft
bachand
wants to merge
1
commit into
airbnb:master
Choose a base branch
from
bachand:mb--site-prototype
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| workflow_dispatch: | ||
|
|
||
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.1' | ||
| bundler-cache: true | ||
| working-directory: .jekyll | ||
|
|
||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v4 | ||
|
|
||
| - name: Build site | ||
| run: cd .jekyll && ./build.sh | ||
| env: | ||
| JEKYLL_ENV: production | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: _site | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| .build | ||
| .swiftpm | ||
| .DS_Store | ||
| .vscode | ||
| .vscode | ||
|
|
||
| # Jekyll | ||
| _site | ||
| .jekyll/index.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| _site | ||
| .sass-cache | ||
| .jekyll-cache | ||
| .jekyll-metadata | ||
| Gemfile.lock | ||
| index.md | ||
| assets/css/syntax.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| source "https://rubygems.org" | ||
|
|
||
| # Jekyll | ||
| gem "jekyll", "~> 4.3" | ||
|
|
||
| # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem | ||
| platforms :mingw, :x64_mingw, :mswin, :jruby do | ||
| gem "tzinfo", ">= 1", "< 3" | ||
| gem "tzinfo-data" | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Jekyll Site | ||
|
|
||
| Jekyll configuration for GitHub Pages. | ||
|
|
||
| ## Local Development | ||
|
|
||
| ```bash | ||
| ./serve.sh | ||
| ``` | ||
|
|
||
| Open http://localhost:4000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Jekyll configuration for Airbnb Swift Style Guide | ||
|
|
||
| # Basic settings | ||
| title: Airbnb Swift Style Guide | ||
| description: Official Swift style guide for Airbnb | ||
| baseurl: "/swift" | ||
| url: "https://bachand.github.io" | ||
|
|
||
| # Syntax highlighting | ||
| markdown: kramdown | ||
| highlighter: rouge | ||
|
|
||
| kramdown: | ||
| syntax_highlighter: rouge | ||
| syntax_highlighter_opts: | ||
| default_lang: swift | ||
| parse_block_html: true | ||
|
|
||
| # Build settings | ||
| exclude: | ||
| - Gemfile | ||
| - Gemfile.lock | ||
| - .gitignore | ||
| - README.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>{{ page.title | default: site.title }}</title> | ||
| <link rel="stylesheet" href="{{ '/assets/css/syntax.css' | relative_url }}"> | ||
| <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}"> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <header> | ||
| <h1>{{ site.title }}</h1> | ||
| <p>{{ site.description }}</p> | ||
| <a href="https://github.com/airbnb/swift">View on GitHub</a> | ||
| </header> | ||
|
|
||
| <main> | ||
| {{ content }} | ||
| </main> | ||
|
|
||
| <footer> | ||
| <p>© Airbnb</p> | ||
| </footer> | ||
| </div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| body { | ||
| font-family: system-ui, sans-serif; | ||
| line-height: 1.6; | ||
| margin: 0; | ||
| } | ||
|
|
||
| :root { | ||
| --rausch: #FF5A5F; | ||
| } | ||
|
|
||
| .container { | ||
| max-width: 900px; | ||
| margin: 0 auto; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| header { | ||
| border-bottom: 1px solid #ddd; | ||
| border-left: 3px solid var(--rausch); | ||
| padding-left: 20px; | ||
| padding-bottom: 20px; | ||
| margin-bottom: 40px; | ||
| } | ||
|
|
||
| header a { | ||
| color: var(--rausch); | ||
| text-decoration: none; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| header a:hover { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| h2 { | ||
| border-bottom: 1px solid #eee; | ||
| padding-bottom: 8px; | ||
| } | ||
|
|
||
| code { | ||
| background: #f5f5f5; | ||
| padding: 2px 6px; | ||
| border-radius: 3px; | ||
| font-family: monospace; | ||
| font-size: 90%; | ||
| } | ||
|
|
||
| pre { | ||
| background: #f8f8f8; | ||
| border: 1px solid #e1e4e8; | ||
| border-radius: 6px; | ||
| padding: 16px; | ||
| overflow-x: auto; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| pre code { | ||
| background: none; | ||
| padding: 0; | ||
| font-size: 14px; | ||
| font-family: 'SF Mono', Monaco, Menlo, 'Courier New', monospace; | ||
| } | ||
|
|
||
| footer { | ||
| border-top: 1px solid #ddd; | ||
| padding-top: 20px; | ||
| margin-top: 60px; | ||
| text-align: center; | ||
| color: #666; | ||
| } | ||
|
|
||
| details { | ||
| margin: 20px 0; | ||
| } | ||
|
|
||
| summary { | ||
| cursor: pointer; | ||
| font-weight: 600; | ||
| user-select: none; | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| details[open] summary { | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| details pre { | ||
| margin-top: 0; | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| details pre:last-child { | ||
| margin-bottom: 0; | ||
| } | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Script to build the Jekyll site | ||
|
|
||
| set -e | ||
|
|
||
| ./prepare-content.sh | ||
|
|
||
| echo "📦 Installing dependencies..." | ||
| bundle install | ||
|
|
||
| echo "🔨 Building Jekyll site..." | ||
| bundle exec jekyll build --destination ../_site | ||
|
|
||
| echo "✅ Build complete! Output in _site/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Shared script to prepare content for Jekyll | ||
|
|
||
| echo "📋 Copying guide.md to index.md with frontmatter..." | ||
| { | ||
| echo "---" | ||
| echo "layout: default" | ||
| echo "---" | ||
| echo "" | ||
| cat ../guide.md | sed 's/<details>/<details markdown="1">/g' | ||
| } > index.md | ||
|
|
||
| echo "🎨 Generating syntax highlighting CSS..." | ||
| bundle exec rougify style github.light > assets/css/syntax.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Script to test the Jekyll site locally | ||
|
|
||
| set -e | ||
|
|
||
| ./prepare-content.sh | ||
|
|
||
| echo "📦 Installing dependencies..." | ||
| bundle install | ||
|
|
||
| echo "🚀 Starting Jekyll server..." | ||
| echo "Site will be available at: http://localhost:4000" | ||
| echo "Press Ctrl+C to stop" | ||
| bundle exec jekyll serve --baseurl "" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 haven't tested this part.