Skip to content

NYULibraries/dlts-open-square

Repository files navigation

Open Square Static Site

Open Square is NYU Press’s platform for publishing and reading open access books. This repository contains the content for static pages, code for accessing the data for the books, configuration, and theme for the Open Square website, built using Hugo.


Table of Contents


Project Overview

Open Square provides open access to scholarly books published by NYU Press. The site consists of:

  • Static HTML pages for the home page, about page, subject pages, series pages, and book details.
  • A JavaScript search application (external repo).
  • An EPUB book-reading application (external repo).

This repository contains configurations, some content written in Markdown, code for accessing the latest data from a dedicated API, and the custom theme.


Repository Structure

dlts-open-square/
├── config/                # Hugo configuration files for different environments
├── content/               # Markdown content for site pages
│   └── books/             # Code for calling latest book data from API
│   └── pages/             # Content for static "pages"
│   └── series/            # Information needed for "series" taxonomy items
│   └── subjects/          # Information needed for "subjects" taxonomy items
├── docs/                  # Generated static HTML (output)
├── static/                # Static assets (images, JS, CSS)
├── themes/
│   └── dlts-opensquare/   # Custom Hugo theme
├── README.md              # This file
└── ...

Installation

Prerequisites

  • Hugo 0.147.8 or later
  • Git

Install on macOS

brew install hugo

or

brew upgrade hugo

Building the Site

Commands

To build the static site, use the hugo command with the appropriate environment:

# For local development
hugo --ignoreCache -e local

# For development or staging
hugo --ignoreCache -e dev
hugo --ignoreCache -e stage

# For production build
hugo -e production
hugo --ignoreCache -e production
  • The --ignoreCache flag ensures fresh data from remote sources. It takes a few minutes to build this way.
  • The -e flag selects the environment configuration from the config/ directory.

Running the Development Server

hugo server --ignoreCache -e local

Development Workflow

  1. Clone the repository:

    git clone https://github.com/NYULibraries/dlts-open-square.git
    cd dlts-open-square
  2. Install dependencies: Ensure Hugo is installed and updated (see above).

  3. Start the server:

    hugo server --ignoreCache -e local
  4. Edit content or theme:

    • Content: content/
    • Theme: themes/dlts-opensquare/
  5. Build for stage:

    hugo -e stage

Deployment

  • The static site output is generated in the docs/ directory.
  • Deploy the contents of docs/ to your web server or static hosting provider.

Associated Repositories


Customization


Analytics & Tracking

The site uses:

  • Google Analytics (gtag.js): Configured with anonymized IP tracking.

  • Matomo Analytics: Hosted at https://nyulib.matomo.cloud/ with site ID 18.

Both scripts are included in the HTML output for all book pages.


License


Resources


Contributing

Pull requests and issues are welcome! Please ensure your changes are tested locally before submitting.

  1. Clone repo locally and checkout dev

  2. Create a branch from dev for local development: $ git checkout -b name-of-your-bugfix-or-feature

  3. Push your new branch to github and create a PR


Contact

For questions or support, please contact the NYU Libraries Digital Library Technology Services team or create an issue in this github repository.

About

Static site generator for Open Square, NYU Press's Open Access reading platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •