Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make post description customizable #1602

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

kungfux
Copy link
Collaborator

@kungfux kungfux commented Mar 10, 2024

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description

I would like to have control over the post summary that appears on the Home page, in the Further Reading section, and in the RSS feed instead of the auto-generated one that is not always great for this purpose.

ref #1596
ref #1516

BREAKING CHANGE

A similar feature summary already exists and is used for RSS feed summary exclusively. However, it's support is removed with this PR and replaced by description.

Renderings

  • Homepage
    Screenshot 2024-03-18 at 18 40 43

  • Posts page
    Screenshot 2024-03-18 at 18 41 11

@kungfux kungfux changed the title feat: add post summary field feat: make post summary customizable Mar 10, 2024
Copy link
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice feature, thank you @kungfux!

I think using a description field would be a better choice because the plugin jekyll-seo-tag recognizes the page.description instead of page.summary.

@kungfux kungfux changed the title feat: make post summary customizable feat: make post description customizable Mar 15, 2024
@kungfux
Copy link
Collaborator Author

kungfux commented Mar 15, 2024

I think using a description field would be a better choice because the plugin jekyll-seo-tag recognizes the page.description instead of page.summary.

I see. It's a good point. Thanks @cotes2020

I have updated PR accordingly.

To avoid breaking changes, the support of summary field remains in place and will be utilized for RSS feed exclusively when defined.

@cotes2020
Copy link
Owner

Until 7.0.0 is released, feel free to submit breaking changes, the page.summary is simply defined according to the atom feed tag <summary>.

@kungfux
Copy link
Collaborator Author

kungfux commented Mar 15, 2024

Until 7.0.0 is released, feel free to submit breaking changes, the page.summary is simply defined according to the atom feed tag <summary>.

Ok, I have removed support of summary field to unify behavior across multiple places and marked PR with breaking changes "just in case".

Copy link
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I've done some refactoring that

  • Fixed the formatting
  • Changed the word limit (max_length)
  • Show the page.description under the post title

If you have any ideas, feel free to leave a comment.

@kungfux
Copy link
Collaborator Author

kungfux commented Mar 17, 2024

Fixed the formatting

Not sure why there are differences between our dev environments as Prettier is configured on my end and it makes changes that you revert.

Changed the word limit (max_length)

I think it might be a good idea to make limit customizable for RSS feed from _config.yml (could be a separate PR). If you don't force people to visit your blog, limiting it to 400 characters kills the idea of using reader applications.

Show the page.description under the post title

This makes a lot of sense 👍

@cotes2020
Copy link
Owner

Formatting issues

I use VSCode, and the basic configuration is in .vscode. The extension Shopify.theme-check-vscode deletes a blank line immediately after the front-matter when formatting, so to avoid this, my trick is to edit the file with two blank lines at the bottom of the second --- of the front-matter, so that the auto-formatting will leave only one blank line.

Word limit for posts in RSS feed

I think it might be a good idea to make limit customizable for RSS feed from _config.yml (could be a separate PR). If you don't force people to visit your blog, limiting it to 400 characters kills the idea of using reader applications.

According to Atom's definition of <summary>, its content is excerpted text, not the complete content. So I don't think it's appropriate to use a length of 1000, and there's also no need to customize the length of the <summary> in _config.yml.

@kungfux
Copy link
Collaborator Author

kungfux commented Mar 17, 2024

Formatting issues

I see where the problem is. If we want to force Shopify.theme-check-vscode to follow this formatting, then we may need to build custom rule, it seems.

Word limit for posts in RSS feed

Thanks for insights @cotes2020. You're right. I have to work with the content field and it is a matter of RSS reader to support the format and display the content followed by content.src. We are good here for now.

Copy link
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's it :)

@cotes2020 cotes2020 merged commit f865336 into cotes2020:master Mar 18, 2024
6 checks passed
@kungfux kungfux deleted the feature/post-summary branch March 18, 2024 14:12
@dineshkoravi
Copy link

Hi @kungfux
are the changes merged ? i can see the code updated in master, but changes are not visible in demo page. This is a neat feature and would like to check this. I have my site with latest version and not able to use this feature. can you help please ?

@kungfux
Copy link
Collaborator Author

kungfux commented Apr 30, 2024

Hi @kungfux
are the changes merged ? i can see the code updated in master, but changes are not visible in demo page. This is a neat feature and would like to check this. I have my site with latest version and not able to use this feature. can you help please ?

Hey @dineshkoravi
The feature is merged but not released yet. I wait for it as well 🤞

github-actions bot pushed a commit that referenced this pull request May 11, 2024
## [7.0.0](v6.5.5...v7.0.0) (2024-05-11)

### ⚠ BREAKING CHANGES

* optimize the resource hints (#1717)
* rename media-url file and related parameters (#1651)
* rename comment setting parameter (#1563)
* **analytics:** add post pageviews for GoatCounter (#1543)

### Features

* add cloudflare web analytics ([#1723](#1723)) ([c17fba4](c17fba4))
* add support for embed video files ([#1558](#1558)) ([9592146](9592146))
* add support for giscus strict title matching ([#1614](#1614)) ([700fd5b](700fd5b))
* **analytics:** add post pageviews for GoatCounter ([#1543](#1543)) ([b641b3f](b641b3f))
* **analytics:** add Umami and Matomo tracking codes ([#1658](#1658)) ([61bdca2](61bdca2))
* change site verification settings ([#1561](#1561)) ([e436387](e436387))
* **deps:** move `MathJax` configuration to a separate file ([#1670](#1670)) ([44f552c](44f552c))
* display theme version in footer ([#1611](#1611)) ([8349314](8349314))
* **i18n:** allow `page.lang` to override `site.lang` ([#1586](#1586)) ([547b95c](547b95c))
* make post description customizable ([#1602](#1602)) ([f865336](f865336))
* **media:** support audio and video tag with multi sources ([#1618](#1618)) ([23be416](23be416))

### Bug Fixes

* make TOC title and entries visible at the same time ([#1711](#1711)) ([e0950fc](e0950fc))
* mode toggle not outlined when receiving keyboard focus ([#1690](#1690)) ([cd37f63](cd37f63))
* prevent footnote back arrow from becoming an emoji ([#1716](#1716)) ([8608147](8608147))
* **pwa:** skip range requests in service worker ([#1672](#1672)) ([76d58fe](76d58fe))
* search result prompt is empty ([#1583](#1583)) ([8a2afae](8a2afae))
* use `https` for Weibo sharing URL ([#1612](#1612)) ([8e5fbb7](8e5fbb7))

### Improvements

* improve <hr> visibility in dark mode ([#1565](#1565)) ([4ddd5c4](4ddd5c4))
* lean bootstrap javascript ([#1734](#1734)) ([ddb48ed](ddb48ed))
* rename comment setting parameter ([#1563](#1563)) ([f8390d4](f8390d4))
* replace jQuery with Vanilla JS ([#1681](#1681)) ([fe7afa3](fe7afa3))
* simplify mode toggle script ([#1692](#1692)) ([d4a6d64](d4a6d64))
* tree shaking Bootstrap CSS ([#1736](#1736)) ([363a3d9](363a3d9))

### Changes

* optimize the resource hints ([#1717](#1717)) ([dcb0add](dcb0add))
* rename media-url file and related parameters ([#1651](#1651)) ([9f8aeaa](9f8aeaa))
Copy link

🎉 This PR is included in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

kimbob13 pushed a commit to kimbob13/kimbob13.github.io that referenced this pull request May 25, 2024
---------

Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
kimbob13 pushed a commit to kimbob13/kimbob13.github.io that referenced this pull request May 25, 2024
## [7.0.0](cotes2020/jekyll-theme-chirpy@v6.5.5...v7.0.0) (2024-05-11)

### ⚠ BREAKING CHANGES

* optimize the resource hints (cotes2020#1717)
* rename media-url file and related parameters (cotes2020#1651)
* rename comment setting parameter (cotes2020#1563)
* **analytics:** add post pageviews for GoatCounter (cotes2020#1543)

### Features

* add cloudflare web analytics ([cotes2020#1723](cotes2020#1723)) ([c17fba4](cotes2020@c17fba4))
* add support for embed video files ([cotes2020#1558](cotes2020#1558)) ([9592146](cotes2020@9592146))
* add support for giscus strict title matching ([cotes2020#1614](cotes2020#1614)) ([700fd5b](cotes2020@700fd5b))
* **analytics:** add post pageviews for GoatCounter ([cotes2020#1543](cotes2020#1543)) ([b641b3f](cotes2020@b641b3f))
* **analytics:** add Umami and Matomo tracking codes ([cotes2020#1658](cotes2020#1658)) ([61bdca2](cotes2020@61bdca2))
* change site verification settings ([cotes2020#1561](cotes2020#1561)) ([e436387](cotes2020@e436387))
* **deps:** move `MathJax` configuration to a separate file ([cotes2020#1670](cotes2020#1670)) ([44f552c](cotes2020@44f552c))
* display theme version in footer ([cotes2020#1611](cotes2020#1611)) ([8349314](cotes2020@8349314))
* **i18n:** allow `page.lang` to override `site.lang` ([cotes2020#1586](cotes2020#1586)) ([547b95c](cotes2020@547b95c))
* make post description customizable ([cotes2020#1602](cotes2020#1602)) ([f865336](cotes2020@f865336))
* **media:** support audio and video tag with multi sources ([cotes2020#1618](cotes2020#1618)) ([23be416](cotes2020@23be416))

### Bug Fixes

* make TOC title and entries visible at the same time ([cotes2020#1711](cotes2020#1711)) ([e0950fc](cotes2020@e0950fc))
* mode toggle not outlined when receiving keyboard focus ([cotes2020#1690](cotes2020#1690)) ([cd37f63](cotes2020@cd37f63))
* prevent footnote back arrow from becoming an emoji ([cotes2020#1716](cotes2020#1716)) ([8608147](cotes2020@8608147))
* **pwa:** skip range requests in service worker ([cotes2020#1672](cotes2020#1672)) ([76d58fe](cotes2020@76d58fe))
* search result prompt is empty ([cotes2020#1583](cotes2020#1583)) ([8a2afae](cotes2020@8a2afae))
* use `https` for Weibo sharing URL ([cotes2020#1612](cotes2020#1612)) ([8e5fbb7](cotes2020@8e5fbb7))

### Improvements

* improve <hr> visibility in dark mode ([cotes2020#1565](cotes2020#1565)) ([4ddd5c4](cotes2020@4ddd5c4))
* lean bootstrap javascript ([cotes2020#1734](cotes2020#1734)) ([ddb48ed](cotes2020@ddb48ed))
* rename comment setting parameter ([cotes2020#1563](cotes2020#1563)) ([f8390d4](cotes2020@f8390d4))
* replace jQuery with Vanilla JS ([cotes2020#1681](cotes2020#1681)) ([fe7afa3](cotes2020@fe7afa3))
* simplify mode toggle script ([cotes2020#1692](cotes2020#1692)) ([d4a6d64](cotes2020@d4a6d64))
* tree shaking Bootstrap CSS ([cotes2020#1736](cotes2020#1736)) ([363a3d9](cotes2020@363a3d9))

### Changes

* optimize the resource hints ([cotes2020#1717](cotes2020#1717)) ([dcb0add](cotes2020@dcb0add))
* rename media-url file and related parameters ([cotes2020#1651](cotes2020#1651)) ([9f8aeaa](cotes2020@9f8aeaa))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants