首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Hyde生成新内容?

如何使用Hyde生成新内容?
EN

Stack Overflow用户
提问于 2012-01-08 07:12:38
回答 2查看 2.1K关注 0票数 11

我开始学习Hyde了,我从Github克隆了几个用Hyde写的博客。我可以在我的web浏览器中成功地生成这些示例博客,并在本地提供它们;但是,我似乎不知道如何实际生成新内容。例如,如何在HTML或markdown中添加新文件,然后将该文件提供给站点?我没有看到在docs中提到如何做到这一点。我遗漏了什么?我正在使用的示例博客的目录结构如下所示:

代码语言:javascript
复制
---content
    ---about
    ---blog  
---deploy
    ---about
    ---blog
---layout
   ---base.j2
   ---listing.j2
   ---posts.j2
---info.yaml
---site.yaml

谁能解释一下如何添加HTML或markdown文件并将其提供给用户?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-01-08 23:52:42

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

例如,如果您想要一篇包含以下url的博客文章:http://localhost:8080/blog/2012/01/05/a-new-post

您必须执行以下操作:

  1. 在内容文件夹下创建目录blog/2010/01/05
  2. 使用文本编辑器创建帖子
  3. 执行<代码>D10和<代码>D11操作时,将文件保存在您在步骤1
  4. 中创建的目录中-您将看到该文件显示在该url中<代码>H212<代码>G213
票数 10
EN

Stack Overflow用户

发布于 2012-02-03 08:48:48

我已经编写了一个名为Ghorg的项目,它提供了一个命令行实用程序,用于管理组织模式博客帖子的集合,将它们作为html发布到您的hyde站点,以及调用hyde生成和发布功能。这纯粹是一个方便的实用程序,因为您不再需要到站点存储库使用它。

我想,比方说,如果一些vim用户或者那些想要帖子管理而不是组织模式发布的人,也许想要markdown或其他东西(现在硬编码成只打开emacs) -如果这些人想让它更通用,那就太好了。

Ghorg: Org for Hyde

代码语言:javascript
复制
    dlacewell@scarf$ 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.        
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8773912

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档