Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mansoorbarri/hugo-validator
A python script to check if your Hugo theme meets all the requirements
https://github.com/mansoorbarri/hugo-validator
hugo hugo-theme mansoorbarri themes
Last synced: 2 months ago
JSON representation
A python script to check if your Hugo theme meets all the requirements
- Host: GitHub
- URL: https://github.com/mansoorbarri/hugo-validator
- Owner: mansoorbarri
- License: mit
- Created: 2024-01-26T15:16:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T12:49:39.000Z (11 months ago)
- Last Synced: 2024-10-12T22:22:35.141Z (4 months ago)
- Topics: hugo, hugo-theme, mansoorbarri, themes
- Language: Python
- Homepage: https://mansoorbarri.com/downloads/hugo-validator/
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Theme Submission Validation Script
This Python script is designed to validate the readiness of a Hugo theme for submission by checking various requirements defined in the `theme.toml` & `README.md` files. The script ensures that essential metadata and links are correctly specified and functional.> [!IMPORTANT]
> **⚠️ This is a work in progress. It is not yet feature-complete, and it is not yet stable. It is not yet ready for production use.**## Usage
Make sure you have `python` & `git` installed on your system before using the tool.
- Clone the script: `git clone https://github.com/mansoorbarri/hugo-validator && cd hugo-validator`
- install the requirements: `pip3 install -r requirements.txt`
- Run the validator: `python3 validator.py`*you might have to run the validator with `python` instead of `python3` especially in Windows.*
## Support
- Leaving a ⭐️ would mean a lot!## Overview
### 1. Metadata Validation
- **Name:** Ensures the existence and non-empty value of the theme name.
- **License:** Checks for the presence and validity of the license type.
- **License Link:** Verifies that the license link is an absolute and valid URL.
- **Description:** Ensures the presence and non-empty value of the theme description.
- **Homepage:** Validates the homepage link for being an absolute and working URL.
- **Demosite:** Checks the demosite link for being an absolute and functional URL.
- **Tags:** Verifies the existence of theme tags.
- **Authors:** Ensures the presence of author information, including name and homepage.### 2. Image Validation
- **Screenshot:** Verifies the existence of either `screenshot.png` or `screenshot.jpg` in the `images` directory.
- **Thumbnail:** Ensures the presence of either `tn.png` or `tn.jpg` in the `images` directory.### 3. Optional Porting Check
- **Original Theme Information:** If the user indicates that the theme is ported, checks for the existence and non-empty values of the original author's name, homepage, and repository link.### 4. Link Validations
- **License Link:** Ensures the 'licenselink' is an absolute and valid URL.
- **Homepage Link:** Validates the 'homepage' link for being an absolute and functional URL.
- **Demosite Link:** Checks the 'demosite' link for being an absolute and functional URL (if provided).
- **Original Theme Links:** If the theme is ported, validates the 'homepage' and 'repo' links in the original theme information for being absolute and valid URLs.## Issues
If you encounter any challenges or problems with the script, I kindly request that you submit them via the "Issues" tab on the GitHub repository. By filling out the provided template, you can provide specific details about the issue, allowing me to promptly address any bugs or consider feature requests.