font-family

master
xaoxuu 4 years ago
parent 37a14208b5
commit 3ccbc726ab
  1. 29
      _config.yml
  2. 2
      layout/_meta/category.ejs
  3. 2
      layout/_partial/head.ejs
  4. 2
      layout/_partial/scripts.ejs
  5. 54
      source/css/_defines/fonts.styl
  6. 1
      source/css/_layout/cover.styl

@ -3,13 +3,12 @@ info:
name: Volantis # This is theme's name, not your blog's name.
version: '2.4.3' # This is theme's version.
docs: https://volantis.js.org/ # This is theme's URL.
cdn: # To use CDN, write 'use_cdn: true' in 'blog/_config.yml'.
css: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.4.3/css/style.css
js: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.4.3/js/app.js
cdn:
css:
js:
############################### Style ###############################
# cdn.css must be closed
style:
max_width: 1080px # Sum of body width and sidebar width (This limit will be exceeded when the device width is greater than 2000px, reaching 75% of the total width)
scrollbar:
@ -62,16 +61,24 @@ style:
code: .8125rem
footnote: .75rem
fontfamily:
bodyfont:
logofont:
fontfamily: '"Varela Round"'
name: 'Varela Round'
url: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts/VarelaRound/VarelaRound-Regular.ttf
weight: normal
style: normal
# codefont:
# name: 'Monaco'
# url: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts/Monaco/Monaco.ttf
# weight: normal
# style: normal
bodyfont:
fontfamily: '"UbuntuMono"'
name: 'UbuntuMono'
url: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@20.2.27/UbuntuMono/UbuntuMono-Regular.ttf
weight: normal
style: normal
codefont:
fontfamily: 'Menlo, Monaco'
# name: 'Monaco'
# url: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts/Monaco/Monaco.ttf
# weight: normal
# style: normal
# color:
# site: '#21232F' # Website background color
# site_inner: '#fff' # Text color inside the website background
@ -146,7 +153,7 @@ navbar:
- name: 关于
icon: fas fa-info-circle
url: about/
search: 搜索 # Search bar placeholder
search: Search... # Search bar placeholder

@ -10,7 +10,7 @@
<div class='new-meta-item category'>
<a href='<%- url_for(path) %>' rel="nofollow">
<i class="<%- theme.meta.category.icon %> fa-fw" aria-hidden="true"></i>
<p><%- cats.join('&nbsp;/&nbsp;') %></p>
<p><%- cats.join('/') %></p>
</a>
</div>
<% } %>

@ -110,7 +110,7 @@
<%- css(theme.plugins.highlightjs.css) %>
<% } %>
<% } %>
<% if (config.use_cdn && theme.info && theme.info.cdn && theme.info.cdn.css) { %>
<% if (theme.info.cdn && theme.info.cdn.css) { %>
<%- css(theme.info.cdn.css) %>
<% } else { %>
<%- css('css/style.css') %>

@ -207,7 +207,7 @@
</script>
<% } %>
<% if (config.use_cdn && theme.info && theme.info.cdn && theme.info.cdn.js) { %>
<% if (theme.info.cdn && theme.info.cdn.js) { %>
<%- js(theme.info.cdn.js) %>
<% } else { %>
<%- js(['js/app.js']) %>

@ -1,27 +1,41 @@
// body font
$fontfamily = "Microsoft YaHei", "Source Sans Pro", "Helvetica Neue", Menlo, Monaco, monospace, "Lucida Console", sans-serif, Helvetica, "Hiragino Sans GB", "Hiragino Sans GB W3", Source Han Sans CN Regular, WenQuanYi Micro Hei, Arial, sans-serif
// inline code & codeblock font
$fontfamily-code = Menlo, Monaco, courier, monospace, "Lucida Console", 'Source Code Pro', "Microsoft YaHei", Helvetica, Arial, sans-serif, 'Ubuntu'
$fontfamily = "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Menlo, Monaco, monospace, "Lucida Console", sans-serif
if hexo-config('style.fontfamily.bodyfont')
@font-face
font-family: hexo-config('style.fontfamily.bodyfont.name')
src: url(hexo-config('style.fontfamily.bodyfont.url'))
font-weight: hexo-config('style.fontfamily.bodyfont.weight')
font-style: hexo-config('style.fontfamily.bodyfont.style')
$fontfamily = hexo-config('style.fontfamily.bodyfont.name'), $fontfamily
if hexo-config('style.fontfamily.bodyfont.name')
@font-face
font-family: hexo-config('style.fontfamily.bodyfont.name')
src: url(hexo-config('style.fontfamily.bodyfont.url'))
font-weight: hexo-config('style.fontfamily.bodyfont.weight')
font-style: hexo-config('style.fontfamily.bodyfont.style')
if hexo-config('style.fontfamily.bodyfont.fontfamily')
$fontfamily = convert(hexo-config('style.fontfamily.bodyfont.fontfamily')), Menlo, Monaco, monospace, sans-serif
$fontfamily-code = Menlo, Monaco, monospace, courier, sans-serif
if hexo-config('style.fontfamily.codefont')
@font-face
font-family: hexo-config('style.fontfamily.codefont.name')
src: url(hexo-config('style.fontfamily.codefont.url'))
font-weight: hexo-config('style.fontfamily.codefont.weight')
font-style: hexo-config('style.fontfamily.codefont.style')
$fontfamily-code = hexo-config('style.fontfamily.codefont.name'), $fontfamily-code
// logo font
if hexo-config('style.fontfamily.codefont.name')
@font-face
font-family: hexo-config('style.fontfamily.codefont.name')
src: url(hexo-config('style.fontfamily.codefont.url'))
font-weight: hexo-config('style.fontfamily.codefont.weight')
font-style: hexo-config('style.fontfamily.codefont.style')
if hexo-config('style.fontfamily.codefont.fontfamily')
$fontfamily-code = convert(hexo-config('style.fontfamily.codefont.fontfamily')), monospace, courier, sans-serif
$fontfamily-logo = $fontfamily
if hexo-config('style.fontfamily.logofont')
if hexo-config('style.fontfamily.logofont.name')
@font-face
font-family: hexo-config('style.fontfamily.logofont.name')
src: url(hexo-config('style.fontfamily.logofont.url'))
font-weight: hexo-config('style.fontfamily.logofont.weight')
font-style: hexo-config('style.fontfamily.logofont.style')
if hexo-config('style.fontfamily.logofont.fontfamily')
$fontfamily-logo = convert(hexo-config('style.fontfamily.logofont.fontfamily')), Helvetica, monospace
// font size
$fontsize = convert(hexo-config('style.fontsize.root')) || 16px

@ -64,6 +64,7 @@
justify-content: center
max-width: 100%
.title
font-family: $fontfamily-logo
font-size: $fontsize-large
line-height: 1.2
.subtitle

Loading…
Cancel
Save