Blog on hugo way

Learn how to blog with hugo

Blog on hugo way

Learn how to blog with hugo

setup for gitlab

tee .gitlab-ci.yml << EOF
image: monachus/hugo

variables:
  GIT_SUBMODULE_STRATEGY: recursive

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - master
EOF

git init
echo "/public" >> .gitignore  

post

hugo new post//index.md

deploy

hugo publish the public to web server

Configuration Lookup Order

confit/_default/

  1. ./config.toml
  2. ./config.yaml
  3. ./config.json

confit/_default/config.toml

  • hugo build destination

    publishDir
    
  • Number of items per page in paginated lists

    paginate = 20  
    
  • taxonomies

    • by tag
    • by author

      tag = "tags"
      author = "authors"
      

confit/_default/menus.toml

  • Navigation Links widget enable/disabl under content/home/ folder
  • Navigation Links widget display order

    weight = 1
    

config/_default/languages.toml

多语言显示

languageCode = "en-us"
languageCode = "zh-Hans"

Blog set

content/post/_index.md

  • post view as Card

    view = 3
    

content/home/posts.md

  • Number of recent posts to list.

    count = 20
    

theme

https://sourcethemes.com/academic/zh/docs/page-builder/#icons