zhonger / jekyll-theme-H2O-ac

🎉 A Jekyll theme for researchers and maintainers based on H2O theme.
https://h2o-ac.lisz.me
MIT License
36 stars 25 forks source link

[Fix] Refactor program for post and page #21

Closed zhonger closed 3 months ago

zhonger commented 3 months ago

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 3 months ago

The logic of template files in _layouts:

zhonger commented 3 months ago

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/

zhonger commented 3 months ago

98f71b95286e401b7a0b4278f909f2c0ebdcb55c