Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make docsy example site use docsy theme as hugo module #156

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

deining
Copy link
Collaborator

@deining deining commented Dec 12, 2021

This PR is closely associated PR 801, which tries to bring hugo modules to docsy theme.
The goal is to make use of the example site as easy as possible:

git clone https://github.com/google/docsy-example
cd docsy-example
hugo server

No fiddling around with gut submodules any more.

Please note that this PR is not fully ready for review yet, inside my go.mod, I'm missing the commit hash of the docsy repo once PR 801 is applied. Or I can refer to commit in the branch modules (to be newly created in the Docsy repo).

@netlify
Copy link

netlify bot commented Dec 18, 2021

Deploy Preview for docsy-example ready!

Name Link
🔨 Latest commit d7418b2
🔍 Latest deploy log https://app.netlify.com/sites/docsy-example/deploys/624898364f2c140009bac2e8
😎 Deploy Preview https://deploy-preview-156--docsy-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@deining deining changed the title Make docsy example site use docsy theme as hugo module -WIP- Make docsy example site use docsy theme as hugo module Dec 18, 2021
@deining
Copy link
Collaborator Author

deining commented Dec 18, 2021

Finally, docsy example site now builds with hugo modules. You may have a look at the netfily preview and/or the deploy log.

You also can test it out locally now:

git clone -b hugo-module https://github.com/deining/docsy-example
cd docsy-example
hugo server

In the next step, submodules can be removed from the docsy example site. I did this in another docsy-example clone on my personal GitHub account. Afterwards, I could deploy the site to Netlify without problems. Everything works like a charm now 😄.

@chalin
Copy link
Collaborator

chalin commented Mar 28, 2022

@deining - could you resolve conflicts when you have a minute (we're getting closer to merging this :))

@deining
Copy link
Collaborator Author

deining commented Apr 2, 2022

@deining - could you resolve conflicts when you have a minute (we're getting closer to merging this :))

Conflicts are resolved, the site now builds fine while using docsy theme as hugo module. 😄

Copy link
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inlined question.

go.mod Outdated Show resolved Hide resolved
@LisaFC
Copy link
Collaborator

LisaFC commented Apr 4, 2022

This is ready to go, right?

@deining
Copy link
Collaborator Author

deining commented Apr 4, 2022

This is ready to go, right?

Yes.

Studying the deploy log I realized, that git submodules still get checked out. This doesn't do any harm, but it is not necessary either. Maybe this can be corrected? If so, I think we should open a separate ticket for this.

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 4, 2022

OK, so the build instruction on Netlify is currently:

cd themes/docsy && git submodule update -f --init && cd ../.. && hugo

So will automatically check out the submodules. With Hugo Modules will it just work by running hugo?

@chalin
Copy link
Collaborator

chalin commented Apr 4, 2022

+1 to cleaning up the Netlify build commands to avoid getting/updating submodules for nothing.

Comment on lines +7 to +8
github.com/google/docsy v0.1.1-0.20220321183617-02df04c0f2d4 // indirect
github.com/google/docsy/dependencies v0.2.0-pre.0.20220321183617-02df04c0f2d4 // indirect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deining - can you help me understand the version IDs here?

  • Why v0.1.1-* for docsy and v0.2.0-pre.* for docsy/dependencies?
  • Shouldn't both of these be 0.2.0-pre?
  • Is the v prefix to the module ID necessary?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still go ahead and merge this @LisaFC.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deining - can you help me understand the version IDs here?

* Why `v0.1.1-*` for `docsy` and `v0.2.0-pre.*` for `docsy/dependencies`?

The same question for me.

* Shouldn't both of these be 0.2.0-pre?

Yes, it should!

* Is the `v` prefix to the module ID necessary?

The v is not from me, it was auto-generated: All I did: on the command line, I entered hugo mod get github.com/google/docsy@0.2.0-pre, and go auto-magically converted this into v0.1.1-0.20220321183617-02df04c0f2d4. I don't like this either, but I left it as is.

I assume go expects something like x.x.x and gets somehow confused by the ´-pre´ suffix. As soon as we have 0.2.0 out, this is hopefully more consistent.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that the discussion in google/docsy#954 explains why the v prefix might be needed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks sense. Thanks for the explanation ✨

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a related question: how does one normally encode the ID of a Go module? That is, if my Go module m is meant to be at version x.y.z, when in the module's source files would I write / encode the ID? Or is that handled separately?

@chalin
Copy link
Collaborator

chalin commented Apr 4, 2022

@LisaFC - And yes, we can do the Netlify build command cleanup through another PR.

@deining
Copy link
Collaborator Author

deining commented Apr 4, 2022

OK, so the build instruction on Netlify is currently:

cd themes/docsy && git submodule update -f --init && cd ../.. && hugo

So will automatically check out the submodules. With Hugo Modules will it just work by running hugo?

Yes, I think so.

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 4, 2022

So @chalin are we ok to merge?

Copy link
Collaborator

@chalin chalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Do you want to merge or shall I do it?

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 4, 2022

If you do this one I'll merge the user guide one.

@chalin
Copy link
Collaborator

chalin commented Apr 4, 2022

we should open a separate ticket for this.

Done: #167

@chalin chalin merged commit c147c70 into google:master Apr 4, 2022
@chalin
Copy link
Collaborator

chalin commented Apr 4, 2022

If you do this one I'll merge the user guide one.

Done 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants