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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

From Jekyll to Hugo: my experience as a noob in web development

3 点作者 giuliomagnifico10 个月前

2 条评论

biohazard210 个月前
&gt; So, I decided to create a redirect on Nginx for each old URL, pointing to the new one. It was quite frustrating to write all those redirects…<p>You can use a regular expression to write a single redirect for all the posts. Something like the following could do the trick:<p><pre><code> location ~ ^&#x2F;(home|networking|misc|tips)&#x2F;(\d{4})&#x2F;(\d{2})&#x2F;(\d{2})&#x2F;([a-zA-Z0-9-_]+)\.html { return 301 https:&#x2F;&#x2F;giuliomagnifico.blog&#x2F;post&#x2F;$2-$3-$4-$5&#x2F;; }</code></pre>
评论 #41159972 未加载
Tomte10 个月前
What is &quot;with Hugo you make changes only inside the folder of your current theme, and then by recompiling the site, the changes are “executed” on the folders and files inside the public part of the site&quot; supposed to mean?<p>In both Jekyll and Hugo your templates are separate from your posts.<p>And before switching static site generators because &quot;the structure of the URLs linking to each article is much simpler and more convenient&quot;, maybe read the documentation: <a href="https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;permalinks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;permalinks&#x2F;</a><p>You can have the exact same URL scheme in Jekyll.
评论 #41159746 未加载