onweru / hugo-swift-theme

A simple open source theme for publishing with hugo
https://neuralvibes.com/
Other
120 stars 64 forks source link

authors #69

Closed vahidtakro closed 3 years ago

vahidtakro commented 3 years ago

hello, authors yaml file is no longer working/removed.

onweru commented 3 years ago

That's right @vahidtakro, use the config instead https://github.com/onweru/hugo-swift-theme/blob/462712b575341639e7a465857ed66c27578de30b/exampleSite/config.toml#L18-L23

vahidtakro commented 3 years ago

Thanks for this amazing theme, and fast reply. The other questions in my mind is that can I use staticman on my own server and not Github servers? if yes how? if not, what other alternative can I use? and how can I add post meta to the single post? like date of publish, author, etc on the top.

onweru commented 3 years ago

https://github.com/onweru/hugo-swift-theme/wiki/staticman-config

danihazler commented 3 years ago

That's right @vahidtakro, use the config instead

https://github.com/onweru/hugo-swift-theme/blob/462712b575341639e7a465857ed66c27578de30b/exampleSite/config.toml#L18-L23

I added these to my config.toml but I still can't see the author.

on my post :

---
title: "About this blog"
date: 2021-03-11T12:45:28Z
draft: false
author: "Dani Hazler" // also tried name
---
onweru commented 3 years ago

@danihazler, Would you mind if I had a look at your config?

danihazler commented 3 years ago

@danihazler, Would you mind if I had a look at your config?

sure! didn't change much from what you have on exampleSite

baseurl = "https://myURLofChoice.domain/"  # Include trailing slash
title = "Dev Blog"
theme = "hugo-swift-theme"
# theme = "swift"
author = "Steve Francia"
copyright = "Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved."
canonifyurls = true
paginate = 4
# Enable syntax highlighting
# comment on delete the following lines 11 ~ 13
pygmentsCodefences = true
pygmentsCodefencesGuessSyntax = true

[params]
  [params.designer]
    name = "Weru"
    url = "https://www.linkedin.com/in/dan-weru-profile/"
  [[params.authors]]
    name = "yourName" # can be nickname # if fullName 👇🏻 isn't set, name will be displayed on author card
    fullName = "Your Full Name" # optional. If set, it will display on author card
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "author_placeholder.png"
    url = "https://myURLofChoice.domain"

  # logo = "logo.png"
  # author = "Weru" # default author
  # image = "placeholder-image.png" # used whenever a page image is not set
  # blogDir = "blogFolderName" # uncomment and edit to exclude normal pages ... see issue #57
# [params.staticman]
#   endpoint = ""  # URL of your own API deployment (without trailing slash), default: "https://staticman-frama.herokuapp.com"
#   gitProvider = "github"  # Either "github" or "gitlab"
#   username = "username"  # GitHub/GitLab user name
#   repository = "repo"  # GitHub/GitLab user name
#   branch = "master"  # Branch holding the source code for your site, should match the `branch` parameter in `staticman.yml`
#
#   # If you use reCAPTCHA v2, you must also set these parameters in staticman.yml
#   [Params.staticman.reCaptcha]
#     siteKey = ""  # Use your own site key, you need to apply for one on Google
#     secret  = ""  # ENCRYPT your password by going to https://<staticman-endpoint>/v3/encrypt/<your-site-secret>

[menu]
  [[menu.main]]
    name = "Home"
    url = "/"
    weight = 2
  [[menu.main]]
    name = "Development"
    url = "categories/development/"
    weight = 3
  [[menu.main]]
    name = "Backend"
    url = "categories/backend/"
    weight = 4
  [[menu.main]]
    name = "Frontend"
    url = "categories/frontend/"
    weight = 5

Thanks for your help

onweru commented 3 years ago

Thank you; this is helpful. So what you need to do, is ensure that the author name you're including in your article is listed under the authors' block. In you case, it would looks something like:

...
[[params.authors]]
    name = "yourName" # can be nickname # if fullName 👇🏻 isn't set, name will be displayed on author card
    fullName = "Dani Hazler"
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "author_placeholder.png"
    url = "https://myURLofChoice.domain
...

Notice the value of fullName has changed to your name. Makes sense?

If you do not want to display your full name on the article. your can optionally fill in the name field, like so:

[[params.authors]]
    name = "Hazler" # or name = "Dani"
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "author_placeholder.png"
    url = "https://myURLofChoice.domain
danihazler commented 3 years ago

Thank you; this is helpful. So what you need to do, is ensure that the author name you're including in your article is listed under the authors' block. In you case, it would looks something like:

...
[[params.authors]]
    name = "yourName" # can be nickname # if fullName 👇🏻 isn't set, name will be displayed on author card
    fullName = "Dani Hazler"
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "author_placeholder.png"
    url = "https://myURLofChoice.domain
...

Notice the value of fullName has changed to your name. Makes sense?

If you do not want to display your full name on the article. your can optionally fill in the name field, like so:

[[params.authors]]
    name = "Hazler" # or name = "Dani"
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "author_placeholder.png"
    url = "https://myURLofChoice.domain

Oh... I see, thank you so much!