How to move from Hugo to pure go?

agolangf · · 432 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve been using Hugo to build a site that I&#39;m working on, but am having to bend over backwards to make things work in Hugo. Unfortunately there is very little documentation for adding any complexity beyond a simple blog page (for example multiple nested menus)-- it seems like basic blogs were the only use case envisioned by the developers. </p> <p>I&#39;ve seen several comments on here recommend starting from the html/template library, and that sounds great except I don&#39;t know a whole lot of go beyond &#34;Hello, World&#34; and that almost feels like it&#39;d be taking ten steps back at this point. </p> <p>To get to the point-- Working with Hugo has made me really like the idea of building a static site. I work with a guy that has a TON of experience working with big data, and we ended up developing a database to organize and then generate all the different markdown files for the site. If we do decide to move away from Hugo, how would we go about making that database usable? (To be clear, we don&#39;t want to actually put the db on a server, we just want to use it as a way to organize all the content before compiling a static site.) Sorry to have rambled on, but if anyone has any advice for me I would really appreciate it. </p> <hr/>**评论:**<br/><br/>egonelbre: <pre><p>What kind of website do you want to create? Can you give the link to the current site? Any other site that has a similar structure? What does the DB contain?</p> <p>It&#39;s hard to recommend anything useful without knowing anything about the project. Here&#39;s the basic principle <a href="https://play.golang.org/p/gFDz-bDtSy" rel="nofollow">https://play.golang.org/p/gFDz-bDtSy</a></p></pre>federalfarmer7: <pre><p>It&#39;s a website for our buddy&#39;s real estate company. <a href="http://www.tamborrel.com/" rel="nofollow">Here</a> is a similar example. The db contains each line of markdown that is necessary for Hugo to build it correctly. </p> <p>So for the example site that I linked there would be a folder for the menu item &#34;buying&#34; that contained a markdown file for each of the links in the drop down menu. And each home under /buying/featured-listings would have its own markdown file. So the content folder of the site would look something like this:</p> <p>.</p> <pre><code>|-content |-Property Search |-Explore |-Buying |-search-for-homes.md |-featured-listings.md |-house1.md |-house2.md |-Selling |-... </code></pre> <p>THANK YOU for your help btw</p></pre>FIuffyRabbit: <pre><p>Why even use a database? Just put them in files and run a hugo server. Plus you can create your own layouts if you know html. </p> <p>This isn&#39;t even a hugo problem. More of a problem of not understanding how templates work.</p></pre>mwholt: <pre><p>Are you just looking for a way to serve static files (specifically Markdown)?</p></pre>elithrar_: <pre><p>Have you tried asking on the Hugo repository/chat? Re-writing this all to achieve a nested menu seems a little crazy; Hugo can definitely achieve that. </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

432 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传