Skip to content

Commit

Permalink
add rss verity
Browse files Browse the repository at this point in the history
  • Loading branch information
5am3 committed Oct 12, 2024
1 parent 63dcce7 commit fdf39ff
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 13 deletions.
11 changes: 5 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ deploy:
# repo: https://git.coding.net/i_5am3/i_5am3.coding.me.git
branch: gh-pages

live2d:
model: tororo
bottom: 0
right: 50
bottom_s: -50
right_s: 0
feed:
type: atom
path: atom.xml
limit: 20
template: ./source/atom.xml
62 changes: 62 additions & 0 deletions source/atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ config.title }}</title>
{% if icon %}<icon>{{ icon }}</icon>{% endif %}
{% if config.subtitle %}<subtitle>{{ config.subtitle }}</subtitle>{% endif %}
<link href="{{ feed_url | uriencode }}" rel="self"/>
{% if config.feed.hub %}<link href="{{ config.feed.hub | uriencode }}" rel="hub"/>{% endif %}
<link href="{{ url | uriencode }}"/>
<follow_challenge>
<feedId>60858567984097301</feedId>
<userId>66754777500722176</userId>
</follow_challenge>
<updated>{% if posts.first().updated %}{{ posts.first().updated.toISOString() }}{% else %}{{ posts.first().date.toISOString() }}{% endif %}</updated>
<id>{{ url | uriencode }}</id>
{% if config.author %}
<author>
<name>{{ config.author }}</name>
{% if config.email %}<email>{{ config.email }}</email>{% endif %}
</author>
{% endif %}
<generator uri="https://hexo.io/">Hexo</generator>
{% for post in posts.toArray() %}
<entry>
<title>{{ post.title }}</title>
<link href="{{ post.permalink | uriencode }}"/>
<id>{{ post.permalink | uriencode }}</id>
<published>{{ post.date.toISOString() }}</published>
<updated>{% if post.updated %}{{ post.updated.toISOString() }}{% else %}{{ post.date.toISOString() }}{% endif %}</updated>
{% if config.feed.content and post.content %}
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
{% endif %}
{% if post.description %}
<summary type="html">{{ post.description }}</summary>
{% elif post.intro %}
<summary type="html">{{ post.intro }}</summary>
{% elif post.excerpt %}
<summary type="html">{{ post.excerpt }}</summary>
{% elif post.content %}
{% set short_content = post.content.substring(0, config.feed.content_limit) %}
{% if config.feed.content_limit_delim %}
{% set delim_pos = short_content.lastIndexOf(config.feed.content_limit_delim) %}
{% if delim_pos > -1 %}
<summary type="html">{{ short_content.substring(0, delim_pos) }}</summary>
{% else %}
<summary type="html">{{ short_content }}</summary>
{% endif %}
{% else %}
<summary type="html">{{ short_content }}</summary>
{% endif %}
{% endif %}
{% if post.image %}
<content src="{{ post.image | formatUrl }}" type="image"/>
{% endif %}
{% for category in post.categories.toArray() %}
<category term="{{ category.name }}" scheme="{{ category.permalink }}"/>
{% endfor %}
{% for tag in post.tags.toArray() %}
<category term="{{ tag.name }}" scheme="{{ tag.permalink }}"/>
{% endfor %}
</entry>
{% endfor %}
</feed>
28 changes: 22 additions & 6 deletions themes/black-blue-master/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ Plugins:
- hexo-generator-sitemap
- hexo-generator-baidu-sitemap

feed:
type: atom
path: atom.xml
limit: 20
template: ./source/atom.xml

search:
path: search.json
field: post
Expand Down Expand Up @@ -195,3 +189,25 @@ TipTitle: true
# Loading
# Loading: true


live2d:
enable: true
model: tororo
bottom: 0
right: 50
bottom_s: -50
right_s: 0

# enable: true
# scriptFrom: local
# pluginRootPath: live2dw/
# pluginJsPath: lib/
# pluginModelPath: assets/
tagMode: false
debug: false
display:
position: right
width: 150
height: 300
mobile:
show: false
1 change: 0 additions & 1 deletion themes/black-blue-master/layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@
</div>
</footer>

<%- live2d() %>

0 comments on commit fdf39ff

Please sign in to comment.