Skip to content

Commit

Permalink
build: replace node/npm with tailwindcss cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cjshearer committed Jun 26, 2024
1 parent 2a701eb commit 810ea87
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 1,428 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build
public
resources
node_modules
hugo_stats.json
.hugo_build.lock

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,24 @@ Rename your module and remove the replacement directive to change `modern-hugo-r

### 7. Update Build Path, Name, and Dependency Hash

GitHub Actions is configured to build the site using Nix. Now that your site is built from the root directory (not `exampleSite`), you should update its build path and name.
GitHub Actions is configured to build the site using Nix. Now that your site is built from the root directory (not `exampleSite`), you should update its `pname` and remove the custom `sourceRoot`.

Nix also requires the expected hash of downloaded dependencies. Now that `modern-hugo-resume` is imported, you will need to update this hash. Follow the instructions above `outputHash` in [`flake.nix`](./flake.nix).
Nix also requires the expected hash of downloaded dependencies, which now includes `modern-hugo-resume`, so you will need to update this hash. Follow the instructions above `outputHash` in [`flake.nix`](./flake.nix).

See [`cjshearer.dev/flake.nix`](https://github.com/cjshearer/cjshearer.dev/blob/9b49eaef33ed9fb4d8726f6578085d76145c3d1a/flake.nix) for reference.

```diff
# flake.nix
- buildFolder = "exampleSite";
+ buildFolder = ".";
...
- pname = "modern-hugo-resume-exampleSite"
+ pname = "<your username>.github.io"
...
- sourceRoot = "${finalAttrs.src.name}/exampleSite";
...
name = "${finalAttrs.pname}-hugoVendor";
- inherit (finalAttrs) src sourceRoot;
+ inherit (finalAttrs) src;
...
- outputHash = "sha256-someOldHash=
+ outputHash = "sha256-someNewHash=
```
Expand All @@ -112,11 +116,9 @@ git push

These can be installed manually, or automatically with [nix](https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-file#the-determinate-nix-installer) by running `nix develop`:

1. Install [`hugo`](https://gohugo.io/installation/) 1.27.0+extended.
1. Install [`hugo`](https://gohugo.io/installation/) >= 1.28.0+extended.
2. Install [`go`](https://go.dev/dl/) >= 1.22.3.
3. Install `node` >= 20.2.0 with [nvm](https://github.com/nvm-sh/nvm).
4. Install `pnpm` with `corepack enable`.
5. Run `pnpm install` within `exampleSite`.
3. Install [`tailwindcss`](https://github.com/tailwindlabs/tailwindcss/releases) >= 3.4.4.

### Common Commands
```sh
Expand Down
2 changes: 1 addition & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.inline-svg {
@apply inline-block [&_svg]:inline-block [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:fill-current [&_svg]:align-[calc(0.5cap-0.5em)];
@apply inline-block h-[1em] w-[1em] fill-current align-[calc(0.5cap-0.5em)];
}

.skills-table {
Expand Down
8 changes: 4 additions & 4 deletions exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ layout: modern-hugo-resume
<header class="mb-4 text-center md:text-left print:text-left">

![](avatar.jpg "A close-up photo of me wearing a suit and tie")
{ class="avatar not-prose float-right hidden h-24 print:hidden md:block" sizes="256"}
{class="avatar not-prose float-right hidden h-24 print:hidden md:block" sizes="256"}

# Cody Shearer

Software Developer with 3 Years of Experience in Full Stack Web and Mobile Development
{ class="mb-2"}
{class="mb-2"}

- [![](svgs/brands/github.svg)cjshearer](https://github.com/cjshearer "My GithHub")
- [![](svgs/brands/linkedin.svg)in/cjshearer](https://linkedin.com/in/cjshearer "My LinkedIn")
- [![](svgs/solid/house.svg)cjshearer.dev](https://cjshearer.dev "My Website")
- [![](svgs/solid/envelope.svg)cjshearer@live.com](mailto:cjshearer@live.com "My Email")
{ class="not-prose *:inline-svg inline-flex w-fit flex-wrap justify-center gap-4 whitespace-nowrap [&_svg]:mr-1"}
{class="pl-0 my-0 not-prose inline-flex list-none w-fit flex-wrap justify-center gap-4 whitespace-nowrap [&_svg]:inline-svg [&_svg]:mr-1"}

</header>

Expand Down Expand Up @@ -70,7 +70,7 @@ Software Developer with 3 Years of Experience in Full Stack Web and Mobile Devel
- Sentry
- Stripe
- SendGrid
{ class="max-md:skills-table md:float-right [&>li]:list-none print:md:float-none"}
{class="max-md:skills-table md:float-right [&>li]:list-none print:md:float-none"}

## Experience

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ replace github.com/cjshearer/modern-hugo-resume => ../

require (
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7 // indirect
github.com/cjshearer/modern-hugo-resume v0.0.0-20240622205900-d5aff7eecfd0 // indirect
github.com/cjshearer/modern-hugo-resume v0.0.0-20240625183116-2a701eb5eb00 // indirect
)
11 changes: 6 additions & 5 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languageCode = "en-us"
enable = true

[[build.cacheBusters]]
source = "assets/watching/hugo_stats.json"
source = "assets/notwatching/hugo_stats.json"
target = "main.css"

[markup.goldmark.renderer]
Expand All @@ -16,13 +16,14 @@ unsafe = true
[markup.goldmark.parser]
wrapStandAloneImageWithinParagraph = false

[markup.goldmark.parser.attribute]
block = true
title = true
[markup.goldmark.parser.attribute]
block = true
title = true

[[module.imports]]
path = "github.com/cjshearer/modern-hugo-resume"

[[module.mounts]]
disableWatch = true
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"
target = "assets/notwatching/hugo_stats.json"
1 change: 0 additions & 1 deletion exampleSite/package.hugo.json

This file was deleted.

22 changes: 0 additions & 22 deletions exampleSite/package.json

This file was deleted.

Loading

0 comments on commit 810ea87

Please sign in to comment.