TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hugo: A fast and modern static website engine

383 点作者 lnalx超过 8 年前

28 条评论

sfifs超过 8 年前
The main reason I like Hugo is almost all other engines require me to install an entire Ruby or JavaScript ecosystem of packages on machine just to be able to preview my blog post. I don't want to manage the dependency hell when I don't have to.
评论 #12675908 未加载
评论 #12676487 未加载
eberkund超过 8 年前
Why should I switch to this from Jekyll. There are dozens of site generators and when I go to their websites they all hash over the same set of features. Can anyone has used both or any other site generators please let me know what you found the differences to be?
评论 #12673949 未加载
评论 #12674002 未加载
评论 #12674055 未加载
评论 #12674111 未加载
评论 #12674315 未加载
评论 #12677427 未加载
评论 #12676168 未加载
评论 #12675191 未加载
评论 #12674417 未加载
评论 #12673935 未加载
评论 #12675256 未加载
评论 #12675521 未加载
评论 #12674419 未加载
justajot超过 8 年前
I&#x27;ve built two client sites with Hugo recently with great success: <a href="https:&#x2F;&#x2F;www.halorestorationservices.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.halorestorationservices.com&#x2F;</a> and <a href="http:&#x2F;&#x2F;www.laviagelaw.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.laviagelaw.com&#x2F;</a>. Both are fairly extensive in their use of templates and Hugo&#x27;s features.<p>That said, I typically grab from site templates and don&#x27;t do a lot of css&#x2F;js manipulation myself. Though, if I did, I&#x27;d just set-up Grunt or Gulp to handle automatic regeneration of the final asset files.<p>For those asking why should you switch? Well, exactly, why should you? If you are happy with your current toolset and are productive using it, isn&#x27;t it all about the final product anyway? Who cares what you use. But if you aren&#x27;t happy with your toolset, or are just keeping an eye out for something that might be better ...<p>Hugo is known most for its speed. If you have a site with many, many pages that needs to be built quickly, strongly consider Hugo. It really is super fast. I&#x27;m actually considering building out a very large sample site with various engines to demonstrate just how fast it is. I&#x27;ll try to find this post on Hacker News again and post if I ever get around to it.<p>Layout of content is extremely nice in Hugo. Basically, you just organize everything in directories how you want it to be rendered in the end. This can be overridden if necessary.<p>Documentation is also really nice. I&#x27;m actually about to build another client site and considered using Jekyll (you know, just to see), but found the documentation lacking compared to Hugo. It also seems to needlessly complicate things, but that&#x27;s probably just personal opinion based on prior experience with Hugo.<p>There are a few downsides obviously. You get what you get, unless you want to add functionality and recompile. But now you have to maintain your own version.<p>As parent5446 mentioned, variables can be a bit confusing. They are not as idiot proof as I&#x27;d like them to be.
评论 #12675563 未加载
评论 #12674139 未加载
评论 #12697032 未加载
评论 #12675531 未加载
评论 #12676158 未加载
unsignedint超过 8 年前
I love Hugo! I have been hosting <a href="https:&#x2F;&#x2F;hidekisaito.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hidekisaito.com&#x2F;</a> and its .onion counterpart <a href="http:&#x2F;&#x2F;hideki24bd6yof6s.onion&#x2F;" rel="nofollow">http:&#x2F;&#x2F;hideki24bd6yof6s.onion&#x2F;</a> using Hugo, it&#x27;s very easy way to get the page up and running. I use Visual Studio Code to write the contents in markdown, and I got task runner that configured to run Hugo and then rsync them to the servers.
michalskop超过 8 年前
Is using Hugo suitable even for non-tech people? I have worked with several systems during last years (Wordpress, Drupal, custom apps, several wikis), but I am still not happy with them, because of missing combination &quot;easy to maintain&quot; and &quot;easy to use by non-tech people (when installed)&quot;. In my experience, non-tech people can use markdown (if properly motivated) at most and can log in into a system, but that is. Is Hugo going to help here?
评论 #12675648 未加载
评论 #12675520 未加载
评论 #12674365 未加载
评论 #12676252 未加载
评论 #12675583 未加载
bobfunk超过 8 年前
For those wondering what to do with an asset pipeline, check out Victor Hugo (<a href="https:&#x2F;&#x2F;github.com&#x2F;netlify&#x2F;victor-hugo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;netlify&#x2F;victor-hugo</a>), a boilerplate for using gulp and webpack too manage the asset pipeline around a hugo based project.
sandstrom超过 8 年前
There is a growing trend of static websites.<p>My favorite tool for static websites is Middleman (<a href="https:&#x2F;&#x2F;middlemanapp.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;middlemanapp.com&#x2F;</a>), but competition is always good.
qwertyuiop924超过 8 年前
But why this over another site generator? Metalsmith has total flexability, Lektor has a web UI for those who dislike writing in plain text, Jekyll has simplicity... Hugo doesn&#x27;t really seem to have any advantages.
评论 #12673807 未加载
评论 #12673660 未加载
greencurry43超过 8 年前
I think one the biggest draws of something like Hugo would be that it&#x27;s amazingly fast. You can check out the video [0] here that shows a benchmark. It generates 5,000 pages in around 6-7.<p>Another is that it&#x27;s a single file to deal with. This may be different when you get into making your own themes, but to get going you just need to download the single file for your platform.<p>[0]: <a href="https:&#x2F;&#x2F;gohugo.io&#x2F;overview&#x2F;introduction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gohugo.io&#x2F;overview&#x2F;introduction&#x2F;</a>
评论 #12674000 未加载
nickthemagicman超过 8 年前
I tried out, Jekyll, Hugo and neither one met my needs.<p>I found middleman to be the most powerful static site generator.
评论 #12682996 未加载
评论 #12674795 未加载
joneholland超过 8 年前
I tried Hugo on a quick prototype for a API documentation site, but quickly ran into limitations in the go template engine and how Hugo handles variables.<p>It&#x27;s great for a simple static site, but without a way to extend the template engine easily, there was no way to do what we wanted (which was to style a yaml file of service metadata into a swagger like UI).
评论 #12682941 未加载
评论 #12675570 未加载
shapeshed超过 8 年前
I switched from Jekyll -&gt; own rolled Node.js generator -&gt; Hugo.<p>For me it is better because of simplicity and speed. I use it to power a 400 page blog (<a href="https:&#x2F;&#x2F;shapeshed.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shapeshed.com&#x2F;</a>) with this source code (<a href="https:&#x2F;&#x2F;github.com&#x2F;shapeshed&#x2F;shapeshed.com" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shapeshed&#x2F;shapeshed.com</a>).<p>I used Jekyll in a small organisation and it meant everyone needed a working Ruby environment This caused much pain across platforms. Hugo ships a single binary for multiple platforms so setup is far simpler. It is also amazingly fast and there have been major performance improvements in 0.17 too (<a href="https:&#x2F;&#x2F;gohugo.io&#x2F;meta&#x2F;release-notes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gohugo.io&#x2F;meta&#x2F;release-notes&#x2F;</a>).<p>I love it!
parent5446超过 8 年前
Maybe Hugo has improved, but when I switched our static website from Jekyll over to Hugo, there was a lot to be wished for.<p>One of the problems is that it&#x27;s not easy to integrate Hugo into any other build process. For better or worse, many website build tools right now are in JavaScript (npm, bower, gulp, grunt, yo, etc.). And on the flip side, Hugo does not do any static resource processing. So for our site, we needed to have Grunt tasks fetch third-party libraries, compile the JS and CSS, perform lint checks, and finally put files into the correct location so that Hugo could then be called to build the final site. Now, to be fair, Jekyll core does not do any of this for you either, but at least there are plugins in Jekyll [0], and integration of custom build scripts becomes a bit smoother.<p>This brings me to my second pain, which is shortcodes [1]. It is the closest Hugo has to plugins. Hugo completely disallows writing raw HTML in Markdown content (the cited reason is it &quot;is in complete opposition to the intent of using a bare-bones format for our content and utilizing templates to apply styling for display&quot;). It makes sense, and I&#x27;d use a system that separates raw content from more complicated code. But when you start needing to put dynamic content in your site, shortcodes in Hugo specifically are extremely unflexible. You&#x27;re stuck using the Go template library that underlies Hugo, which gives you very limited information about the page being rendered.<p>Local variables, for example, are not scoped the way you think they are, and you are stuck with a &quot;scratchpad&quot; hack that Hugo put in [2]. To see this in action, here is code I had to write to make a shortcode for responsive images [3]. The entire process involved starting with a JSON file containing the shared configuration, having Grunt read this config to generate the images, and then using the code in [3] to also read from that file and find where the images would be. This is all without syntax highlighting or any useful debugging tools.<p>There are also just some times you really need HTML in your Markdown, and it doesn&#x27;t make sense to use a shortcode. For example, a web page that contains very specific formatting that cannot be expressed in Markdown, but is also specific enough to that page to not be separated from the page&#x27;s content.<p>All in all, we switched to Hugo for a reason: it had many features that Jekyll was missing at the time (although many it has since added). We wanted to express our website in a well-structured format that also allowed Markdown so not-especially-tech-savvy people could edit content. In the end, we got it working (here&#x27;s the site, a good example of how a Hugo site can come out pretty great IMO [4]), but it caused a whole lot of pain and misery for me.<p>[0] <a href="https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;plugins&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;plugins&#x2F;</a> [1] <a href="https:&#x2F;&#x2F;gohugo.io&#x2F;extras&#x2F;shortcodes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gohugo.io&#x2F;extras&#x2F;shortcodes&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;discuss.gohugo.io&#x2F;t&#x2F;counter-variables-and-template-scope&#x2F;382" rel="nofollow">https:&#x2F;&#x2F;discuss.gohugo.io&#x2F;t&#x2F;counter-variables-and-template-s...</a> [3] <a href="http:&#x2F;&#x2F;pastebin.com&#x2F;ZjiWpDHc" rel="nofollow">http:&#x2F;&#x2F;pastebin.com&#x2F;ZjiWpDHc</a> [4] <a href="https:&#x2F;&#x2F;www.castlepointanime.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.castlepointanime.com&#x2F;</a>
评论 #12674084 未加载
评论 #12676785 未加载
devin超过 8 年前
I doubt this opinion is fashionable, but I prefer simple. HTML or bust.
评论 #12678767 未加载
kaushalmodi超过 8 年前
I started developing my blog using Octropress (Jekyll derivative) many years back. I painfully installed it the first time (Ruby dependencies). I tried upgrading to Octopress 2.0 probably 2 years back, but I was never successfully able to install all the dependencies on my work machine. More than that, I never got it working on multiple platforms. I wished to be able to post to my blog from both home (Windows) and work (RHEL6.6), but that just wasn&#x27;t possible.<p>Hugo was a breath of fresh air:<p>- Easy to install (auto-installs all the dependent go packages without a hitch, and results in a single static binary!)<p>- Easy to set up a web page (hardly took 10 minutes)<p>Having the basic web site building going, I can now tinker as I like with the layouts, config.toml, etc. Hugo has allowed me to focus more on my web site content and design than burning time figuring out how to successfully install (and keep upgraded) the web site building. (All I need to do to update hugo to the latest and greatest is: &quot;go get -u -v github.com&#x2F;spf13&#x2F;hugo&quot;).
chewxy超过 8 年前
I was surprised that I had a already-visited link on HN. This weekend I was trying to migrate my wordpress blog to Hugo... to no avail. The plugins mentioned all killed my Wordpress, so now I&#x27;m stuck transcribing my posts one by one by hand. Anyone knows of a good exporter for WP that keeps the footnotes&#x2F;ref and doesn&#x27;t kill WP?
评论 #12674552 未加载
smagch超过 8 年前
Docker documentation recently moved away from Hugo in favor of Jekyll.<p><a href="https:&#x2F;&#x2F;blog.docker.com&#x2F;2016&#x2F;09&#x2F;announcing-new-docs-repo-github&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.docker.com&#x2F;2016&#x2F;09&#x2F;announcing-new-docs-repo-git...</a><p>In the blog article above, they mentioned a problem they faced.<p>&gt; The docs were built around Hugo, which is not natively supported by GitHub, and took minutes to build, and even longer for us to deploy.<p>I&#x27;ve been using Middleman for static site for a couple of years. I&#x27;m thinking about moving to Hugo because I read HN comments Hugo is much faster than other alternatives. But reading the official Docker blog, I&#x27;m thinking twice.<p>Could anyone tell me the reason why Docker blog took too much time to build with Hugo that is supposed to build really fast?
评论 #12676028 未加载
pmlnr超过 8 年前
I tried out dozens of generators; for plain, simple, mostly text blogs, Hugo is fine. And Pelican, and Jekyll, and nearly all.<p>Hugo falls short when it comes to custom needs, like EXIF handling, or intermediate image downsizing for responsive images, because adding features to Hugo is painful.
评论 #12676626 未加载
评论 #12676631 未加载
bjornerik超过 8 年前
Steve Francia has written a nice blog article about the recent Hugo 0.17 release: <a href="http:&#x2F;&#x2F;spf13.com&#x2F;post&#x2F;hugo-goes-global&#x2F;" rel="nofollow">http:&#x2F;&#x2F;spf13.com&#x2F;post&#x2F;hugo-goes-global&#x2F;</a>
评论 #12674398 未加载
sohkamyung超过 8 年前
The Taxonomy section of Hugo sounds interesting [1]. I&#x27;ve been putting up my personal comments and reviews of stories in book anthologies and magazines via Goodreads. I also put up reviews of individual books on Goodreads. I would love to be able to organise what I&#x27;ve written in a static website via categories like story title, author, magazine&#x2F;anthology appearances, etc. and this looks like the way to do it.<p>- [1] <a href="https:&#x2F;&#x2F;gohugo.io&#x2F;taxonomies&#x2F;overview&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gohugo.io&#x2F;taxonomies&#x2F;overview&#x2F;</a>
brusch64超过 8 年前
Is this a viable alternative to Hyde (the python static site generator) ?<p>I was using this instead of Jekyll for a hardly updated website and I can&#x27;t get it running on Arch linux (without putting too much effort into it). The whole system looks pretty dated and dead too (I think the upstream URL doesn&#x27;t even work any more).<p>I would be really happy to get a &quot;set and forget&quot; solution, so I can update the site 3 times in a year and don&#x27;t have to worry about the system.<p>Is Hugo stable enough for something like that ? Is the Jekyll Docker image the better solution for this ?
评论 #12676786 未加载
nzjrs超过 8 年前
Is it modern because it&#x27;s written in Go, or am I missing something?
评论 #12673612 未加载
madmax108超过 8 年前
I use Hugo for a Deep learning blog I just started writing (<a href="http:&#x2F;&#x2F;navinpai.github.io&#x2F;ga" rel="nofollow">http:&#x2F;&#x2F;navinpai.github.io&#x2F;ga</a>) as a self reference.<p>The main reasons I like hugo:<p>- The single binary (which others have mentioned)<p>- The theme support (Somehow, Hugo themes are well designed as opposed to Pelican themes which seem more thrown together)<p>- The folder structuring is very intuitive<p>All in all would definitely recommend
评论 #12675851 未加载
jonathonf超过 8 年前
Some previous discussion:<p>* <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10646508" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10646508</a><p>* <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10627585" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10627585</a><p>Strangely I can&#x27;t find any posted story for the 0.16 release...
abhv超过 8 年前
I am a hugo user, but I noticed that it has been slower and slower. I ran a --stepAnalysis, and it shows that the most expensive step is<p>Started building sites ... Go initialization: 5.722103073s (5.722526117s) 2.66 MB 22083 Allocs<p>The rest of the steps take 115ms. What is happening in go init, and why does it take so long?
评论 #12677734 未加载
rhabarba超过 8 年前
The only thing that is said to make Hugo better than other static site generators is that it compiles fast. This is probably because of Go. Now Go is so fast because it uses ALGOL&#x27;s compiling methods...<p>I wonder how fast Hugo would be if it was written in Pascal instead.
评论 #12679500 未加载
wtbob超过 8 年前
Weird that their header over &#x27;Run Anywhere&#x27; reads &#x27;S Q R.&#x27; Is it perhaps a mis-spelt allusion to the senate and people of Rome?
评论 #12674997 未加载
jsherman76超过 8 年前
so after going to your landing page, I&#x27;m still unsure of what I get from Hugo? I use bootstrap to build my websites. How does Hugo work exactly?
评论 #12673455 未加载
评论 #12673475 未加载
评论 #12673144 未加载