Skip to content

Commit

Permalink
第二次大修改
Browse files Browse the repository at this point in the history
  • Loading branch information
twbworld committed May 14, 2020
1 parent 447414b commit 13a80e5
Show file tree
Hide file tree
Showing 38 changed files with 2,799 additions and 308 deletions.
9 changes: 8 additions & 1 deletion assets/js/academic.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,14 @@
// Filter projects.
$('.projects-container').each(function (index, container) {
let $container = $(container);
let $section = $container.closest('section');
/*===============此处有修改=====================begin*/
// let $section = $container.closest('section');
let $section;
$section = $container.closest('section');
if ($section.length <= 0) {
$section = $container.closest('body');
}
/*===============此处有修改=====================end*/
let layout;
if ($section.find('.isotope').hasClass('js-layout-row')) {
layout = 'fitRows';
Expand Down
40 changes: 30 additions & 10 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enableGitInfo = true

# Default language to use (if you setup multilingual support)
defaultContentLanguage = "zh"
hasCJKLanguage = true # Set `true` for Chinese/Japanese/Korean languages.
hasCJKLanguage = true # 关系到summaryLength)Set `true` for Chinese/Japanese/Korean languages.
defaultContentLanguageInSubdir = false
removePathAccents = true # Workaround for https://github.com/gohugoio/hugo/issues/5687

Expand All @@ -45,12 +45,14 @@ footnotereturnlinkcontents = "<sup>^</sup>"
ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]

# Workaround Hugo publishing taxonomy URLs as plurals - consistently use singular across Academic.
# 如果index.md没有设置slug,那么默认slug等于title,由于title是文章标题可能是中文,中文不利于 用在url 以及 SEO;其次文章标题可能多变,而目录名不多变以及url和目录名恰好要求是唯一的;所以这里干脆用filename,即目录名(程序员一般不会起中文名的目录)
# 也可以在index.md设置"url"参数,自定义url
[permalinks]
authors = "/author/:slug/"
tags = "/tag/:slug/"
categories = "/category/:slug/"
publication_types = "/publication-type/:slug/"
post = "/post/:year/:month/:day/:slug"
authors = "/author/:filename/"
tags = "/tag/:filename/"
categories = "/category/:filename/"
publication_types = "/publication-type/:filename/"
post = "/post/:year/:month/:day/:filename"

[outputs]
home = [ "HTML", "RSS", "JSON", "WebAppManifest" ]
Expand All @@ -69,10 +71,11 @@ ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "
[markup.goldmark.renderer]
unsafe = true # Enable user to embed HTML snippets in Markdown content.
[markup.highlight]
codeFences = false # Disable Hugo's code highlighter as it conflicts with Academic's highligher.
codeFences = true # Disable Hugo's code highlighter as it conflicts with Academic's highligher.
[markup.tableOfContents]
startLevel = 2
endLevel = 3
ordered = false # 有序列表

[imaging]
resampleFilter = "lanczos"
Expand All @@ -82,6 +85,23 @@ ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "
# Taxonomies.
[taxonomies]
tag = "tags"
category = "categories"
publication_type = "publication_types"
author = "authors"
#category = "categories"
#publication_type = "publication_types"
#author = "authors"

# 文章底部的"相关"
# https://s0gohugo0io.icopy.site/content-management/related/
[related]
threshold = 80
includeNewer = true
toLower = true
[[related.indices]]
name = "keywords"
weight = 200
[[related.indices]]
name = "tags"
weight = 160
[[related.indices]]
name = "date"
weight = 10
pattern = "2006"
6 changes: 4 additions & 2 deletions config/_default/menus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# weight就是排序)The weight parameter defines the order that the links will appear in.

[[main]]
name = "首页"
name = " "
url = "#hero"
pre = "<i class='fa fa-home big-icon' title='首页'></i>"
weight = 10

[[main]]
name = "博客"
name = ""
url = "post"
pre = "<i class='fa fa-list-ul big-icon' title='博客'></i>"
weight = 21
# parent= '博客'

Expand Down
15 changes: 11 additions & 4 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ plugins_js = []
# 2: Algolia (https://www.algolia.com)
engine = 1

# 在什么页面显示搜索icon
show_in = ["/post/"]
# 在什么页面关闭搜索icon,判断type
unable_type = ["page"]

# Configuration of Algolia search engine.
# Paste the values from your Algolia dashboard.
Expand Down Expand Up @@ -292,8 +292,8 @@ plugins_js = []


# <!-- 此处有修改 -->
# <!-- 底部背景,此处自行添加的 -->
[home_floor]
# <!-- 首页背景,此处自行添加的 -->
[home_background]
# Apply a background color, gradient, or image.
# Uncomment (by removing `#`) an option to apply it.
# Choose a light or dark text color by setting `text_color_light`.
Expand All @@ -315,3 +315,10 @@ plugins_js = []

# Text color (true=light or false=dark).
text_color_light = false

# <!-- 此处有修改 -->
# <!-- 看板娘配置 -->
[live2d_config]
enable = true
position = "right"
unable_type = ["page"]
5 changes: 3 additions & 2 deletions content/home/featured.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subtitle = ""

[content]
# Page type to display. E.g. post, talk, or publication.
page_type = "publication"
page_type = "post"

# Choose how much pages you would like to display (0 = all pages)
count = 0
Expand All @@ -22,9 +22,10 @@ subtitle = ""
order = "desc"

# Show a "See all pages" link underneath the featured content?
link_to_archive = false
link_to_archive = true

# Filter posts by a taxonomy term.
# 字符串以空格分隔
[content.filters]
tag = ""
category = ""
Expand Down
8 changes: 4 additions & 4 deletions content/home/hero.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ title = ""
# color = "navy"

# Background gradient.
gradient_start = "#4bb4e3"
gradient_end = "#2b94c3"
#gradient_start = "#4bb4e3"
#gradient_end = "#2b94c3"

# Background image.
image = "https://cdn.jsdelivr.net/gh/twbworld/hosting@master/img/20200505231535.jpg" # Name of image in `static/img/`.
image = "" # Name of image in `static/img/`.
image_darken = 0.4 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
image_size = "cover" # Options are `cover` (default), `contain`, or `actual` size.
image_position = "center" # Options include `left`, `center` (default), or `right`.
Expand Down Expand Up @@ -57,7 +57,7 @@ title = ""
# Note. An optional note to show underneath the links.
[cta_note]
#label = '<a class="js-github-release" href="https://sourcethemes.com/academic/updates" data-repo="gcushen/hugo-academic">Latest release<!-- V --></a>'
label = '<div style="height: 500px;width: 1px;"></div>'
label = '<div style="height: 200px;width: 1px;"></div>'
+++

<!-- **The Best Way to Create the Website You Want from Markdown (or Jupyter/RStudio)**
Expand Down
14 changes: 9 additions & 5 deletions content/home/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ subtitle = ""
# Page order. Descending (desc) or ascending (asc) date.
order = "desc"

# Show a "See all pages" link underneath the featured content?
link_to_archive = true

show_filter_button = false

# Default filter index (e.g. 0 corresponds to the first `[[filter_button]]` instance below).
filter_default = 0

# Filter posts by a taxonomy term.
[content.filters]
tag = ""
category = ""
publication_type = ""
author = ""
exclude_featured = false

# Default filter index (e.g. 0 corresponds to the first `[[filter_button]]` instance below).
filter_default = 0

[[content.filter_button]]
name = "All"
Expand Down Expand Up @@ -71,7 +75,7 @@ subtitle = ""
# gradient_end = "SkyBlue"

# Background image.
image = "https://cdn.jsdelivr.net/gh/twbworld/hosting@master/img/20200505231535.jpg" # Name of image in `static/img/`.
image = "" # Name of image in `static/img/`.
image_darken = 0.4 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
image_size = "cover" # Options are `cover` (default), `contain`, or `actual` size.
image_position = "center" # Options include `left`, `center` (default), or `right`.
Expand Down
25 changes: 25 additions & 0 deletions content/post/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,29 @@ view: 2
header:
caption: ""
image: "https://cdn.jsdelivr.net/gh/twbworld/hosting@master/img/20200506002156.jpg"


content:
# Page type to display. E.g. post, talk, or publication.
page_type: "post"

# Choose how much pages you would like to display (0 = all pages)
count: 5

# Choose how many pages you would like to offset by
offset: 0

# Page order. Descending (desc) or ascending (asc) date.
order: "desc"

show_filter_button: true

# 默认显示tag("\*"表示显示所有)
filter_default_tag: "*"

# Show a "See all pages" link underneath the featured content?
# link_to_archive: true



---
File renamed without changes
Loading

0 comments on commit 13a80e5

Please sign in to comment.