hexo-theme-particlex 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
 - package/layout/archives.ejs +8 -4
 - package/layout/categories.ejs +1 -5
 - package/layout/layout.ejs +8 -13
 - package/layout/loading.ejs +1 -1
 - package/layout/posts.ejs +20 -2
 - package/layout/tags.ejs +1 -5
 - package/package.json +1 -1
 - package/source/css/particlex.css +599 -732
 - package/source/{loading.gif → images/loading.gif} +0 -0
 - package/source/js/functions.js +1 -1
 
    
        package/README.md
    CHANGED
    
    
    
        package/layout/archives.ejs
    CHANGED
    
    | 
         @@ -1,10 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <%
         
     | 
| 
      
 2 
     | 
    
         
            +
                let posts = site.posts;
         
     | 
| 
      
 3 
     | 
    
         
            +
                posts.data.sort((a, b) => b.date - a.date);
         
     | 
| 
      
 4 
     | 
    
         
            +
            %>
         
     | 
| 
       1 
5 
     | 
    
         
             
            <div id="archives">
         
     | 
| 
       2 
6 
     | 
    
         
             
                <% if (theme.search.enable) { %>
         
     | 
| 
       3 
     | 
    
         
            -
                <div id="search-mask" style="z-index: <%=  
     | 
| 
       4 
     | 
    
         
            -
                <input id="search-bar" class="ipt" placeholder="搜索" style="z-index: <%=  
     | 
| 
      
 7 
     | 
    
         
            +
                <div id="search-mask" style="z-index: <%= posts.length + 1 %>"></div>
         
     | 
| 
      
 8 
     | 
    
         
            +
                <input id="search-bar" class="ipt" placeholder="搜索" style="z-index: <%= posts.length + 2 %>">
         
     | 
| 
       5 
9 
     | 
    
         
             
                <% } %>
         
     | 
| 
       6 
     | 
    
         
            -
                <%  
     | 
| 
       7 
     | 
    
         
            -
                <div class="timeline" style="z-index: <%=  
     | 
| 
      
 10 
     | 
    
         
            +
                <% posts.forEach((post, id) => { %>
         
     | 
| 
      
 11 
     | 
    
         
            +
                <div class="timeline" style="z-index: <%= posts.length - id %>" data-title="<%- post.title.toLowerCase().replace(/\s+/gm, "") %>">
         
     | 
| 
       8 
12 
     | 
    
         
             
                    <div class="timeline-tail"></div>
         
     | 
| 
       9 
13 
     | 
    
         
             
                    <div class="timeline-content">
         
     | 
| 
       10 
14 
     | 
    
         
             
                        <div class="item-time"><%- date(post.date, "YYYY/M/D") %></div>
         
     | 
    
        package/layout/categories.ejs
    CHANGED
    
    | 
         @@ -19,11 +19,7 @@ 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    <% if (is_category(category.name)) { %>
         
     | 
| 
       20 
20 
     | 
    
         
             
                    <%
         
     | 
| 
       21 
21 
     | 
    
         
             
                        posts = category.posts;
         
     | 
| 
       22 
     | 
    
         
            -
                        posts.data.sort((a, b) =>  
     | 
| 
       23 
     | 
    
         
            -
                            if (typeof a.top === "undefined") a.top = 0;
         
     | 
| 
       24 
     | 
    
         
            -
                            if (typeof b.top === "undefined") b.top = 0;
         
     | 
| 
       25 
     | 
    
         
            -
                            return a.top == b.top ? b.date - a.date : b.top - a.top
         
     | 
| 
       26 
     | 
    
         
            -
                        });
         
     | 
| 
      
 22 
     | 
    
         
            +
                        posts.data.sort((a, b) => b.date - a.date);
         
     | 
| 
       27 
23 
     | 
    
         
             
                    %>
         
     | 
| 
       28 
24 
     | 
    
         
             
                    <% } %>
         
     | 
| 
       29 
25 
     | 
    
         
             
                    <% }); %>
         
     | 
    
        package/layout/layout.ejs
    CHANGED
    
    | 
         @@ -20,11 +20,6 @@ 
     | 
|
| 
       20 
20 
     | 
    
         
             
                else if (is_archive() || is_year() || is_month())
         
     | 
| 
       21 
21 
     | 
    
         
             
                    title = "Archives | ";
         
     | 
| 
       22 
22 
     | 
    
         
             
                title += config.title;
         
     | 
| 
       23 
     | 
    
         
            -
                site.posts.data.sort((a, b) => {
         
     | 
| 
       24 
     | 
    
         
            -
                    if (typeof a.top === "undefined") a.top = 0;
         
     | 
| 
       25 
     | 
    
         
            -
                    if (typeof b.top === "undefined") b.top = 0;
         
     | 
| 
       26 
     | 
    
         
            -
                    return a.top == b.top ? b.date - a.date : b.top - a.top;
         
     | 
| 
       27 
     | 
    
         
            -
                });
         
     | 
| 
       28 
23 
     | 
    
         
             
            %>
         
     | 
| 
       29 
24 
     | 
    
         
             
            <!DOCTYPE html>
         
     | 
| 
       30 
25 
     | 
    
         
             
            <html lang="<%- config.language %>">
         
     | 
| 
         @@ -58,15 +53,15 @@ 
     | 
|
| 
       58 
53 
     | 
    
         
             
                    <%- partial("loading") %>
         
     | 
| 
       59 
54 
     | 
    
         
             
                    <div id="layout">
         
     | 
| 
       60 
55 
     | 
    
         
             
                        <transition name="into">
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
                                </div>
         
     | 
| 
       65 
     | 
    
         
            -
                                <div id="main">
         
     | 
| 
       66 
     | 
    
         
            -
                                    <%- partial(type) %>
         
     | 
| 
       67 
     | 
    
         
            -
                                    <%- partial("footer") %>
         
     | 
| 
       68 
     | 
    
         
            -
                                </div>
         
     | 
| 
      
 56 
     | 
    
         
            +
                        <div v-show="showpage" style="display: -not-none">
         
     | 
| 
      
 57 
     | 
    
         
            +
                            <div id="menushow">
         
     | 
| 
      
 58 
     | 
    
         
            +
                                <%- partial("menu") %>
         
     | 
| 
       69 
59 
     | 
    
         
             
                            </div>
         
     | 
| 
      
 60 
     | 
    
         
            +
                            <div id="main">
         
     | 
| 
      
 61 
     | 
    
         
            +
                                <%- partial(type) %>
         
     | 
| 
      
 62 
     | 
    
         
            +
                                <%- partial("footer") %>
         
     | 
| 
      
 63 
     | 
    
         
            +
                            </div>
         
     | 
| 
      
 64 
     | 
    
         
            +
                        </div>
         
     | 
| 
       70 
65 
     | 
    
         
             
                        </transition>
         
     | 
| 
       71 
66 
     | 
    
         
             
                        <div id="showimg">
         
     | 
| 
       72 
67 
     | 
    
         
             
                            <img id="showimg-content" alt="showimg">
         
     | 
    
        package/layout/loading.ejs
    CHANGED
    
    | 
         @@ -5,7 +5,7 @@ 
     | 
|
| 
       5 
5 
     | 
    
         
             
                            <h2>LOADING...</h2>
         
     | 
| 
       6 
6 
     | 
    
         
             
                            <p style="word-break: keep-all">加载过慢请开启缓存(浏览器默认开启)</p>
         
     | 
| 
       7 
7 
     | 
    
         
             
                            <div>
         
     | 
| 
       8 
     | 
    
         
            -
                                <img alt="loading" src="<%- url_for("/loading.gif") %>" style="width: 60px">
         
     | 
| 
      
 8 
     | 
    
         
            +
                                <img alt="loading" src="<%- url_for("/images/loading.gif") %>" style="width: 60px">
         
     | 
| 
       9 
9 
     | 
    
         
             
                            </div>
         
     | 
| 
       10 
10 
     | 
    
         
             
                        </div>
         
     | 
| 
       11 
11 
     | 
    
         
             
                    </div>
         
     | 
    
        package/layout/posts.ejs
    CHANGED
    
    | 
         @@ -1,5 +1,13 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <% 
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            <%
         
     | 
| 
      
 2 
     | 
    
         
            +
                let posts = site.posts,
         
     | 
| 
      
 3 
     | 
    
         
            +
                    current = (page.current - 1) * config.index_generator.per_page;
         
     | 
| 
      
 4 
     | 
    
         
            +
                posts.data.sort((a, b) => {
         
     | 
| 
      
 5 
     | 
    
         
            +
                    let topa = a.top ?? 0, topb = b.top ?? 0;
         
     | 
| 
      
 6 
     | 
    
         
            +
                    return topa == topb ? b.date - a.date : topb - topa;
         
     | 
| 
      
 7 
     | 
    
         
            +
                });
         
     | 
| 
      
 8 
     | 
    
         
            +
                posts = posts.slice(current, config.index_generator.per_page + current);
         
     | 
| 
      
 9 
     | 
    
         
            +
            %>
         
     | 
| 
      
 10 
     | 
    
         
            +
            <% posts.forEach(post => { %>
         
     | 
| 
       3 
11 
     | 
    
         
             
            <div class="post">
         
     | 
| 
       4 
12 
     | 
    
         
             
                <a href="<%- url_for(post.path) %>">
         
     | 
| 
       5 
13 
     | 
    
         
             
                    <h2 class="post-title"><%= titlecase(post.title) %></h2>
         
     | 
| 
         @@ -21,6 +29,16 @@ 
     | 
|
| 
       21 
29 
     | 
    
         
             
                        </span>
         
     | 
| 
       22 
30 
     | 
    
         
             
                        <%- date(post.date, "YYYY/M/D") %>
         
     | 
| 
       23 
31 
     | 
    
         
             
                    </span>
         
     | 
| 
      
 32 
     | 
    
         
            +
                    <% if (theme.crypto.enable && typeof post.password !== "undefined") { %>
         
     | 
| 
      
 33 
     | 
    
         
            +
                    <span class="special">
         
     | 
| 
      
 34 
     | 
    
         
            +
                        <i class="fa-solid fa-lock fa-fw"></i>
         
     | 
| 
      
 35 
     | 
    
         
            +
                    </span>
         
     | 
| 
      
 36 
     | 
    
         
            +
                    <% } %>
         
     | 
| 
      
 37 
     | 
    
         
            +
                    <% if (typeof post.top !== "undefined" && post.top > 0) { %>
         
     | 
| 
      
 38 
     | 
    
         
            +
                    <span class="special">
         
     | 
| 
      
 39 
     | 
    
         
            +
                        <i class="fa-solid fa-grip-vertical fa-fw"></i>
         
     | 
| 
      
 40 
     | 
    
         
            +
                    </span>
         
     | 
| 
      
 41 
     | 
    
         
            +
                    <% } %>
         
     | 
| 
       24 
42 
     | 
    
         
             
                </div>
         
     | 
| 
       25 
43 
     | 
    
         
             
                <div class="excerpt">
         
     | 
| 
       26 
44 
     | 
    
         
             
                    <div class="content" v-pre>
         
     | 
    
        package/layout/tags.ejs
    CHANGED
    
    | 
         @@ -19,11 +19,7 @@ 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    <% if (is_tag(tag.name)) { %>
         
     | 
| 
       20 
20 
     | 
    
         
             
                    <%
         
     | 
| 
       21 
21 
     | 
    
         
             
                        posts = tag.posts;
         
     | 
| 
       22 
     | 
    
         
            -
                        posts.data.sort((a, b) =>  
     | 
| 
       23 
     | 
    
         
            -
                            if (typeof a.top === "undefined") a.top = 0;
         
     | 
| 
       24 
     | 
    
         
            -
                            if (typeof b.top === "undefined") b.top = 0;
         
     | 
| 
       25 
     | 
    
         
            -
                            return a.top == b.top ? b.date - a.date : b.top - a.top;
         
     | 
| 
       26 
     | 
    
         
            -
                        });
         
     | 
| 
      
 22 
     | 
    
         
            +
                        posts.data.sort((a, b) => b.date - a.date);
         
     | 
| 
       27 
23 
     | 
    
         
             
                    %>
         
     | 
| 
       28 
24 
     | 
    
         
             
                    <% } %>
         
     | 
| 
       29 
25 
     | 
    
         
             
                    <% }); %>
         
     |