Skip to content

openlibhums/salford

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

cd src
python3 themes/salford/build_assets.py copy

Copies CSS and all assets from themes/salford/assets/ to static/salford/.

Watch Mode (Development)

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)

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

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:
    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:

cd src
python3 manage.py update_domains

Option 2: Use the standalone script:

python3 update_domains.py

Option 3: Use the fix domains command (only updates journals with empty domains):

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:

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

git status src/themes/salford/

Add Changes

git add src/themes/salford/

Commit Changes

git commit -m "Update salford theme: [description of changes]"

View History

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.

About

Sub theme for UoS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •