Update 7 files

- /_includes/word_count.html
- /_config.yml
- /_layouts/default.html
- /Gemfile
- /js/rss-feed-preview.js
- /_posts/2025-04-08-feed.md
- /links.md
This commit is contained in:
mayx
2025-04-08 14:12:54 +00:00
parent d3eefbba2d
commit 9170efdaa3
7 changed files with 51 additions and 4 deletions

View File

@ -6,6 +6,7 @@ group :jekyll_plugins do
gem "jekyll-assets", "~> 1.0.0" gem "jekyll-assets", "~> 1.0.0"
gem "jekyll-sitemap", "~> 1.4.0" gem "jekyll-sitemap", "~> 1.4.0"
gem "jekyll-feed", "~> 0.15.1" gem "jekyll-feed", "~> 0.15.1"
gem "jekyll-include-cache", "~> 0.2.1"
gem "jekyll-theme-minimal" gem "jekyll-theme-minimal"
gem "jekyll-paginate", "~> 1.1.0" gem "jekyll-paginate", "~> 1.1.0"
gem "kramdown-parser-gfm", "~> 1.1.0" gem "kramdown-parser-gfm", "~> 1.1.0"

View File

@ -10,6 +10,7 @@ paginate: 7
plugins: plugins:
- jekyll-sitemap - jekyll-sitemap
- jekyll-feed - jekyll-feed
- jekyll-include-cache
feed: feed:
path: atom.xml path: atom.xml
google_analytics: UA-137710294-1 google_analytics: UA-137710294-1

View File

@ -0,0 +1 @@
{% assign count = 0 %}{% for post in site.posts %}{% assign single_count = post.content | strip_html | strip_newlines | remove: " " | size %}{% assign count = count | plus: single_count %}{% endfor %}{{ count }}

File diff suppressed because one or more lines are too long

30
_posts/2025-04-08-feed.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -90,6 +90,17 @@
return null; return null;
}; };
const escapeHTML = (str) => {
return String(str).replace(/[&<>"'/]/g, (c) => ({
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;'
}[c]));
};
const renderFeedItems = (previewEl, items, siteName) => { const renderFeedItems = (previewEl, items, siteName) => {
if (!items || items.length === 0) { if (!items || items.length === 0) {
previewEl.innerHTML = '<p>No feed items found.</p>'; previewEl.innerHTML = '<p>No feed items found.</p>';
@ -99,13 +110,15 @@
let html = `<h3>Latest from ${siteName}</h3><ul style="list-style: none; padding: 0; margin: 0;">`; let html = `<h3>Latest from ${siteName}</h3><ul style="list-style: none; padding: 0; margin: 0;">`;
items.forEach(item => { items.forEach(item => {
const safeTitle = escapeHTML(item.title);
const safeDate = escapeHTML(new Date(item.date).toLocaleDateString());
html += ` html += `
<li style="margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;"> <li style="margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
<div style="color: #24292e; font-weight: bold;"> <div style="color: #24292e; font-weight: bold;">
${item.title} ${safeTitle}
</div> </div>
<div style="color: #586069; font-size: 12px; margin: 3px 0;"> <div style="color: #586069; font-size: 12px; margin: 3px 0;">
${new Date(item.date).toLocaleDateString()} ${safeDate}
</div> </div>
</li> </li>
`; `;

View File

@ -8,7 +8,7 @@ tags: [links]
| Link | Description | | Link | Description |
| - | - | | - | - |
{% for item in site.data.links %}| <a href="{{ item.link }}" target="_blank" data-feed="{{ item.feed_url }}">{{ item.title }}</a> | {{ item.description }} | {% for item in site.data.links %}| <a href="{{ item.link }}" target="_blank" rel="noopener" data-feed="{{ item.feed_url }}">{{ item.title }}</a> | {{ item.description }} |
{% endfor %} {% endfor %}
## Links申请 ## Links申请
@ -23,6 +23,7 @@ tags: [links]
名称Mayx的博客 名称Mayx的博客
简介Mayx's Home Page 简介Mayx's Home Page
链接:<https://mabbs.github.io> 链接:<https://mabbs.github.io>
订阅:<https://mabbs.github.io/atom.xml>
头像:<https://avatars0.githubusercontent.com/u/17966333> 头像:<https://avatars0.githubusercontent.com/u/17966333>
Logo<https://mabbs.github.io/favicon.ico> Logo<https://mabbs.github.io/favicon.ico>