Hexo blog insert custom does not render the page

Hexo blog to their insert a page with its own style of writing.

Implementation

Hexo official shows two ways to insert custom page: First render to the specified file, display a custom form page specified in the subject area; the second is related to a file or folder is ignored, completely not render directly copyto publicfolder link.

Rendering section

The principle

To add a single file does not mark application template for dealing with individual special file.

Implementation

Add the following tags do not need to render articles or HTML file header:

---layout: false---

In this way, the file will not be rendered through the template, the final release to the /public/documents in the file is removed after marking the way.

Exclude files

The principle

Only sourcedirectory under the file will be posted to public(be able to access on the network), thus rendering Hexo only sourcefiles in the directory. skip_renderPath parameter is set with respect to sourcethe directory path.

Hexo profile provides a configuration item skip_renderis used for directories or files not needed for rendering excluded.

  1. Exclude individual files

    skip_render: 'test.html'
    
  2. Exclude multiple files

    skip_render:
      - '1.html'
      - '2.html'
    
  3. Regular expression match

    skip_render: '*.html'
    

    Note skip_renderthe matching folder source, it will exclude all sourcefiles in a folder at the end of the HTML, but does not match to a subdirectory.

  4. Excluding directories

    skip_render: 'demo/*'
    
  5. Exclude multiple directories

    skip_render:
      - 'test/*'
      - 'demo/*'
    
Released three original articles · won praise 0 · Views 26

Guess you like

Origin blog.csdn.net/weixin_42554305/article/details/104290637