blleng / hexo-theme-lx

👉 A simple & clear & elegant Hexo theme. 🔭🔭Lx——一款简洁、美观的Hexo博客主题。
https://lx.js.org
MIT License
208 stars 26 forks source link

[Help] Cannot Add Social Links at the Front Page #34

Closed AnxietyVendor closed 2 years ago

AnxietyVendor commented 2 years ago

Description

I have read the README and didn't find a _config.yml under ./themes folder.

Adding social link attribute(namely lines related to social links in lx/_config.yml) to ./_config.yml or ./themes/lx/_config.yml doesn't help.

I also tried copying a _config.yml (lines of interest added) under ./themes and it doesn't work. No icon or link can be seen at my blog page :(

github-actions[bot] commented 2 years ago

Thank you! The author will reply to you as soon as possible.

blleng commented 2 years ago

Could you please paste your _config.yml here?

AnxietyVendor commented 2 years ago

This is ./_config.yml

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Title
subtitle: ''
description: ''
keywords:
author: Yingchen Bai
language: en
timezone: ''

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: lx

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: git@github.com:AnxietyVendor/AnxietyVendor.github.io.git
  branch: master

## attributes of lx theme
# social links
#
# links:
# name:
#   icon: fontawesome icon
#   link: url
social:
  enable: true
  links:
    GitHub:
      icon: github
      link: https://github.com/AnxietyVendor
    Instagram:
      icon: instagram
      link: https://www.instagram.com/lil.decaf.white/
  #  Email:
  #    icon: envelope
  #    link: mailto:your@email.address
  #  Weibo:
  #    icon: weibo
  #    link: https://weibo.com/yourname
  #  Twitter:
  #    icon: twitter
  #    link: https://twitter.com/yourname
##
AnxietyVendor commented 2 years ago

This is ./themes/lx/_config.yml

### Welcome to Hexo-Theme-Lx
###Author:blleng(https://github.com/blleng)
###Version:v0.4.3
version: 0.4.3

# favicon
favicon: favicon.ico

# Theme-color for Android Chrome
theme_color: "#58b77a"

# personal information
personal_des: Hello, World!

# avatar
avatar: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/images/avatar.min.jpeg

###The options below are images information
# Home cover
cover: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/images/cover.min.jpeg
# page cover
postcover: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/images/post_cover.min.jpeg
# the cover of newer or older post
pre_post: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/images/footer-r.min.jpeg
nex_post: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/images/footer-l.min.jpeg

# menu content
menu:
  category: false #category
  pages:  #the page created by yourself
    enable: true
    links:
      Guestbook: guestbook/
      About: about/
  friends:
    enable: true
    links:
      Theme-Lx: https://lx.js.org

# social links
#
# links:
# name:
#   icon: fontawesome icon
#   link: url
social:
  enable: true
  links:
    GitHub:
      icon: github
      link: https://github.com/AnxietyVendor
  #  Email:
  #    icon: envelope
  #    link: mailto:your@email.address
  #  Weibo:
  #    icon: weibo
  #    link: https://weibo.com/yourname
  #  Twitter:
  #    icon: twitter
  #    link: https://twitter.com/yourname
    Instagram:
      icon: instagram
      link: https://www.instagram.com/lil.decaf.white/

# local search
#install first:
#'npm install hexo-generator-searchdb -s'
local_search:
  enable: false
  trigger: auto #'auto' or 'manual' 
  top_n_per_article: 1
  unescape: false
  preload: false
  placeholder: Search...

# footer
footer:

# Analytics
google_analytics: #Google ID
baidu_analytics: #Baidu ID

# Lx use valine as comment system
# You should create an application in Leancloud to get the appid and appkey
comment:
  enable: false
  appid:
  appkey:
  notify: false
  verify: false
  placeholder: Say something.
  avatar: identicon
  guest_info: nick,mail,link
  pageSize: 10
  language: en
  cdn: https://cdn.jsdelivr.net/npm/valine@1.4.18/dist/Valine.min.js

# Mathjax
mathjax:
  enable: true
  cdn: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js

# FontAwesome-CDN
font_awesome: https://cdn.jsdelivr.net/npm/font-awesome@4/css/font-awesome.min.css

# Font
font:
  enable: true
  host: https://fonts.googleapis.com
  codes: ##the font for codes
    enable: true
    family: Fira Code
  else:  ##the font for others
    enable: false
    family: Noto Serif SC

# Custom CSS
# If true, Lx will load 'source/css/custom.styl'
custom_css: false

########### Develop Options ############
############# Warning ##################
####### Don't edit options below #######
## unless you know what you are doing ##
############# Warning ##################

#The dir of Js and Css
base_file:
  jquery_cdn: https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js
  js: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/js/
  css: https://cdn.jsdelivr.net/npm/theme-lx@0.4.3/source/dist/css/main.min.css
AnxietyVendor commented 2 years ago

There is a "Edit the themes/_config.yml" in your tutorial but I cannot find that in my ./themes.

blleng commented 2 years ago

I‘m afraid that you need to delete these lines in your site config file:

## attributes of lx theme
# social links
#
# links:
# name:
#   icon: fontawesome icon
#   link: url
social:
  enable: true
  links:
    GitHub:
      icon: github
      link: https://github.com/AnxietyVendor
    Instagram:
      icon: instagram
      link: https://www.instagram.com/lil.decaf.white/
  #  Email:
  #    icon: envelope
  #    link: mailto:your@email.address
  #  Weibo:
  #    icon: weibo
  #    link: https://weibo.com/yourname
  #  Twitter:
  #    icon: twitter
  #    link: https://twitter.com/yourname
##

Or you need to write like this:

theme_config: ### It's important to tell hexo that lines below are config for theme.
  ## attributes of lx theme
  # social links
  #
  # links:
  # name:
  #   icon: fontawesome icon
  #   link: url
  social:
    enable: true
    links:
      GitHub:
        icon: github
        link: https://github.com/AnxietyVendor
      Instagram:
        icon: instagram
        link: https://www.instagram.com/lil.decaf.white/
    #  Email:
    #    icon: envelope
    #    link: mailto:your@email.address
    #  Weibo:
    #    icon: weibo
    #    link: https://weibo.com/yourname
    #  Twitter:
    #    icon: twitter
    #    link: https://twitter.com/yourname
  ##

You should have a _config.yml file under your themes/lx folder, or you can try to delete lx folder and clone again:

git clone https://github.com/blleng/hexo-theme-lx themes/lx
blleng commented 2 years ago

There is a "Edit the themes/_config.yml" in your tutorial

That's not themes/_config.yml. It should be themes/lx/_config.yml.

AnxietyVendor commented 2 years ago

Yes, I edited themes/lx/_config.yml as you said. Still didn't work.

blleng commented 2 years ago

Yes, I edited themes/lx/_config.yml as you said. Still didn't work.

You need to delete those config for theme in the site config file first.

AnxietyVendor commented 2 years ago

OK. I tried hero clean hexo g hero d. Now it works.

blleng commented 2 years ago

Fine.