Skip to content

Commit

Permalink
Merge branch 'dev' and release 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chihuo2104 committed Nov 11, 2023
2 parents 5e519ed + 2475c06 commit bb7b0d6
Show file tree
Hide file tree
Showing 22 changed files with 4,231 additions and 2,505 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3


# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: 'v1.13.1'
cosign-release: 'v2.1.1'

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
Expand Down Expand Up @@ -85,7 +86,9 @@ jobs:
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: 'true'
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
54 changes: 14 additions & 40 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $router.beforeEach((from, to, next) => {
})
$router.afterEach(() => {
// hidden.value = false
hidden.value = false
setTimeout(() => { hidden.value = false }, 300)
// thanks to busuanzi!
// @prettier-ignore
Expand Down Expand Up @@ -173,17 +173,17 @@ function renderNumber(num) {
}
</script>
<template>
<div id="indexapp">
<div>
<Background
:imgsrc="settings.site.background?.img"
blur="5px"
:color="settings.site.background.color"
v-if="settings.site.background.enabled"
id="back"
/>
<Header :pages="pages" :settings="settings" :posts="posts" :route="$route"/>
<aside><Toolbar/></aside>
<div id="viewer" :class="{ hidden: hidden ? true : false, normal: hidden ? false : true }">
<Header :pages="pages" :settings="settings" :posts="posts" :route="$route" class="z-10"/>
<!-- <aside><Toolbar/></aside>-->
<div class="mx-auto container max-w-5xl mt-20 transition-opacity" :class="{ hidden: hidden ? true : false, normal: hidden ? false : true }">
<div id="datatip" v-if="versionDifference !== ''">
数据文件过时提醒:<br />
尽管本版本最低支持{{ version.supportVersion }}({{ version.supportVersionDate }}),
Expand Down Expand Up @@ -214,15 +214,16 @@ function renderNumber(num) {
<main>
<NuxtPage />
</main>
<Footer
:settings="settings"
:load-time="loadTime"
:render-time="renderTime"
:version="version"
:text-count="textcount"
:ignore="config.ignorebeta"
class="p-5"
/>
</div>
<Footer
:settings="settings"
:load-time="loadTime"
:render-time="renderTime"
:version="version"
:text-count="textcount"
:ignore="config.ignorebeta"
/>
</div>
</template>
<style lang="scss">
Expand Down Expand Up @@ -250,35 +251,8 @@ html[theme='dark-mode'] img {
//html img {
// transition: filter 0 linear;
//}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 4px;
padding: 4px;
border: 0;
}
</style>
<style lang="scss" scoped>
#viewer {
display: block;
background-color: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
transition: transform ease-in-out 200ms, opacity ease-in-out 300ms;
@media screen and (max-width: 1024px) {
width: 100%;
padding: 2px;
margin-top: 3em;
}
@media screen and (min-width: 1024px) {
margin-left: 25%;
margin-right: 25%;
margin-top: calc(16px + 3em);
}
}
#back {
display: none;
@media screen and (min-width: 768px) {
Expand Down
37 changes: 18 additions & 19 deletions components/ArticleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,25 @@ props.posts.forEach((element) => {
</script>
<template>
<div v-for="i in sortedposts" :key="i.id">
<div class="article" :id="'posts-' + i.id">
<section>
<div class="m-2" :id="'posts-' + i.id">
<section class='p-2'>
<Card v-if="i.banner !== undefined" :img="i.banner">
<h3 v-if="i.pinned !== undefined ? i.pinned : false" id="pin"><Icon name="pin" /><span style="font-size: 18px;">置顶文章</span></h3>
<h3 :id="'posts-title-' + i.id" style="font-size: 24px">
<nuxt-link :to="'/posts/' + i.path">{{ i.title }}</nuxt-link>
</h3>
<div id="infoset">
<div class="set"><Icon name="account" /><span><nuxt-link :to="'/author/' + i.author">{{ i.author }}</nuxt-link></span></div>
<div class="set"><Icon name="clockoutline" /><span>{{renderTime(i.time) }}</span></div>
<div class="set"><Icon name="accountarrowup" /><span>{{ renderTime(i.updtime) }}</span></div>
<div class="set"><div v-if="settings.site.comment.backend.type === 'chicomment-simple'"><Icon name="comment" />{{ props.comments.filter((comment) => comment.to === i.id).length }}</div></div>
<div class="set"><Icon name="book" /><span><nuxt-link :to="'/category/' + i.category">{{ i.category !== undefined ? i.category : '未分类' }}</nuxt-link></span></div>
<div v-if="settings.site.textcount.article !== undefined ? settings.site.textcount.article : true" class="set"><Icon name="textCount" /><span>{{ renderNumber(i.content.length) }}字</span></div>
</div>
<div :id="'posts-desc' + i.id" class='pstdesc'>
{{ i.desc !== undefined ? i.desc : '本文章未提供摘要。' }}
<div class="m-4">
<div class="text-2xl font-bold" v-if="i.pinned !== undefined ? i.pinned : false" id="pin"><Icon name="pin" /><span style="font-size: 18px;">置顶文章</span></div>
<h2 :id="'posts-title-' + i.id" class="text-2xl font-bold pl-2">
<nuxt-link :to="'/posts/' + i.path">{{ i.title }}</nuxt-link>
</h2>
<div id="infoset">
<div class="set"><Icon name="account" /><span><nuxt-link :to="'/author/' + i.author">{{ i.author }}</nuxt-link></span></div>
<div class="set"><Icon name="clockoutline" /><span>{{renderTime(i.time) }}</span></div>
<div class="set"><Icon name="accountarrowup" /><span>{{ renderTime(i.updtime) }}</span></div>
<div class="set"><div v-if="settings.site.comment.backend.type === 'chicomment-simple'"><Icon name="comment" />{{ props.comments.filter((comment) => comment.to === i.id).length }}</div></div>
<div class="set"><Icon name="book" /><span><nuxt-link :to="'/category/' + i.category">{{ i.category !== undefined ? i.category : '未分类' }}</nuxt-link></span></div>
<div v-if="settings.site.textcount.article !== undefined ? settings.site.textcount.article : true" class="set"><Icon name="textCount" /><span>{{ renderNumber(i.content.length) }}字</span></div>
</div>
<div :id="'posts-desc' + i.id" class='pstdesc'>
{{ i.desc !== undefined ? i.desc : '本文章未提供摘要。' }}
</div>
</div>
</Card>
</section>
Expand Down Expand Up @@ -114,9 +116,6 @@ div.set {
}
padding: 4px;
}
.article {
margin-bottom: 16px;
}
.pstdesc {
font-size: 18px;
padding: 4px;
Expand Down
47 changes: 7 additions & 40 deletions components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,55 +48,20 @@ onMounted(async () => {
})
</script>
<template>
<div class="card" :class="{ imageshow: showImg }">
<div class="lazyloadimg" id="img">
<img :data-src="props.img" src="/loading.svg" class="lazy" alt="" v-if="showImg" />
<div class="my-2 mx-2 p-2 shadow-md hover:shadow-xl transition-all grid lg:grid-cols-2 backdrop-blur-sm overflow-y-auto" style="background-color: rgba(255,255,255,0.3)" :class="{ imageshow: showImg }">
<div class="lazyloadimg flex content-center justify-center transition-all" id="img">
<img :data-src="props.img" src="/loading.svg" class="lazy" alt="" v-if="showImg"/>
</div>
<div>
<!-- Title & Content -->
<h1>{{ props.title }}</h1>
<h1 class="font-bold text-xl">{{ props.title }}</h1>
<div>
<slot></slot>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
@import '../styles/cardback.scss';
//$base: 18px;
.card {
transition: all ease-in-out 200ms;
&:hover {
box-shadow: 0 4px 3px rgba(0, 0, 0, 0.1), 0 -4px 3px rgba(0, 0, 0, 0.1);
}
div {
padding-top: 4px;
padding-left: 16px;
padding-right: 16px;
padding-bottom: 8px;
h1 {
font-size: 1.5ex;
}
div {
padding: 0;
//font-size: $base;
img {
max-width: 95%;
}
}
}
div#img {
display: flex;
justify-content: center;
padding: 0;
}
img {
transition: opacity ease-in-out 200ms;
//float: right;
width: 100%;
overflow-y: hidden;
}
}
.imageshow {
display: grid;
@media screen and (min-width: 768px) {
Expand All @@ -108,6 +73,8 @@ onMounted(async () => {
}
.lazy {
transform: scale(0.2);
//transform: scale(0.2);
height: 10rem;
margin: 5rem;
}
</style>
20 changes: 20 additions & 0 deletions components/CommentSys/Waline.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup>
const props = defineProps({
backend: String,
path: String
})
import { Waline } from '@waline/client/component';
import '@waline/client/dist/waline.css';
</script>
<template>
<Waline :serverURL="props.backend" :path="path" />
</template>
<style>
.wl-panel{
background: transparent;
border: 0;
}
.wl-input,.wl-editor:focus {
background: transparent;
}
</style>
10 changes: 10 additions & 0 deletions components/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,15 @@ if (new Date().getDate() === 3 && Math.random * 1000 < 6) {
:avatar="settings.site.comment.avatar.d"
></LazyCommentSysValine>
</div>
<div v-if="settings.site.comment.backend.type === 'waline'">
<LazyCommentSysWaline
:path="
settings.site.comment.backend.start === ''
? 'chiblog-posts-' + props.pid
: settings.site.comment.backend.start + 'chiblog-posts-' + props.pid
"
:backend="settings.site.comment.backend.url"
></LazyCommentSysWaline>
</div>
</div>
</template>
36 changes: 10 additions & 26 deletions components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ const props = defineProps({
const settings = reactive(props.settings)
</script>
<template>
<footer id="footer-component">
<footer id="footer-component" class="text-md accent-gray-500 max-w-5xl mx-auto">
<div id="footer">
<div id="sys">
<span id="cpr" v-show="settings.site.showcopyright">
<div id="sys" class="flex flex-col">
<div id="cpr" v-show="settings.site.showcopyright">
&copy;{{ settings.site.copyright.startyear }}-{{
new Date().getFullYear()
}} <a :href="settings.site.author.url" target="_blank">{{
settings.site.author.name
}}</a>
</span>
<span v-show="settings.site.showstats">加载{{loadTime }}ms 渲染{{ renderTime }}ms</span>
<span v-show="settings.site.textcount.global">站点总字数:{{ textCount }}</span>
<span v-show="settings.site.count.enabled && settings.site.count.site">
</div>
<div v-show="settings.site.showstats">加载{{loadTime }}ms 渲染{{ renderTime }}ms</div>
<div v-show="settings.site.textcount.global">站点总字数:{{ textCount }}</div>
<div v-show="settings.site.count.enabled && settings.site.count.site">
本站总访问次数:<span id="busuanzi_value_site_pv">加载中...</span>
本站访客数:<span id="busuanzi_value_site_uv">加载中...</span>
</span>
<span>
</div>
<div>
Powered by
<a href="https://chiblog.chinet.work/" target="_blank">chiblog</a>@<small v-if="version.type !== 'dev'">{{ version.version }}({{ version.versionReleaseDate }})</small>
<small v-else> {{ version.version }}(canary) </small>
</span>
</div>
</div>
<span v-if="version.type === 'dev'" style="color: rgb(245, 150, 170);">
站点管理员请注意:您正在使用开发版本(分支dev/镜像标签dev),作为开发版本,仅供测试尝鲜使用,此版本可能并不稳定,内部的许多功能可能会更改,因此不推荐您于生产环境中使用,建议您使用稳定版本(GitHub
Expand Down Expand Up @@ -65,22 +65,6 @@ a:active {
div#sys span {
padding: 2px;
}
#footer {
color: #bbbbbb;
padding-bottom: 8px;
padding-left: 1px;
padding-right: 1px;
backdrop-filter: blur(20px);
@media screen and (min-width: 1024px) {
margin-left: 25%;
margin-right: 25%;
}
}
div#sys {
display: flex;
flex-direction: column;
}
</style>
<style lang="scss">
div#cus {
Expand Down
14 changes: 5 additions & 9 deletions components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const isshow = computed(() => {
// console.log($route.name)
</script>
<template>
<header :id="id" class="trans">
<div id="header-index">
<header class="transition-all text-2xl font-bold p-4 fixed left-0 right-0 top-0 flex justify-between flex-col backdrop-blur-sm">
<div id="header-index" class="backdrop-blur-sm">
<div id="set-mob">
<h2 id="title">
<nuxt-link to="/">{{ settings.site.title }}</nuxt-link>
Expand All @@ -74,14 +74,14 @@ const isshow = computed(() => {
<h2><Icon :name="isshow"/></h2>
</div>
</div>
<div id="pages" :style="{ display: show ? 'block' : 'none' }">
<div id="pages" :style="{ display: show ? 'flex' : 'none' }">
<span v-for="i in pages" :key="i.id">
<div v-if="i.type === 'link'">
<div v-if="i.type === 'link'" class="pr-2 m-1">
<h2 class="page-link">
<a :href="i.url" :target="i.target">{{ i.title }}</a>
</h2>
</div>
<div v-if="i.type === 'article'">
<div v-if="i.type === 'article'" class="pr-2 m-1">
<h2 class="page-link">
<nuxt-link :to="'/' + i.name">{{ i.title }}</nuxt-link>
</h2>
Expand Down Expand Up @@ -176,9 +176,5 @@ const isshow = computed(() => {
font-size: 2em;
}
.trans {
transition: all 300ms ease-in-out;
}
</style>
Loading

0 comments on commit bb7b0d6

Please sign in to comment.