Skip to content

Commit

Permalink
chore: add svg asset
Browse files Browse the repository at this point in the history
  • Loading branch information
baozouai committed May 13, 2023
1 parent 48d5dfd commit edf60f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions assets/collect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type { SupportPlatform } from './type'
import getPostList from './util/get_list'
import { getTimeDiffString } from './util/time'

const ASSETS_PATH = 'https://raw.githubusercontent.com/baozouai/multi-platform-posts-action/main/assets'

const SUPPORT_PLAT_FORM = [
/** 掘金 */
'juejin',
Expand Down Expand Up @@ -33,7 +35,7 @@ async function main(): Promise<void> {
const reduceText = commonPosts.reduce<string>((total, item) => {
const { title, publish_time, link, star, collect } = item
const time = getTimeDiffString(publish_time)
return `${total}\n<li>[${time} <img src="./assets/star.svg" width='14px'/>:${star} ${collect === null ? '' : `<img src="./assets/collect.svg" width='20px'/>:${collect}`}]
return `${total}\n<li>[${time} <img src="${ASSETS_PATH}/star.svg" width='14px'/>:${star} ${collect === null ? '' : `<img src="${ASSETS_PATH}/collect.svg" width='20px'/>:${collect}`}]
<a href="${link}" target="_blank">${title}</a>
</li>`
}, '')
Expand Down

0 comments on commit edf60f8

Please sign in to comment.