Skip to content

Commit 7e7e095

Browse files
committed
chore: replace fake stats with real badges, add edit page + last updated date
- Replace commented-out fake stats (1,000+ users / 20K+ downloads) on homepage with real shields.io badges that auto-update (GitHub stars, PyPI monthly downloads, contributors) - Add git-revision-date-localized plugin for last-updated timestamp on every doc page - Add content.action.edit feature + edit_uri_template pointing to the repo for 'Edit this page' links - Add fetch-depth: 0 to deploy.yml checkout so git-revision plugin has full history - Add CSS styling for the badge stats grid
1 parent 6251dc5 commit 7e7e095

5 files changed

Lines changed: 46 additions & 9 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1414
with:
1515
persist-credentials: false
16+
fetch-depth: 0
1617

1718
- name: Set up Python
1819
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0

‎docs/index.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ title: C/C++ Linting
133133
</div>
134134
</div>
135135

136-
<!-- <div class="stats-grid">
136+
<div class="stats-grid">
137137
<div class="stat">
138-
<strong>1,000+</strong>
139-
<span>GitHub Users</span>
138+
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/cpp-linter/cpp-linter?style=for-the-badge&amp;logo=github&amp;color=2B7489&amp;label=Stars" loading="lazy" />
139+
<span>GitHub Stars</span>
140140
</div>
141141
<div class="stat">
142-
<strong>20K+</strong>
143-
<span>Downloads/Month</span>
142+
<img alt="PyPI Downloads" src="https://img.shields.io/pypi/dm/cpp-linter?style=for-the-badge&amp;logo=python&amp;color=3776AB&amp;label=Monthly+Downloads" loading="lazy" />
143+
<span>PyPI Monthly Downloads</span>
144144
</div>
145145
<div class="stat">
146-
<strong>50+</strong>
147-
<span>Contributors</span>
146+
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/cpp-linter/cpp-linter?style=for-the-badge&amp;logo=github&amp;color=6E5494&amp;label=Contributors" loading="lazy" />
147+
<span>GitHub Contributors</span>
148148
</div>
149-
</div> -->
149+
</div>
150150

151151
</div>
152152

‎docs/requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ markdown-gfm-admonition
22
mkdocs
33
mkdocs-include-markdown-plugin
44
mkdocs-material
5+
mkdocs-git-revision-date-localized-plugin

‎docs/stylesheets/extra.css‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,33 @@ th {
197197
color: var(--md-default-fg-color--light);
198198
}
199199

200+
/* Stats grid with shields.io badges */
201+
.stats-grid {
202+
display: flex;
203+
flex-wrap: wrap;
204+
justify-content: center;
205+
gap: 2rem;
206+
margin: 2rem 0;
207+
}
208+
209+
.stats-grid .stat {
210+
display: flex;
211+
flex-direction: column;
212+
align-items: center;
213+
gap: 0.5rem;
214+
}
215+
216+
.stats-grid .stat span {
217+
font-size: 0.85rem;
218+
color: var(--md-default-fg-color--light);
219+
font-weight: 500;
220+
}
221+
222+
.stats-grid .stat img {
223+
height: 32px;
224+
border-radius: 4px;
225+
}
226+
200227
/* Mobile responsiveness for trusted by section */
201228
@media screen and (max-width: 768px) {
202229
.logo-grid {
@@ -205,7 +232,9 @@ th {
205232
padding: 0 1rem;
206233
}
207234

208-
235+
.stats-grid {
236+
gap: 1.5rem;
237+
}
209238
}
210239

211240
/* Ensure tab items have proper contrast */

‎mkdocs.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ theme:
2424
- navigation.top
2525
- navigation.sections
2626
- navigation.footer
27+
- content.action.edit
2728
- content.code.annotate
2829
- content.code.copy
2930
- content.tabs.link
@@ -84,10 +85,15 @@ markdown_extensions:
8485
plugins:
8586
- search
8687
- blog
88+
- git-revision-date-localized:
89+
enable_creation_date: true
90+
type: datetime
8791

8892
extra_css:
8993
- stylesheets/extra.css
9094

95+
edit_uri_template: https://github.com/cpp-linter/cpp-linter.github.io/edit/main/docs/{path}
96+
9197
extra:
9298
social:
9399
- icon: fontawesome/brands/github

0 commit comments

Comments
 (0)