Repository navigation
workflow: publish specifications to gh-pages #89
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,14 @@ | ||
| title: CSI-Addons Specifications | ||
| plugins: | ||
| - jekyll-default-layout | ||
| - jekyll-optional-front-matter | ||
| - jekyll-readme-index | ||
| - jekyll-relative-links | ||
| - jekyll-titles-from-headings | ||
| relative_links: | ||
| enabled: true | ||
| collections: false | ||
| titles_from_headings: | ||
| enabled: true | ||
| strip_title: true | ||
|
nixpanic marked this conversation as resolved.
Resolved
|
||
| collections: false | ||
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,39 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title> | ||
| <link rel="stylesheet" href="{{ site.github.url }}/assets/css/style.css"> | ||
| </head> | ||
| <body> | ||
| <nav class="navbar"> | ||
| <div class="container nav-container"> | ||
| <a href="https://csi-addons.github.io/" class="nav-logo"> | ||
| <svg class="logo-icon" viewBox="0 0 32 32" width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <rect width="32" height="32" rx="6" fill="#2563eb"/> | ||
| <path d="M8 12h6v8H8zM18 8h6v12h-6zM13 16h6v4h-6z" fill="#fff" opacity="0.9"/> | ||
| <path d="M13 10h6v4h-6z" fill="#93c5fd"/> | ||
| </svg> | ||
| <span>CSI-Addons</span> | ||
| </a> | ||
| <ul class="nav-links"> | ||
| <li><a href="{{ site.github.url }}/">Specifications</a></li> | ||
| <li><a href="https://csi-addons.github.io/">Project</a></li> | ||
| <li><a href="https://github.com/csi-addons/spec" class="nav-github">GitHub</a></li> | ||
| </ul> | ||
| </div> | ||
| </nav> | ||
|
|
||
| <main class="container content"> | ||
| {{ content }} | ||
| </main> | ||
|
|
||
| <footer class="footer"> | ||
| <div class="container"> | ||
| <p>Licensed under the | ||
| <a href="https://github.com/csi-addons/spec/blob/main/LICENSE">Apache License 2.0</a>.</p> | ||
| </div> | ||
| </footer> | ||
| </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,238 @@ | ||
| /* Styling matches https://csi-addons.github.io/ */ | ||
| *, | ||
| *::before, | ||
| *::after { | ||
| margin: 0; | ||
| padding: 0; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| :root { | ||
| --color-primary: #2563eb; | ||
| --color-primary-dark: #1d4ed8; | ||
| --color-primary-light: #93c5fd; | ||
| --color-primary-bg: #eff6ff; | ||
| --color-text: #1e293b; | ||
| --color-text-secondary: #475569; | ||
| --color-text-muted: #64748b; | ||
| --color-bg: #fff; | ||
| --color-bg-alt: #f8fafc; | ||
| --color-border: #e2e8f0; | ||
| --color-code-bg: #0f172a; | ||
| --color-code-text: #e2e8f0; | ||
| --font-sans: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif; | ||
| --font-mono: "SFMono-Regular", consolas, "Liberation Mono", menlo, monospace; | ||
| --radius: 8px; | ||
| } | ||
|
|
||
| body { | ||
| font-family: var(--font-sans); | ||
| color: var(--color-text); | ||
| background: var(--color-bg); | ||
| line-height: 1.6; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
|
|
||
| a { | ||
| color: var(--color-primary); | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| a:hover { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| .container { | ||
| max-width: 1000px; | ||
| margin: 0 auto; | ||
| padding: 0 24px; | ||
| } | ||
|
|
||
| /* Footer */ | ||
| .footer { | ||
| background: var(--color-code-bg); | ||
| color: var(--color-text-muted); | ||
|
nixpanic marked this conversation as resolved.
Resolved
|
||
| padding: 32px 0; | ||
| text-align: center; | ||
| font-size: 0.85rem; | ||
| } | ||
|
|
||
| .footer a { | ||
| color: var(--color-primary-light); | ||
| } | ||
|
|
||
| /* Navbar */ | ||
| .navbar { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| z-index: 100; | ||
| background: rgb(255 255 255 / 95%); | ||
| backdrop-filter: blur(8px); | ||
| border-bottom: 1px solid var(--color-border); | ||
| } | ||
|
|
||
| .nav-container { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| height: 64px; | ||
| max-width: 1200px; | ||
| } | ||
|
|
||
| .nav-logo { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 10px; | ||
| font-size: 1.25rem; | ||
| font-weight: 700; | ||
| color: var(--color-text); | ||
| } | ||
|
|
||
| .nav-logo:hover { | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .nav-links { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 32px; | ||
| list-style: none; | ||
| } | ||
|
|
||
| .nav-links a { | ||
| color: var(--color-text-secondary); | ||
| font-size: 0.9rem; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| .nav-links a:hover { | ||
| color: var(--color-primary); | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .nav-github { | ||
| padding: 6px 16px; | ||
| border: 1px solid var(--color-border); | ||
| border-radius: 6px; | ||
| } | ||
|
|
||
| .nav-github:hover { | ||
| background: var(--color-bg-alt); | ||
| } | ||
|
|
||
| /* Rendered markdown */ | ||
| .content { | ||
| padding-top: 104px; | ||
| padding-bottom: 64px; | ||
| min-height: 80vh; | ||
| } | ||
|
|
||
| .content h1, | ||
| .content h2, | ||
| .content h3, | ||
| .content h4 { | ||
| font-weight: 800; | ||
| letter-spacing: -0.02em; | ||
| line-height: 1.25; | ||
| margin: 2rem 0 1rem; | ||
| } | ||
|
|
||
| .content h1 { | ||
| font-size: 2.25rem; | ||
| margin-top: 0; | ||
| } | ||
|
|
||
| .content h2 { | ||
| font-size: 1.6rem; | ||
| padding-bottom: 0.3rem; | ||
| border-bottom: 1px solid var(--color-border); | ||
| } | ||
|
|
||
| .content h3 { | ||
| font-size: 1.25rem; | ||
| } | ||
|
|
||
| .content p, | ||
| .content ul, | ||
| .content ol, | ||
| .content table, | ||
| .content pre, | ||
| .content blockquote { | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .content ul, | ||
| .content ol { | ||
| padding-left: 1.5rem; | ||
| } | ||
|
|
||
| .content li { | ||
| color: var(--color-text-secondary); | ||
| } | ||
|
|
||
| .content p { | ||
| color: var(--color-text-secondary); | ||
| } | ||
|
|
||
| .content img { | ||
| max-width: 100%; | ||
| } | ||
|
|
||
| .content blockquote { | ||
| padding: 0.5rem 1rem; | ||
| background: var(--color-primary-bg); | ||
| border-left: 4px solid var(--color-primary-light); | ||
| border-radius: 0 var(--radius) var(--radius) 0; | ||
| } | ||
|
|
||
| .content table { | ||
| border-collapse: collapse; | ||
| display: block; | ||
| overflow-x: auto; | ||
| } | ||
|
|
||
| .content th, | ||
| .content td { | ||
| padding: 8px 14px; | ||
| border: 1px solid var(--color-border); | ||
| } | ||
|
|
||
| .content th { | ||
| background: var(--color-bg-alt); | ||
| } | ||
|
|
||
| .content code { | ||
| font-family: var(--font-mono); | ||
| font-size: 0.875em; | ||
| padding: 0.15em 0.4em; | ||
| background: var(--color-bg-alt); | ||
| border: 1px solid var(--color-border); | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .content pre { | ||
| padding: 20px; | ||
| overflow-x: auto; | ||
| background: var(--color-code-bg); | ||
| border-radius: 12px; | ||
| } | ||
|
|
||
| .content pre code { | ||
| padding: 0; | ||
| background: none; | ||
| border: none; | ||
| color: var(--color-code-text); | ||
| line-height: 1.7; | ||
| } | ||
|
|
||
| @media (width <= 768px) { | ||
| .nav-links { | ||
| gap: 16px; | ||
| } | ||
|
|
||
| .content h1 { | ||
| font-size: 1.75rem; | ||
| } | ||
| } | ||
|
nixpanic marked this conversation as resolved.
Resolved
|
||
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,50 @@ | ||
| name: publish-specs | ||
|
|
||
| on: | ||
| push: | ||
| tags: [ 'v*' ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: publish-specs | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| # required to push to the gh-pages branch | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: checkout source | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: stage specifications | ||
| run: | | ||
| mkdir -p _site_src | ||
| cp README.md _site_src/ | ||
| cp -r images _site_src/ | ||
| for dir in */; do | ||
| dir=${dir%/} | ||
| if [ -f "${dir}/README.md" ]; then | ||
| mkdir -p "_site_src/${dir}" | ||
| cp "${dir}/README.md" "_site_src/${dir}/" | ||
| cp "${dir}"/*.proto "_site_src/${dir}/" 2>/dev/null || true | ||
| fi | ||
| done | ||
| # Jekyll config, layout and CSS used by GitHub Pages to render the markdown | ||
| cp -r .github/pages/. _site_src/ | ||
|
|
||
| - name: publish to gh-pages | ||
| uses: peaceiris/actions-gh-pages@v4 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
nixpanic marked this conversation as resolved.
Resolved
nixpanic marked this conversation as resolved.
Resolved
|
||
| publish_dir: _site_src | ||
| publish_branch: gh-pages | ||
| # do not add .nojekyll, GitHub Pages needs to render the markdown | ||
| enable_jekyll: true | ||
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.
Uh oh!
There was an error while loading. Please reload this page.