initial commit

This commit is contained in:
FarseaSH 2021-08-05 13:38:08 +08:00
commit d4097e8b0e
46 changed files with 525 additions and 0 deletions

20
LICENSE Normal file
View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2021 FarseaSH
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

39
archetypes/moments.md Normal file
View file

@ -0,0 +1,39 @@
---
# 名称
name:
avatar:
# 发布时间
date: {{ .Date }}
# 给Moment添加标签
tags:
-
-
# 附加信息类型1:单个图片
pic:
# 附加信息类型2:图片组
pic_set:
-
-
# 附加信息类型3:链接
link:
link_logo:
link_text:
# 备注信息
note:
---
====================
微信: wechat.svg
b站:bilibili.png
知乎:zhihu.svg
====================

0
layouts/404.html Normal file
View file

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
{{ partial "head.html" . }}
</head>
<body>
<div class="page">
{{ partial "header.html" . }}
{{ block "main" . }}
{{ end }}
<!-- Pagination -->
<nav aria-label="Page navigation .pagination-lg">
<ul class="pagination justify-content-center">
{{ block "pagination" . }}
{{ end }}
</ul>
</nav>
{{ partial "footer.html" . }}
</div>
{{ partial "after-content-js.html" . }}
</body>
</html>

View file

View file

39
layouts/index.html Normal file
View file

@ -0,0 +1,39 @@
{{ define "main" }}
<div class="container bodycontainer">
{{ range .Paginator.Pages }}
{{ partial "row.html" . }}
{{ end }}
</div>
{{ end }}
{{ define "pagination" }}
{{ if .Paginator.HasPrev }}
<li class="page-item">
<a class="page-link" href="{{$.Site.BaseURL}}/{{sub .Paginator.PageNumber 1 }}" tabindex="-1">Previous</a>
</li>
{{ else }}
<li class="page-item disabled">
<a class="page-link" href="{{$.Site.BaseURL}}/{{sub .Paginator.PageNumber 1 }}" tabindex="-1">Previous</a>
</li>
{{ end }}
{{ $current_num := .Paginator.PageNumber }}
{{ range (seq 1 .Paginator.TotalPages) }}
{{ if (eq $current_num .)}}
<li class="page-item active"><a class="page-link" href="{{$.Site.BaseURL}}/{{.}}">{{.}}</a></li>
{{ else }}
<li class="page-item"><a class="page-link" href="{{$.Site.BaseURL}}/{{.}}">{{.}}</a></li>
{{ end }}
{{end}}
{{ if .Paginator.HasNext }}
<li class="page-item">
<a class="page-link" href="{{$.Site.BaseURL}}/{{ add .Paginator.PageNumber 1 }}">Next</a>
</li>
{{ else }}
<li class="page-item disabled">
<a class="page-link" href="{{$.Site.BaseURL}}/{{ add .Paginator.PageNumber 1 }}">Next</a>
</li>
{{ end }}
{{ end }}

View file

@ -0,0 +1,12 @@
<!-- Like button -->
<script>
$("i").click(function(){
if ($(this).attr("red") == 'true'){
$(this).animate({color:"#808080"});
$(this).attr("red", false);
} else {
$(this).animate({color:"#ff0000"});
$(this).attr("red", true);
}
});
</script>

View file

@ -0,0 +1,5 @@
<footer class="footer mt-auto py-3">
<div class="container footcontainer">
<div class="text-muted">Powered by <a href="https://www.hugo.io">Hugo</a> | Theme <a href="hhttps://github.com/FarseaSH/hugo-theme-moments">Moments</a></div>
</div>
</footer>

View file

@ -0,0 +1,35 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- 点赞 -->
<link href="https://cdn.bootcss.com/font-awesome/5.8.2/css/all.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- favicon -->
<link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- the Moments style css file -->
<link rel="stylesheet" type="text/css" href="/css/style.css">
<!-- website title -->
<title>{{ .Site.Params.title }}</title>

View file

@ -0,0 +1,7 @@
<div class="jumbotron jumbotron-fluid" style="background-image: url({{ .Site.Params.cover }});
background-position: center center;background-size: cover; min-height: 200px; text-align: center">
<div class="container">
<h1 class="display-4 text-secondary">{{ .Site.Params.title }}</h1>
<p class="lead text-black-50">{{ .Site.Params.signature }}</p>
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="share-link-block">
<table class="link-table">
<tr>
<td>
<img src="\link-logos\default_link_logo.png" class="link-logo">
</td>
<td style="padding-left: 20px">
<a href="{{ .a }}">{{.word}}</a>
</td>
</tr>
</table>
</div>

View file

@ -0,0 +1,33 @@
<!-- START -->
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
{{range $num,$a := .pic_set}}
{{if eq $num 0 }}
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
{{ else }}
<li data-target="#carouselExampleIndicators" data-slide-to="{{$num}}"></li>
{{ end }}
{{end}}
</ol>
<div class="carousel-inner">
{{range $num,$a := .pic_set}}
{{if eq $num 0 }}
<div class="carousel-item active">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
</div>
{{else}}
<div class="carousel-item">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
</div>
{{end}}
{{end}}
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

84
layouts/partials/row.html Normal file
View file

@ -0,0 +1,84 @@
<div class="row">
<!-- 时间 -->
<div class="col-sm-4 time">
<h2>{{ .Date.Format "Jan 2"}}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }}</h2>
<h4>{{ .Date.Format "2006"}}</h4>
</div>
<!-- 正文 -->
<div class="col-sm-8">
<!-- 抬头 -->
<!-- 头像前面margin2px -->
<div style="margin-top: 2px;">
{{ with .Params.avatar }}
<img src='{{ . }}' class="avatar">
{{ else }}
<img src='{{ .Site.Params.avatar}}' class="avatar">
{{ end }}
<div class="intro">
{{ with .Params.name }}
<h4 class="text-primary name">{{ . }}</h4>
{{ else }}
<h4 class="text-primary name">{{ .Site.Params.name }}</h4>
{{ end }}
<div>
{{ $tags_filtered := slice}}
{{ with .Params.tags }}
{{ range . }}
{{ with .}}
{{ $tags_filtered = $tags_filtered | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ with $tags_filtered }}
{{ range . }}<span class="tag text-muted">{{ . }}</span>{{ end }}
{{ end }}
</div>
</div>
</div>
<!-- 抬头后面内容右平移5px,与头像兼容显得自然 -->
<div style="padding-left: 5px; padding-right: 5px;">
<!-- 文字 -->
<div class="context">
{{ .Content }}
</div>
<!-- 图片 -->
{{ with .Params.pic }}
<img src="{{ . }}" class="img-fluid pic1" alt="Responsive image"></img>
{{ end }}
<!-- 图片集 -->
{{ $pic_set_filtered := slice}}
{{ with .Params.pic_set }}
{{ range . }}
{{ with .}}
{{ $pic_set_filtered = $pic_set_filtered | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ with $pic_set_filtered }}
{{ partial "pic_set.html" (dict "pic_set" .) }}
{{ end }}
{{ $link_link := .Params.link }}
{{ $link_logo := .Params.link_logo }}
{{ $link_text := .Params.link_text }}
{{ with .Params.link }}
{{ partial "link-block.html" (dict "logo" $link_logo "a" $link_link "word" $link_text)}}
{{ end }}
<!-- 附注信息 -->
<div>
<p class="text-black-50 note">
{{ .Date.Format "15:04" }} {{ .Params.note }}
</p>
<i class="far fa-heart" style="float: right; margin-right: 5px; color:#808080"></i>
</div>
</div>
<!-- 分隔线 -->
<hr style="clear: both">
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="share-link-block">
<table class="link-table">
<tr>
<td>
<img src="\logo\{{ .Get "logo" }}" class="link-logo" >
</td>
<td style="padding-left: 20px">
<a href="{{ .Get "a" }}">{{.Inner}}</a>
</td>
</tr>
</table>
</div>

135
static/css/style.css Normal file
View file

@ -0,0 +1,135 @@
/* 主框架 */
body{
background-color: #f5f5f5;
}
.page{
max-width: 1150px;
margin: auto;
background-color: white;
}
@media (min-width:1150px) {
.page{
margin-top: 50px;
}
}
.bodycontainer{
max-width: 760px;
/* padding-right: 80px; */
}
/* 时间 */
.time{
text-align: right;
padding-right: 60px;
/* white-space: nowrap; */
}
@media (max-width: 576px){
.time{
text-align: center;
padding-right: 15px;
}
}
@media (max-width: 720px) and (min-width:576px){
.time{
padding-right: 20px;
}
}
/* 抬头 */
.avatar{
max-height: 45px;
float: left;
margin-bottom: 10px;
}
.intro{
float: left;
padding-left: 5px;
}
.name{
color:#186D9C!important;
margin-bottom: 0;
line-height: 1.1;
}
.tag::before{
content:"#"
}
.tag{
font-size: 80%;
margin-left: 0px;
margin-right: 10px;
}
/* 正文 */
.context{
clear: left;
margin-bottom: 10px;
}
/* 图片 */
.pic1{
max-width: 80%;
max-height: 250px;
padding-bottom:10px;
margin-top: 5px;
}
/* 图片集 */
#carouselExampleIndicators{
width: 80%;
padding-bottom:10px;
margin-top: 5px;
}
.pic-in-set{
height: 250px;
}
/* 内容附带的超链接 */
.share-link-block{
padding-bottom:10px;
padding-top:10px;
margin-bottom:10px;
background: #f7f7f7;
}
.link-table{
margin-left: 10%;
max-width: 80%;
}
.link-logo{
max-width: 50px;
max-height: 50px;
}
.share-link-block a{
color:#17a2b8;
word-wrap: break-word;
}
/* 附注信息 */
.note{
font-size: 80%;
text-indent: 20px;
float: left;
margin-bottom: 10px;
}
/* footer底注 */
.footer {
background-color: #f5f5f5;
text-align: center;
font-size: 95%;
}
.footcontainer {
width: auto;
padding-right: 15px;
padding-left: 15px;
}
.footcontainer a{
text-decoration: underline !important;
color:#6c757d !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/favicon/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

21
theme.toml Normal file
View file

@ -0,0 +1,21 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Moments"
license = "MIT"
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
description = ""
homepage = "http://example.com/"
tags = []
features = []
min_version = "0.41"
[author]
name = ""
homepage = ""
# If porting an existing theme
[original]
name = ""
homepage = ""
repo = ""