mirror of https://github.com/Mabbs/mabbs.github.io
				
				
				
			
							parent
							
								
									550321e80a
								
							
						
					
					
						commit
						07a3d18350
					
				| 
						 | 
				
			
			@ -80,7 +80,7 @@ layout: default
 | 
			
		|||
{% if page.tags %}
 | 
			
		||||
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
<p id="suggest-container"><button onclick="getSuggestBlog('{{ page.url }}')">查看推荐文章</button></p>
 | 
			
		||||
<div class="pagination">
 | 
			
		||||
  {% if page.previous.url %}
 | 
			
		||||
  <span class="prev">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
								
									
									
										
											25
										
									
									js/main.js
									
									
									
									
								
								
							
							
										
											25
										
									
									js/main.js
									
									
									
									
								| 
						 | 
				
			
			@ -16,8 +16,9 @@ $(function(){
 | 
			
		|||
    $("div#landlord").mouseleave(function () {
 | 
			
		||||
        $("div.live_ico_box").fadeOut();
 | 
			
		||||
    });
 | 
			
		||||
    var BlogAPI = "https://summary.mayx.eu.org";
 | 
			
		||||
    function showHitS(hits) {
 | 
			
		||||
    $.get("https://summary.mayx.eu.org/count_click?id="+hits.id,function(data){
 | 
			
		||||
        $.get(BlogAPI + "/count_click?id=" + hits.id, function (data) {
 | 
			
		||||
            hits.innerHTML = Number(data);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +31,7 @@ function showHitCount() {
 | 
			
		|||
    }
 | 
			
		||||
    function addCount() {
 | 
			
		||||
        var visitors = $(".visitors");
 | 
			
		||||
    $.get("https://summary.mayx.eu.org/count_click_add?id="+visitors[0].id,function(data){
 | 
			
		||||
        $.get(BlogAPI + "/count_click_add?id=" + visitors[0].id, function (data) {
 | 
			
		||||
            visitors[0].innerHTML = Number(data);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -41,6 +42,24 @@ if ($('.visitors').length == 1) {
 | 
			
		|||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
function getSuggestBlog(blogurl) {
 | 
			
		||||
    var suggest = $("#suggest-container")[0];
 | 
			
		||||
    suggest.innerHTML = "Loading...";
 | 
			
		||||
    $.get(BlogAPI + "/suggest?id=" + blogurl, function (data) {
 | 
			
		||||
        getSearchJSON(function (search) {
 | 
			
		||||
            suggest.innerHTML = "";
 | 
			
		||||
            const searchMap = new Map(search.map(item => [item.url, item]));
 | 
			
		||||
            const merged = data.map(suggestObj => {
 | 
			
		||||
                const searchObj = searchMap.get(suggestObj.id);
 | 
			
		||||
                return searchObj ? { ...searchObj } : suggestObj;
 | 
			
		||||
            });
 | 
			
		||||
            merged.forEach(element => {
 | 
			
		||||
                suggest.innerHTML += "<a href=" + element.url + ">" + element.title + "</a> - " + element.date + "<br />";
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
today = new Date();
 | 
			
		||||
timeold = (today.getTime() - lastUpdated.getTime());
 | 
			
		||||
secondsold = Math.floor(timeold / 1000);
 | 
			
		||||
| 
						 | 
				
			
			@ -53,4 +72,4 @@ if (daysold > 90) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
var message_Path = '/Live2dHistoire/live2d/';
 | 
			
		||||
var talkAPI = "https://summary.mayx.workers.dev/ai_chat";
 | 
			
		||||
var talkAPI = BlogAPI + "/ai_chat";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
								
									
									
										
											13
										
									
									search.json
									
									
									
									
								
								
							
							
										
											13
										
									
									search.json
									
									
									
									
								| 
						 | 
				
			
			@ -1,14 +1,3 @@
 | 
			
		|||
---
 | 
			
		||||
---
 | 
			
		||||
[
 | 
			
		||||
  {% for post in site.posts %}{% unless post.layout == "encrypt" %}
 | 
			
		||||
    {
 | 
			
		||||
      "title"    : "{{ post.title | escape }}",
 | 
			
		||||
      "category" : "{{ post.category }}",
 | 
			
		||||
      "tags"     : "{{ post.tags | join: ', ' }}",
 | 
			
		||||
      "url"      : "{{ site.baseurl }}{{ post.url }}",
 | 
			
		||||
      "date"     : "{{ post.date | date: "%Y/%m/%d" }}",
 | 
			
		||||
      "content": {{ post.content | strip_html | strip_newlines | jsonify }}
 | 
			
		||||
    }{% unless forloop.last %},{% endunless %}{% endunless %}
 | 
			
		||||
  {% endfor %}
 | 
			
		||||
]
 | 
			
		||||
[{% for post in site.posts %}{% unless post.layout == "encrypt" %}{ "title": "{{ post.title | escape }}", "category": "{{ post.category }}", "tags": "{{ post.tags | join: ', ' }}", "url": "{{ site.baseurl }}{{ post.url }}", "date": "{{ post.date | date: "%Y/%m/%d" }}", "content": {{ post.content | strip_html | strip_newlines | jsonify }} }{% unless forloop.last %},{% endunless %}{% endunless %}{% endfor %}]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue