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.
- Live Site: https://opensquare.nyupress.org/
- Stage Site (requires VPN): https://opensquare-stage.nyupress.org/
- Development Site (requires VPN): https://opensquare-dev.nyupress.org/
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.
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
└── ...
- Hugo 0.147.8 or later
- Git
brew install hugo
or
brew upgrade hugo
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 theconfig/
directory.
hugo server --ignoreCache -e local
- Visit http://localhost:1313/ to preview the site.
-
Clone the repository:
git clone https://github.com/NYULibraries/dlts-open-square.git cd dlts-open-square
-
Install dependencies: Ensure Hugo is installed and updated (see above).
-
Start the server:
hugo server --ignoreCache -e local
-
Edit content or theme:
- Content:
content/
- Theme:
themes/dlts-opensquare/
- Content:
-
Build for stage:
hugo -e stage
- The static site output is generated in the
docs/
directory. - Deploy the contents of
docs/
to your web server or static hosting provider.
-
Vue.js / Solr Search Application: dlts-open-square-search-application
-
EPUB Reader Builder: dlts-readium-js-viewer
-
Reader Plugin: dlts-rjs-plugin-open-square
-
Theme: The custom Hugo theme is in
themes/dlts-opensquare/
. It is derived from vimux/blank and released under the MIT license. More information is available atthemes/dlts-opensquare/README.md
. -
Configuration: Environment-specific settings are in the
config/
directory. See Hugo configuration docs for details. -
Content: Add or edit Markdown files in
content/pages
to update site pages.
The site uses:
-
Google Analytics (gtag.js): Configured with anonymized IP tracking.
-
Matomo Analytics: Hosted at
https://nyulib.matomo.cloud/
with site ID18
.
Both scripts are included in the HTML output for all book pages.
- This repository: MIT License.
- Theme: Derived from vimux/blank, MIT License.
See
themes/dlts-opensquare/README.md
for details.
Pull requests and issues are welcome! Please ensure your changes are tested locally before submitting.
-
Clone repo locally and checkout
dev
-
Create a branch from dev for local development: $ git checkout -b name-of-your-bugfix-or-feature
-
Push your new branch to github and create a PR
For questions or support, please contact the NYU Libraries Digital Library Technology Services team or create an issue in this github repository.