Skip to content

Commit

Permalink
Merge pull request #1207 from maxmind/kevin/hugo-cleanup
Browse files Browse the repository at this point in the history
Clean up hugo files and some tweaks
  • Loading branch information
kevcenteno authored Oct 10, 2024
2 parents 0439580 + e7eb4ce commit 75ee6fe
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 882 deletions.
74 changes: 25 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@

## Overview

- **Static Site Generator**: [GatsbyJS](https://www.gatsbyjs.org/) +
- **Static Site Generator**: [Hugo](https://gohugo.io/) +
[TypeScript](https://www.typescriptlang.org/) +
[CSS Modules](https://github.com/css-modules/css-modules) +
[MDX](https://mdxjs.com/)
- **Linting**: [ESLint](https://eslint.org/) +
[StyleLint](https://stylelint.io/)
- **Hosting**: [Firebase](https://firebase.google.com/docs/hosting)
- **Hosting**: [Cloudflare Pages](https://pages.cloudflare.com/)

## Usage

Expand All @@ -41,69 +37,49 @@ If you need help installing and/or managing Node and NPM versions, check out [NV
### Installation

```sh
npm install && npm run prepare
npm install
```

#### Explanation
- `npm install` installs the necessary node modules for development.

* `npm install` installs the neccessary node modules for development.
* `npm run prepare` sets up the linting pre-commit hooks via husky.
#### Install Hugo

### Development

#### Development Server

The development server watches files, rebuilds the site, and reloads the browser
when files change.
##### Homebrew (macOS)

```sh
npm run develop
brew install hugo
```

#### Static Server

The static server is useful for testing features that might only be relevant to
the production build, such as CSP Policies, SRI hashes, Firebase routing
rules (301/302 redirects or url rewrites), and Firebase functions.
##### Debian / Ubuntu

It is recommended that you install
[the latest release of Hugo](https://github.com/gohugoio/hugo/releases/latest).
For debian and ubuntu users, they offer a .deb file.

```sh
npm run build && npm run serve
```

### Testing
##### Other OS

```sh
npm run test # runs all tests
npm run test:unit # runs unit tests
npm run test:regressions # runs regression tests
```
See [Hugo Installation](https://gohugo.io/getting-started/installing/)

### Deployments
#### Install Embedded Dart Sass

This project has two environments: staging environment and production. All
preview links are deployed to the staging environment. The production
environment can only be deploy to via a PR being merged into `main`.
Download
[Embedded Dart Sass](https://github.com/sass/dart-sass-embedded/releases) and
make sure it is in your `$PATH`. This is necessary for Hugo to process SASS and
SCSS files. See the
[Hugo documentation](https://gohugo.io/hugo-pipes/scss-sass/) for more
information.

#### Preview Link Generation
### Development

All PRs will be assigned a preview link during the CI/CD process. These links
are good for 7 days. To regenerate a link, delete the comment and run the CI/CD
action again.
#### Development Server

Users authenticated with the Firebase CLI can generate an ad-hoc preview link
site by running the following from the root of the project.
The development server watches files, rebuilds the site, and reloads the browser
when files change.

```sh
npm run build && npm run preview
hugo server
```

#### Firebase Functions

**Firebase function resources are shared throughout environments.** If two PRs
have changes to Firebase functions, the deployed functions will be those of the
PR whose `Firebase - Staging` GitHub workflow has run most recently.

### Updating Release Notes for the New Year

Whenever you create your first release note for a product category for a new
Expand Down
11 changes: 11 additions & 0 deletions assets/scss/_recaptcha.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.grecaptcha-badge {
bottom: 20px !important;
left: -2px !important;
overflow: hidden !important;
transition: all 0.3s ease !important;
width: 70px !important;
}

.grecaptcha-badge:hover {
width: 256px !important;
}
1 change: 1 addition & 0 deletions assets/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import 'tag';
@import 'schema';
@import 'release-note';
@import 'recaptcha';

*:focus {
outline-color: var(--mm-color-logo-blue-light);
Expand Down
6 changes: 0 additions & 6 deletions content/.prettierrc.js

This file was deleted.

129 changes: 0 additions & 129 deletions content/geoip/_geoip-overview.mdx

This file was deleted.

55 changes: 0 additions & 55 deletions content/geoip/_geolite-overview.mdx

This file was deleted.

Loading

0 comments on commit 75ee6fe

Please sign in to comment.