https://github.com/openlibhums/salford
Sub theme for UoS
https://github.com/openlibhums/salford
Last synced: 4 months ago
JSON representation
Sub theme for UoS
- Host: GitHub
- URL: https://github.com/openlibhums/salford
- Owner: openlibhums
- License: agpl-3.0
- Created: 2025-07-22T07:43:38.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-22T08:17:48.000Z (11 months ago)
- Last Synced: 2025-07-22T09:45:46.892Z (11 months ago)
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Salford Theme
A custom theme for Janeway based on the University of Salford's branding and design guidelines. This is a subtheme of https://github.com/openlibhums/janeway/tree/master/src/themes/OLH.
Rename the theme folder to 'salford'. This theme is to be used on https://openjournals.salford.ac.uk/.
For more information on Janeway see https://janeway.readthedocs.io/en/v1.7.2/dev/configuration.html#django-settings
## Features
- Salford University fonts (ReplicaPro family)
- Custom color scheme matching Salford branding
- Responsive design
- Custom styling for headers, navigation, and footer
## Build Process
The theme uses a unified build script that supports different modes:
### Quick Copy (Default)
```bash
cd src
python3 themes/salford/build_assets.py copy
```
Copies CSS and all assets from `themes/salford/assets/` to `static/salford/`.
### Watch Mode (Development)
```bash
cd src
python3 themes/salford/build_assets.py watch
```
Watches for changes in CSS files and automatically copies them to the static directory. Perfect for development!
### Full Build (Production)
```bash
cd src
python3 themes/salford/build_assets.py build
```
Performs a complete build including:
- Copying all assets
- Processing SCSS (if available)
- Processing JavaScript
- Handling journal overrides
- Running Django's collectstatic
### Help
```bash
cd src
python3 themes/salford/build_assets.py help
```
Shows usage information and available modes.
## File Structure
```
themes/salford/
├── assets/
│ ├── css/
│ │ └── salford.css # Main CSS file
│ ├── js/ # JavaScript files (if any)
│ ├── fonts/ # Font files (if any)
│ └── img/ # Images (if any)
├── templates/
│ └── core/
│ └── base.html # Base template
├── build_assets.py # Unified build script
└── README.md # This file
```
## Development Workflow
1. **Edit CSS**: Modify `themes/salford/assets/css/salford.css`
2. **Copy Changes**: Run `python3 themes/salford/build_assets.py copy`
3. **View Changes**: Refresh your browser to see updates
**Note**: View the local site at http://localhost:4444/
## Local Development Setup
The site is configured to run on http://localhost:4444/ through the following changes:
### Docker Configuration
- **Port Mapping**: The `docker-compose.yml` file maps port 4444 on the host to port 8000 in the container:
```yaml
ports:
- "4444:8000"
```
### Domain Configuration
To ensure the site works correctly with localhost:4444, run one of these commands:
**Option 1**: Use the Django management command:
```bash
cd src
python3 manage.py update_domains
```
**Option 2**: Use the standalone script:
```bash
python3 update_domains.py
```
**Option 3**: Use the fix domains command (only updates journals with empty domains):
```bash
cd src
python3 manage.py fix_domains
```
These commands update the Press and Journal domain configurations in the database to use `localhost:4444`.
For **automatic updates during development**:
```bash
python3 themes/salford/build_assets.py watch
```
## Theme Activation
To activate this theme for a journal:
1. Go to the journal's admin panel
2. Navigate to **Manager > Journal Settings > General**
3. Set "Journal Theme" to "salford"
4. Save the settings
## Dependencies
The build script handles missing dependencies gracefully:
- **Django**: Required for full build features
- **Sass**: Optional for SCSS processing
- **jsmin**: Optional for JavaScript minification
If dependencies are missing, the script will skip those features and continue with available functionality.
## Git Usage
This theme is now properly configured for git version control. The theme files are tracked by git and you can:
### Check Status
```bash
git status src/themes/salford/
```
### Add Changes
```bash
git add src/themes/salford/
```
### Commit Changes
```bash
git commit -m "Update salford theme: [description of changes]"
```
### View History
```bash
git log --oneline src/themes/salford/
```
### Ignored Files
The local `.gitignore` file in this directory ignores:
- Python cache files (`__pycache__/`, `*.pyc`)
- Build artifacts and temporary files
- IDE-specific files
- Environment files
This ensures that only the source files are tracked while build artifacts and temporary files are excluded.