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

Use Hugo pipes to process assets #134

Merged
merged 6 commits into from Oct 30, 2018

Conversation

Projects
None yet
3 participants
@xianmin
Owner

xianmin commented Oct 25, 2018

  1. The purpose of this PR is to simplify the development process of hugo-theme-jane.
  2. Now, we don't need node or npm.

Related issue: #103

Useful doc: Hugo Pipes Overview | Hugo

Notice:

You need the Hugo Extended version installed. If you run hugo version it should contain the string “extended”:

deepinscreenshot_select-area_20181025171129

@xianmin xianmin requested review from shaform and Zebradil Oct 25, 2018

@shaform

This comment has been minimized.

Collaborator

shaform commented Oct 25, 2018

So if one doesn't modify sass files, is he still required to use the extended version?

@xianmin

This comment has been minimized.

Owner

xianmin commented Oct 26, 2018

@shaform Yes, he still required to use extended version . This is a problem. Maybe we don't need to use Hugo Pipes.

@shaform

This comment has been minimized.

Collaborator

shaform commented Oct 26, 2018

How about this https://twitter.com/GoHugoIO/status/1016706519507881986.
Of course there are drawbacks committing the resources directory, but jane was already doing this anyway before this PR.

@xianmin

This comment has been minimized.

Owner

xianmin commented Oct 28, 2018

Thank you for the information provided!
It's my mistake. If we commit the resources/ dir, normal Hugo version is available. Great! 😄

@@ -0,0 +1,296 @@
{{/* This file should be optimized */}}

This comment has been minimized.

@shaform

shaform Oct 28, 2018

Collaborator

Why are inline svgs required? Isn't it possible to embed external *.svg files?

This comment has been minimized.

@maddovr

maddovr Oct 29, 2018

Inline vs external .svg file is basically a performance battle. Inline SVGs are handy for a number of reasons (you can use css to style them etc...) and you need fewer HTTP requests, so the website will be faster on first load, however inline svg cannot be cached and that means it might slow down the website if there are a lot of them. The general consensus about it is: if there are less than 15 SVGs it's best to inline them, if there are more, external files are preferred.

This comment has been minimized.

@shaform

shaform Oct 30, 2018

Collaborator

Okay, I see

@shaform

LGTM

@xianmin xianmin changed the base branch from master to develop Oct 30, 2018

@xianmin xianmin merged commit 8a1f701 into develop Oct 30, 2018

@xianmin

This comment has been minimized.

Owner

xianmin commented Oct 30, 2018

Thank you guys!
I have merged this PR to develop branch temporarily.

I refer to gohugoioTheme code:
https://github.com/gohugoio/gohugoioTheme/blob/69018d07deabd78830fc03f50bdda2b741e70af5/layouts/partials/home-page-sections/open-source-involvement.html#L20

Now there is a better way to embed external *.svg files, but it is inline svg.

@shaform

This comment has been minimized.

Collaborator

shaform commented Nov 14, 2018

I found that because Hugo pipe changes filenames of the assets for each version, and Google cache does not cache css files, the styles for cached page on Google is corrupted. But not sure whether this is something worth worrying about or whether it's possible to fix it.

@xianmin

This comment has been minimized.

Owner

xianmin commented Nov 16, 2018

Thanks for the feedback, I will pay attention to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment