From 9abb990b41d3a18948b4fafec86db014f91dc3d4 Mon Sep 17 00:00:00 2001 From: Problem233 Date: Tue, 12 Jul 2016 19:20:36 +0800 Subject: [PATCH] logo and avatar can be round --- _config.yml.example | 2 ++ source/css/_partial/profile.styl | 4 ++++ source/css/_variables.styl | 2 ++ source/css/style.styl | 2 ++ 4 files changed, 10 insertions(+) diff --git a/_config.yml.example b/_config.yml.example index acd09b1..c4370d1 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -13,9 +13,11 @@ customize: width: 40 height: 40 url: images/logo.png + round: true profile: enabled: true # Whether to show profile bar avatar: css/images/avatar.png + avatar_round: true gravatar: # Gravatar email address, if you enable Gravatar, your avatar config will be overriden author: PPOffice author_title: Web Developer & Designer diff --git a/source/css/_partial/profile.styl b/source/css/_partial/profile.styl index 74170b6..0a51bfd 100644 --- a/source/css/_partial/profile.styl +++ b/source/css/_partial/profile.styl @@ -1,3 +1,5 @@ +@import "../_variables" + .bio text-align: center @@ -33,6 +35,8 @@ margin: 10px auto 20px width: profile-avatar-size height: profile-avatar-size + if profile-avatar-round + border-radius: 50% #name, #title, #location display: block text-align: center diff --git a/source/css/_variables.styl b/source/css/_variables.styl index 76a56ed..dafd162 100644 --- a/source/css/_variables.styl +++ b/source/css/_variables.styl @@ -27,6 +27,7 @@ header-sub-height = 48px logo-url = hexo-config("customize.logo.url") logo-width = 0px + hexo-config("customize.logo.width") logo-height = 0px + hexo-config("customize.logo.height") +logo-round = hexo-config("customize.logo.round") // Sidebar sidebar = hexo-config("customize.sidebar") @@ -35,6 +36,7 @@ thumbnail-default-small = 'images/thumb-default-small.png' // Profile bar profile = hexo-config("customize.profile.enabled") profile-avatar-size = 128px +profile-avatar-round = hexo-config("customize.profile.avatar_round") // Layout block-margin = 40px diff --git a/source/css/style.styl b/source/css/style.styl index ac0d691..3ecf4b3 100644 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -59,6 +59,8 @@ code background-repeat: no-repeat background-image: url(logo-url) background-size: logo-width logo-height + if logo-round + border-radius: 50% #container position: relative