[Fix] Refactor program for post and page
Closed this issue · 3 comments
zhonger commented
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
zhonger commented
The logic of template files in _layouts
:
- default.html
- page.html
- archives.html
- categories.html
- links.html
- post.html
- tags.html
- page.html
- blog.html
- search.html (search.json)
- cv.html
- rss.xml
- sw.js
- manifest.html (manifest.json)
- stats.html (stats.json)
zhonger commented
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 %}