From ed1621c1c8ebe08b4324a3ccb6cd14765ca8dedd Mon Sep 17 00:00:00 2001 From: Roxie Gibson Date: Wed, 25 Aug 2021 17:29:31 +0100 Subject: [PATCH] customisable headshot --- README.md | 5 +++++ config.toml | 9 ++++++--- themes/sophie-lewis/layouts/_default/single.html | 12 +++++++++++- ...eadshot-masterchief.png => headshot_example.png} | Bin themes/sophie-lewis/theme.toml | 11 ----------- 5 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 README.md rename themes/sophie-lewis/static/img/{example_headshot-masterchief.png => headshot_example.png} (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bfe36b --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ + + +## How to change about me headshot + +Add the headshot image you want to use to the `static/img` directory. Then uncomment the `headshot=` option under `[param.about]`. Set this option to the filename and only the filename. \ No newline at end of file diff --git a/config.toml b/config.toml index 06c80b2..9f5f2e3 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,7 @@ + baseURL = 'http://example.org/' languageCode = 'en-us' -title = 'My New Hugo Site' +title = 'SITENAME' theme = "sophie-lewis" [params] @@ -8,9 +9,11 @@ navbar = ["about", "writing", "videos", "get-in-touch"] [params.header] name = "Sophie Lewis" subtitle = "Writer & Philosopher" + [params.about] + #headshot = +# DON'T EDIT BELOW [markup.goldmark.renderer] -hardWraps = false unsafe = true -xhtml = true \ No newline at end of file +xhtml = true diff --git a/themes/sophie-lewis/layouts/_default/single.html b/themes/sophie-lewis/layouts/_default/single.html index 23ec218..7c893f2 100644 --- a/themes/sophie-lewis/layouts/_default/single.html +++ b/themes/sophie-lewis/layouts/_default/single.html @@ -4,7 +4,17 @@
- + {{ $img := relURL "img/headshot_example.png"}} + {{ if isset $.Site.Params.about "headshot" }} + {{ if fileExists ( printf "static/img/%s" $.Site.Params.about.headshot ) }} + {{ $img := relURL ( printf "img/%s" $.Site.Params.about.headshot )}} + + {{ else }} + + {{ end }} + {{ else }} + + {{ end }}
diff --git a/themes/sophie-lewis/static/img/example_headshot-masterchief.png b/themes/sophie-lewis/static/img/headshot_example.png similarity index 100% rename from themes/sophie-lewis/static/img/example_headshot-masterchief.png rename to themes/sophie-lewis/static/img/headshot_example.png diff --git a/themes/sophie-lewis/theme.toml b/themes/sophie-lewis/theme.toml index 3b1b362..4ee41f4 100644 --- a/themes/sophie-lewis/theme.toml +++ b/themes/sophie-lewis/theme.toml @@ -2,20 +2,9 @@ # See https://github.com/gohugoio/hugoThemes#themetoml for an example name = "Sophie Lewis" -license = "MIT" -licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" description = "" -homepage = "http://example.com/" -tags = [] -features = [] min_version = "0.41.0" [author] name = "" homepage = "" - -# If porting an existing theme -[original] - name = "" - homepage = "" - repo = ""