Skip to content

Commit 9b66e82

Browse files
authored
fix: hero rendering (#4)
1 parent ef897bd commit 9b66e82

File tree

6 files changed

+121
-69
lines changed

6 files changed

+121
-69
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
11
name: Deploy Documentation
22
on:
33
push:
4-
branches:
5-
- main # Set the branch you want to trigger the deployment
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
67

78
jobs:
8-
deploy:
9+
build:
910
runs-on: ubuntu-latest
1011
steps:
1112
- name: Checkout Repository
1213
uses: actions/checkout@v5
13-
14+
with:
15+
persist-credentials: false
16+
1417
- name: Set up Python
1518
uses: actions/setup-python@v4
1619
with:
1720
python-version: '3.x'
18-
21+
1922
- name: Install Dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install nox
23-
nox -s docs
23+
run: pipx run nox -s docs
2424

25+
- name: Upload docs build as artifact
26+
uses: actions/upload-pages-artifact@v4
27+
with:
28+
name: ${{ github.event.repository.name }}_docs
29+
path: ${{ github.workspace }}/site
30+
31+
deploy:
32+
if: github.ref == 'refs/heads/main'
33+
runs-on: ubuntu-latest
34+
needs: [build]
35+
permissions:
36+
# to deploy to Pages
37+
pages: write
38+
# to verify the deployment originates from an appropriate source
39+
id-token: write
40+
# Deploy to the github-pages environment
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
2545
- name: Deploy to GitHub Pages
26-
uses: peaceiris/actions-gh-pages@v4
46+
id: deployment
47+
uses: actions/deploy-pages@v4
2748
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
publish_dir: ./site
30-
user_name: 'github-actions[bot]'
31-
user_email: 'github-actions[bot]@users.noreply.github.com'
32-
commit_message: 'Deploy documentation'
49+
artifact_name: ${{ github.event.repository.name }}_docs

docs/getting-started.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ Welcome to cpp-linter! This guide will help you integrate C/C++ linting into you
44

55
## Choose Your Integration
66

7+
<!-- markdownlint-disable MD033 -->
8+
79
Select the method that best fits your development workflow:
810

911
<div class="grid cards" markdown>
1012

11-
- :material-github: **GitHub Actions**
13+
- :material-github: **GitHub Actions**
1214

1315
---
1416

@@ -18,8 +20,7 @@ Select the method that best fits your development workflow:
1820

1921
[Get started with GitHub Actions →](https://cpp-linter.github.io/cpp-linter-action/){ .md-button .md-button--primary }
2022

21-
22-
- :material-git: **Pre-commit Hooks**
23+
- :material-git: **Pre-commit Hooks**
2324

2425
---
2526

@@ -28,9 +29,8 @@ Select the method that best fits your development workflow:
2829
**Perfect for:** Catching issues before commits, local enforcement
2930

3031
[Get started with pre-commit →](https://github.com/cpp-linter/cpp-linter-hooks){ .md-button .md-button--primary }
31-
3232

33-
- :fontawesome-brands-python: **Command Line**
33+
- :fontawesome-brands-python: **Command Line**
3434

3535
---
3636

@@ -40,7 +40,7 @@ Select the method that best fits your development workflow:
4040

4141
[Get started with cpp-linter package →](https://cpp-linter.github.io/cpp-linter/){ .md-button .md-button--primary }
4242

43-
- :simple-rust: **Command Line (Rust)**
43+
- :simple-rust: **Command Line (Rust)**
4444

4545
---
4646

@@ -56,25 +56,23 @@ Select the method that best fits your development workflow:
5656

5757
<div class="grid cards" markdown>
5858

59-
- :fontawesome-brands-github: **clang-tools-static-binaries**
59+
- :fontawesome-brands-github: **clang-tools-static-binaries**
6060

6161
---
6262

6363
Distribution clang tools static binaries for various platforms
6464

6565
[Download from →](https://github.com/cpp-linter/clang-tools-static-binaries){ .md-button .md-button--primary }
6666

67-
68-
- :fontawesome-brands-docker: **clang-tools-docker**
67+
- :fontawesome-brands-docker: **clang-tools-docker**
6968

7069
---
7170

7271
Distribution clang tools Docker images for various platforms
7372

7473
[Download from →](https://github.com/cpp-linter/clang-tools-docker){ .md-button .md-button--primary }
7574

76-
77-
- :fontawesome-brands-python: **clang-tools-wheels**
75+
- :fontawesome-brands-python: **clang-tools-wheels**
7876

7977
---
8078

@@ -84,21 +82,19 @@ Select the method that best fits your development workflow:
8482

8583
</div>
8684

87-
88-
8985
## Easy Installation
9086

9187
<div class="grid cards" markdown>
9288

93-
- :fontawesome-brands-python: **clang-tools-pip**
89+
- :fontawesome-brands-python: **clang-tools-pip**
9490

9591
---
9692

9793
Easy installation of clang tools static binaries via pip
9894

9995
[Get started with clang-tools CLI →](https://cpp-linter.github.io/clang-tools-pip/){ .md-button .md-button--primary }
10096

101-
- :fontawesome-brands-python: **clang-tools-asdf**
97+
- :fontawesome-brands-python: **clang-tools-asdf**
10298

10399
---
104100

docs/index.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,31 @@
22
hide:
33
- navigation
44
- toc
5+
template: home.html
6+
title: C/C++ Linting
57
---
68

7-
<div class="hero" markdown>
9+
<!-- markdownlint-disable MD041 MD033 MD036 MD025 -->
810

9-
# C/C++ linting that simply works
10-
11-
**Lint your C/C++ code in workflow** - automated, configurable, and reliable. Integrate seamlessly into any workflow in minutes.
12-
13-
[Get started :material-rocket-launch:](getting-started.md){ .md-button .md-button--primary }
14-
15-
</div>
16-
17-
<div class="grid cards" markdown>
18-
19-
</div>
11+
# C/C++ Linting
2012

2113
## Everything you need for linting C/C++ code
2214

2315
<div class="grid cards" markdown>
2416

25-
- :material-chart-line: **Built in Open Source**
17+
- :material-chart-line: **Built in Open Source**
2618

2719
---
2820

2921
Open-source and MIT-licensed. Bringing contributors together to empower impactful C/C++ lint projects in open source and beyond.
3022

31-
- :material-cog: **Zero Configuration**
23+
- :material-cog: **Zero Configuration**
3224

3325
---
3426

3527
Works out of the box with sensible defaults. Advanced users can customize every aspect to match their coding standards.
3628

37-
- :material-devices: **Works Everywhere**
29+
- :material-devices: **Works Everywhere**
3830

3931
---
4032

@@ -138,7 +130,15 @@ hide:
138130
- id: clang-format
139131
args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit.
140132
- id: clang-tidy
141-
args: [--checks='boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*']
133+
args:
134+
- --checks='boost-*
135+
- bugprone-*
136+
- performance-*
137+
- readability-*
138+
- portability-*
139+
- modernize-*
140+
- clang-analyzer-*
141+
- cppcoreguidelines-*'
142142
```
143143

144144
=== "Command Line"

docs/overrides/home.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% extends "main.html" %}
2+
3+
{% block hero %}
4+
<div class="hero">
5+
<h1 id="cc-linting-that-simply-works">C/C++ linting that simply works</h1>
6+
<p>
7+
<strong>Lint your C/C++ code in your development workflow</strong>
8+
- automated, configurable, and reliable.
9+
Integrate seamlessly into any development workflow in minutes.
10+
</p>
11+
<p>
12+
<a class="md-button md-button--primary" href="getting-started/">
13+
Get started
14+
<span class="twemoji">
15+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.13 22.19-1.63-3.83c1.57-.58 3.04-1.36 4.4-2.27zM5.64 12.5l-3.83-1.63 6.1-2.77C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39S16.66.269 11 5.93c-2.19 2.19-3.5 4.6-4.35 6.71-.28.75-.09 1.57.46 2.13l2.13 2.12c.55.56 1.37.74 2.12.46A19.1 19.1 0 0 0 18.07 13c5.66-5.66 3.54-10.61 3.54-10.61m-7.07 7.07c-.78-.78-.78-2.05 0-2.83s2.05-.78 2.83 0c.77.78.78 2.05 0 2.83s-2.05.78-2.83 0m-5.66 7.07-1.41-1.41zM6.24 22l3.64-3.64c-.34-.09-.67-.24-.97-.45L4.83 22zM2 22h1.41l4.77-4.76-1.42-1.41L2 20.59zm0-2.83 4.09-4.08c-.21-.3-.36-.62-.45-.97L2 17.76z"></path></svg>
16+
</span>
17+
</a>
18+
</p>
19+
</div>
20+
{% endblock %}

docs/stylesheets/extra.css

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,62 @@ th {
22
background-color: var(--md-default-fg-color--lightest);
33
}
44

5+
:root > * {
6+
--cpp-linter-logo-color-green: #40b385;
7+
--cpp-linter-logo-color-yellow: #ffc20a;
8+
}
9+
510
/* Hero section styling */
611
.hero {
712
text-align: center;
813
padding: 4rem 0;
9-
background: linear-gradient(135deg, var(--md-primary-fg-color) 0%, var(--md-accent-fg-color) 100%);
10-
background-size: 200% 200%;
11-
animation: gradientShift 8s ease infinite;
12-
color: white;
13-
margin: -1.5rem -1.5rem 3rem -1.5rem;
14-
border-radius: 0 0 1rem 1rem;
14+
background: var(--md-primary-fg-color);
15+
color: var(--md-primary-bg-color);
1516
}
1617

1718
.hero h1 {
1819
font-size: 3rem;
1920
font-weight: 700;
2021
margin-bottom: 1rem;
2122
text-shadow: 0 2px 4px rgba(0,0,0,0.3);
23+
text-align: center;
24+
color: unset;
2225
}
2326

2427
.hero p {
2528
font-size: 1.2rem;
2629
margin-bottom: 2rem;
2730
opacity: 0.9;
28-
max-width: 600px;
31+
width: 65%;
2932
margin-left: auto;
3033
margin-right: auto;
3134
}
3235

36+
.hero .twemoji {
37+
--md-icon-size: 1.125em;
38+
display: inline-flex;
39+
height: var(--md-icon-size);
40+
vertical-align: text-top;
41+
}
42+
43+
.hero .md-button {
44+
background: var(--cpp-linter-logo-color-green);
45+
color: black;
46+
border: none;
47+
border-radius: unset;
48+
display: inline-block;
49+
}
50+
51+
.hero .md-button:hover {
52+
background: var(--cpp-linter-logo-color-yellow);
53+
color: black;
54+
border: none;
55+
}
56+
57+
.md-typeset .md-button:hover {
58+
color: black;
59+
}
60+
3361
@keyframes gradientShift {
3462
0% { background-position: 0% 50%; }
3563
50% { background-position: 100% 50%; }
@@ -184,19 +212,6 @@ th {
184212
}
185213
}
186214

187-
.md-header {
188-
background-color: #4051b5;
189-
}
190-
191-
/* Make navigation tabs match header color */
192-
.md-tabs {
193-
background-color: #4051b5;
194-
}
195-
196-
.md-tabs__list {
197-
background-color: #4051b5;
198-
}
199-
200215
/* Ensure tab items have proper contrast */
201216
.md-tabs__item {
202217
background-color: transparent;

mkdocs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ site_name: "cpp-linter"
22
site_description: "Documentation for the cpp-linter organization."
33
site_url: "https://cpp-linter.github.io/"
44
repo_url: https://github.com/cpp-linter
5-
5+
repo_name: "cpp-linter"
66
copyright: "© 2021-2025, cpp-linter"
77

88
nav:
@@ -11,11 +11,15 @@ nav:
1111
- Discussion: discussion.md
1212
# - Blog:
1313
# - blog/index.md
14+
exclude_docs: |
15+
blog/**
1416
1517
theme:
1618
name: material
19+
custom_dir: docs/overrides
1720
features:
1821
- navigation.tabs
22+
- navigation.tabs.sticky
1923
- toc.integrate
2024
- navigation.top
2125
- navigation.sections
@@ -35,7 +39,7 @@ theme:
3539
# Palette toggle for light mode
3640
- media: "(prefers-color-scheme: light)"
3741
scheme: default
38-
primary: blue
42+
primary: indigo
3943
accent: cyan
4044
toggle:
4145
icon: material/lightbulb-outline
@@ -44,7 +48,7 @@ theme:
4448
# Palette toggle for dark mode
4549
- media: "(prefers-color-scheme: dark)"
4650
scheme: slate
47-
primary: blue
51+
primary: indigo
4852
accent: cyan
4953
toggle:
5054
icon: material/lightbulb

0 commit comments

Comments
 (0)