lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
648 stars 355 forks source link

feat: add website carbon footprint badge #460

Closed guidemetothemoon closed 3 months ago

guidemetothemoon commented 1 year ago

Description

Added support to configure website carbon footprint badge that is provided by Website Footprint Calculator: https://www.websitecarbon.com/badge

The badge can be enabled with enableCarbonBadge = true config setting, as demonstrated in the exampleSite. Once enabled it will be visible as part of sidebar which will ensure that it's nicely adjusted in the UI based on if it's mobile or laptop screen.

Documentation in Wiki needs to be update to describe this feature - please let me know if I can do it myself, I'll be happy to help here :)

NB; If you see "No result" and 503 error in debug mode once you enabled the widget, it may be related to the API rate limiting that is currently being fixed, but there is a workaround you can do, which is described in this issue: https://gitlab.com/wholegrain/website-carbon-badges/-/issues/26 . The new API version is coming in the matter of weeks and once it's available, I will also add a new PR to use the newest version in the theme.

Issue Number:

N/A


Additional Information (Optional)

N/A


Checklist

Yes, I included all necessary artefacts, including:


Testing Checklist

Yes, I ensured that all of the following scenarios were tested:


Notify the following users

@lxndrblz

netlify[bot] commented 1 year ago

Deploy Preview for anatole-demo ready!

Name Link
Latest commit 8e7f52c0a9f453dcf0227d86fcf0ad71d3fcf261
Latest deploy log https://app.netlify.com/sites/anatole-demo/deploys/652be76766fecb00089d3e83
Deploy Preview https://deploy-preview-460--anatole-demo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 90
Accessibility: 88
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarcloud[bot] commented 8 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

lxndrblz commented 3 months ago

@guidemetothemoon Thanks for sending me your PR. After careful consideration I decided not add this feature to the Anatole theme, as I don't see a huge benefit of having these stats displayed in the sidebar.