2012-01-07 87 views
11

我开始学习Hyde,我克隆了一些Github在海德写的博客。我可以在我的Web浏览器中成功生成这些示例博客并在本地提供这些示例博客;然而,我似乎无法弄清楚如何实际生成新的内容。例如,如何以HTML或标记方式添加新文件,然后将文件提供给网站?我看不到在docs中如何做到这一点。我错过了什么?的我和看起来像这样的工作样品博客的目录结构:如何使用Hyde生成新内容?

---content 
    ---about 
    ---blog 
---deploy 
    ---about 
    ---blog 
---layout 
    ---base.j2 
    ---listing.j2 
    ---posts.j2 
---info.yaml 
---site.yaml 

谁能解释如何添加HTML或降价的文件,并让他们提供服务?

回答

10

Hyde没有创建新文件的命令。您可以在您最喜爱的编辑器中创建该文件并将其保存在正确的目录中。

例如,如果你想有一个博客帖子这个网址: http://localhost:8080/blog/2012/01/05/a-new-post

你必须做到以下几点:

  1. 内容文件夹
  2. 使用文本下新建一个目录blog/2010/01/05编辑器创建您的帖子
  3. 将文件保存在您在步骤1中创建的目录中
  4. 当您执行hyde genhyde serve - 你会看到该文件在URL
+0

非常感谢你的答案和你的海德所有的工作! – drbunsen 2012-01-08 22:26:06

3

我已经写了一个名为Ghorg项目,该项目提供了一个命令行工具,用于管理组织模式的博客文章的集合,发布为html现身你的海德网站,并调用hyde世代和发布功能。这纯粹是一种便利的实用工具,因为您不再需要访问您的网站存储库来使用它。

我想如果有些vim用户或者想要后期管理但不是org-mode发布,但也许是降价或其他的东西(现在它的硬编码只是打开emacs) - 如果那些人想要帮助使这个更通用,然后很好。

Ghorg: Org for Hyde

[email protected]$ ghorg -h 
    usage: ghorg [-h] [-b] [-p] [-s SITE] [--config CONFIG] [-l] [-n [N]] [-P] 
       [-U] [-e] [-t TEMPLATE] [-D] 
       [title [title ...]] 

    Manage your Ghorg blog. 

    positional arguments: 
     title     all arguments will be joined with hyphen for filename 
          `ghorg post title' => `2012-01-12-post-title.org' 

    optional arguments: 
     h, --help   show this help message and exit 
     b, --build   Perform configured Hyde build step. 
     p, --publish   Perform configured Hyde publishing step. (implies -b/--  build) 
     s SITE, --site SITE Path to the root of the Hyde site. 
     config CONFIG  Filename of Hyde configuration for building. 
     l, --list   List previous posts (-n to change count). 
     n [N]    Change number of posts listed (default:5). 
     P     Set post as published. 
     U     Set post as unpublished. 
     e     Mix with -P/-U to edit while changing publishing 
          status. 
     t TEMPLATE   Location of template for new posts. 
     D     Delete existing post.