Skip to content

Commit eeacc33

Browse files
committed
[ Add ] Gallery layout (PoC)
1 parent 970df9e commit eeacc33

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ cache:
1111

1212
install:
1313
- npm install
14+
- cd ${FOLDER_SOURCE}
15+
- rm $(ls -F | grep [^/]$)
16+
- echo ${DOMAIN} > CNAME
17+
- cd ..
1418
script:
1519
- npm run build
16-
- cd ${FOLDER}
20+
- cd ${FOLDER_TARGET}
1721
- git init
1822
- git config user.name ${UID}
1923
- git config user.email ${EMAIL}

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ pwa:
122122
routes:
123123
- pattern: "!!js/regexp /\\//"
124124
strategy: networkFirst
125+
- pattern: "!!js/regexp /\\/css\\/common.css$/"
126+
strategy: networkFirst
125127
- pattern: "!!js/regexp /.*\\.(css|js|jpg|jpeg|png|gif|webp)$/"
126128
strategy: cacheFirst
127129
- pattern: "!!js/regexp /google.*\\.com/"

themes/Icarus/layout/gallery.ejs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<main class="card article">
2+
<div class="card-content content">
3+
<h1><%= page.title %></h1>
4+
5+
<%- partial('./widget/gallery', site) %>
6+
</div>
7+
</main>

themes/Icarus/layout/widget/activity_list.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<% posts.filter(
1818
post => has_category(post, 'Activity')
1919
).slice(0, 5).forEach(post => { %>
20-
<a class="table-row activity-item" href="<%= post.permalink %>">
20+
<a class="table-row activity-item" href="<%= url_for( post.path ) %>">
2121
<div class="image is-64x64">
2222
<img class="thumbnail" src="<%= get_thumbnail(post) %>" alt="<%= post.title %>">
2323
</div>
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
<div class="justified-gallery">
2-
<% images.forEach(photo => { %>
3-
<img src="<%= encodeURI( photo ) %>">
4-
<% }) %>
1+
<div class="justified-gallery"><%
2+
posts.forEach(({photos, path, title}) => {
3+
4+
if (! photos[0]) return;
5+
6+
for (let file of photos) { %>
7+
<a class="gallery-item" href="<%= url_for(path + file) %>">
8+
<img src="<%= url_for(path + file) %>" alt="<%= title %>">
9+
</a><%
10+
}
11+
}) %>
512
</div>

themes/Icarus/layout/widget/post_media.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if ( authors ) { %>
2727
if ( photos[0] ) { %>
2828
<div class="content">
2929
<h3>精彩瞬间</h3>
30-
<%- partial('../widget/gallery', {images: photos}) %>
30+
<%- partial('../widget/gallery', {posts: [post]}) %>
3131
</div><%
3232
}
3333
%>

0 commit comments

Comments
 (0)