Skip to content

exotica-jewelry/purple-prism

Repository files navigation

Purple Prism

A theme component for the Hugo static site generator, layered on top of the Hyas theme.

This theme component adds a stylistic "skin" on top of Hyas, affecting the visual appearance, as well as adding some shortcodes -- but it retains the underlying functionality that makes Hyas great.

Using this theme component

Purple Prism is meant to be installed as a Hugo module.

Prerequisites

  1. Hyas requires Node.js v16.x to be installed on your local machine.

  2. Hugo modules require Go to be installed as well.

  3. Make sure you have a reasonably-recent version of Hugo (hugo version). Modules were introduced in 0.55, but additional module-related commands and settings have continued to appear up through at least 0.84.2.

  4. Run hugo mod help and make sure you get back something that isn't an error, which confirms that the first two requirements have been met.

If you are new to Hugo modules, see rootwork/hugo-module-site and its resources for more information.

Installation

  1. To begin a new site, run hugo new site <site_name>, where <site_name> is the path-friendly name of your site. If you want to have your Hugo-related files as a subdirectory of your project repo, run hugo new site hugo to put it in a subdirectory named hugo. If you have an existing site you want to integrate these themes into, it may be easiest to run these steps in a separate folder and then copy things over selectively.

  2. cd into the directory you just created and run:

wget https://github.com/h-enk/hyas-child-theme/archive/refs/heads/master.zip -O master.zip && unzip master.zip && cp -a hyas-child-theme-master/* . && rm -rf hyas-child-theme-master && rm master.zip
  1. Remove files unnecessary for a local theme, and the default Hugo config:
rm -f theme.toml && rm -f config.toml && rm -rf images

Optionally, you may want to also remove the parent theme's Markdown files and Netlify configuration. Be sure to leave the Node package*.json files in place.

  1. Run hugo mod init <repo_url>, where <repo_url> is the protocol-less URL to your site's repo. For instance, this repo's URL would be github.com/exotica-jewelry/purple-prism. This will create a go.mod file.

  2. Run hugo mod get github.com/exotica-jewelry/purple-prism. This will create a go.sum file.

  3. Open the config/_default/config.toml file and find the [module] section. At the top of that section, before the [[module.mounts]] items, insert the following (note indentation is important!):

  [[module.imports]]
    path = "github.com/exotica-jewelry/purple-prism" # Theme components
  1. Run npm install (yarn won't work here, unfortunately) to pull in the Doks dependencies.

  2. Run hugo server to automatically download the Hugo modules and serve the site, viewable at http://localhost:1313.

Updating themes and dependencies

To update Hyas and Hyas dependencies, run npm outdated to get a list of Node packages (including Hyas) that have available updates, then run npm update <pkg> to update them selectively.

To update Purple Prism, run:

hugo mod get github.com/exotica-jewelry/purple-prism

Or, if you have additional Hugo modules, you can update all of them by running:

hugo mod get -u ./...

There are other options for updating to a specific version.

Modifying the theme

Settings from both Purple Prism and Hyas can be overridden in the usual Hugo way: Adding files to your site subdirectories (assets, static, data, i18n, etc.) with the same name as files in either theme will override those files.