zhonger/jekyll-theme-H2O-ac

[Fix] Refactor program for post and page

Closed this issue · 3 comments

Purpose

Make the structure of files more readable and easily maintained or updated.

Possible Solution

Here is one image in my mind:

jekyll-theme-h2o-ac/
├── _includes/
│   ├── layouts/
│   │   ├── head.html
│   │   ├── header.html
│   │   ├── footer.html
│   │   ├── paginate.html
│   │   ├── pageNav.html
│   │   ├── paginate-article.html
│   │   └── sidebar.html
│   └── plugins/
│       ├── comments/
│       │   ├── disqus.html
│       │   ├── waline.html
│       │   └── ...
│       ├── analytics/
│       │   ├── umami.html
│       │   ├── google.html
│       │   ├── baidu.html
│       │   ├── cnzz.html
│       │   ├── busuanzi.html
│       │   └── ...
│       ├── search/
│       │   ├── native.html
│       │   └── ...
│       ├── markdown/
│       │   ├── mermaid.html
│       │   ├── prism.html
│       │   └── mathjax.html
│       ├── calendar.html
│       ├── toc.html
│       ├── submenu.html
│       ├── pwa.html
│       └── webpushr.html
└── _layouts/
    ├── default.html
    ├── post.html
    ├── page.html
    ├── stats.html
    ├── cv.html
    ├── mainfest.html
    ├── sw.js
    ├── blog.html
    ├── links.html
    ├── rss.xml
    └── tags.html

The logic of template files in _layouts:

  • default.html
    • page.html
      • archives.html
      • categories.html
      • links.html
    • post.html
    • tags.html
  • blog.html
  • search.html (search.json)
  • cv.html
  • rss.xml
  • sw.js
  • manifest.html (manifest.json)
  • stats.html (stats.json)

Make all things as small as possible with capture like below:

{% capture download_note %}
The latest version of {{ site.product_name }} is now available.
{% endcapture %}
{% include note.html content=download_note %}

[1] https://jekyllrb.com/docs/includes/