vjeantet / hugo-theme-casper Goto Github PK
View Code? Open in Web Editor NEWCasper theme ported to Hugo
License: MIT License
Casper theme ported to Hugo
License: MIT License
I have a problem with displaying author info in the post index when using multiple author.
I have correctly placed yaml file to configure an author as per README.
But the current code for displaying the author did not work.
I replaced the highlighted code with the following, and now the author is displaying correctly.
{{$author := or (index .Site.Data.authors .Params.author) .Site.Params.author }}
The issue is that $author
is .Site.Params.author
even when the multiple author is configured.
I have confirmed that the innermost conditional is being reached. But still, $author
defined on line 10 is not being overwritten.
Any ideas?
Does anyone know of a way to limit the amount of text that is shown in the preview?
I don't know much about web development, so there might be a simple work around.
Thanks!
Hi, I'm new to go and don't really understand this error message. Is it related to the Casper theme or the Hugo framework?
$ hugo --theme=casper
Started building sites ...
ERROR: 2017/02/19 11:12:48 general.go:236: theme/partials/semantic.html is an incomplete or empty template
Built site for language en:
0 draft content
0 future content
0 expired content
2 regular pages created
2 other pages created
0 non-page files copied
2 paginator pages created
0 tags created
0 categories created
total in 167 ms
Thanks.
Hello! I can't add a about page
I get 404 page not found
Any help?
There is a CSS-class that triggers a menu on the subscribe-button.
Maybe it's best to have a "menu conditional" also on the Javascript snippet that registers the onclick handler?
Hi
Great template thanks.
Is there a way to disable more options for instance bio. In my about page I don't want author, bio etc.
.RSSLink makes sense on Nodes, but is empty on pages. Maybe add a conditional that returns the site RSS when on a single page?
I have ported in a number of articles from an old, old weblog and now I have 80+ pages of pagination. Needless to say this isn't an ideal setup.
One thing I've done in previous blogs is have some kind of pagination by month or year. Is it possible in Casper to do this?
As in the Hugo themes demo:
ERROR: 2016/04/08 22:36:36 template.go:131: template: theme/partials/li.html:10:21: executing "theme/partials/li.html" at <index .Site.Data.aut...>: error calling index: value is nil; should be of type string in theme/partials/li.html
ERROR: 2016/04/08 22:36:36 template.go:131: template: theme/partials/li.html:10:21: executing "theme/partials/li.html" at <index .Site.Data.aut...>: error calling index: value is nil; should be of type string in theme/partials/li.html
ERROR: 2016/04/08 22:36:36 template.go:131: template: theme/partials/li.html:10:21: executing "theme/partials/li.html" at <index .Site.Data.aut...>: error calling index: value is nil; should be of type string in theme/partials/li.html
ERROR: 2016/04/08 22:36:36 template.go:131: template: theme/partials/li.html:10:21: executing "theme/partials/li.html" at <index .Site.Data.aut...>: error calling index: value is nil; should be of type string in theme/partials/li.html
ERROR: 2016/04/08 22:36:36 template.go:131: template: theme/partials/li.html:10:21: executing "theme/partials/li.html" at <index .Site.Data.aut...>: error calling index: value is nil; should be of type string in theme/partials/li.html
When using baseurl = "http://example.com/blog"
or baseurl = "http://example.com/blog/"
, the links in the HTML are like this: http://example.com/blogcss/screen.css
.
Please allow subdirectories. Merci!
Hey,
for content, you are getting the class name as <article class = {{.Type}}>
. But it get the class name as 'posts' but css has class name as .post. So the posts are not formatted properly. I hardcoded for now, but something you can look into. I can PR if I get some time to look into it.
Thanks a lot for this theme.
Hi,
I am new to Hugo and HTML generally. I was wondering how I could embed the stackoverflow logo among the social logos on the cover page?
I just installed Hugo and I just installed Casper and I'm sort of bumbling around trying to find a theme to my liking, especially one that does pagination.
In setting up Casper I ran across this error in the log files. There are pagination pages created, but most of them have no content. (The first one works.)
Mostly trying to figure out what I did and how to fix....thanks for any help.
ERROR: 2015/07/14 Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations [post/post.html _default/post.html theme/post/post.html theme/_default/post.html]
ERROR: 2015/07/14 Unable to render [post/post.html _default/post.html theme/post/post.html theme/_default/post.html]
Hugo 0.20 has several changes, which can break Casper sites, or that can make them better.
One theme suggestion comes from
https://discuss.gohugo.io/t/hugo-0-20-upgrade-page-template-breaks/6097
which suggests a fix to layouts/partials/header.html to use relURL instead of concatenation in generating new URLs.
This is connected to gohugoio/hugo#3262
In mobile (tested with Android) the publishing date doesn't appear. Is it the expected behaviour?
Hi,
Although I've set 'paginatedSections' parameter in config.toml to have content from two different sections on the index page but it seems the check to see if 'paginatedSections' is set or not doesn't work and the 'else' get's executed which falls back to rendering contents in 'post' section only.
Here's how I've set the paginatedSections:
[params]
paginatedSections="post test"
description = ""
cover = "images/cover.
I've tried to fix it myself but had no luck in doing so. Just trying to figure out what's wrong, I tried to see if if isset .Site.Params "paginatedSections"
is really working, changing 'paginatedSections' to some other variable like 'description' works as intended.
I couldn't figure out why other variables can be checked if they're set or not, but not 'paginatedSections'.
Any help would be appreciated.
Here's the code that causes the problem.
{{ if isset .Site.Params "paginatedSections" }}
{{ $.Scratch.Set "paginatedSections" .Site.Params.paginatedSections }}
{{ else }}
Here we are ! <!-- Just to check if 'else' gets executed -->.
{{ $.Scratch.Set "paginatedSections" "post" }}
{{ end }}```
Is there a way to embed a Google Map in a post? Could anyone share some advices on how to do this?
I found a weird issue when using Golang and https://highlightjs.org/ syntax highlighting.
If I specify
```go
...
then code highlighting will not use the design as specified in hjsStyle = "<style>"
. Basically it will look like:
func test(i int) string {
fmt.Println("test only")
}
If I do not hint "go" for highlighting, then the formatting style will basically work (and look like other code blocks) but does not cover 100% Go syntax.
Can you reproduce this behaviour?
Thank you.
authors management in Site, Page and Data is too complex, will symplify it to Site and allow override per Page
I am using this theme and I've found useful show the categories into the main menu, at least in my specific case. I am wondering if a pull request with this feature is interesting.
Great theme! Congratulations!
PR #96 introduced a bug where the site build would throw errors when a cover image was specified.
The cause of the bug was that I had misunderstood what the with
expression does in Hugo templates. I thought it was a simple null check, but it also changes the current context (the dot .
), as well.
My apologies for the error. A PR is coming shortly that fixes this issue.
If you don't set Params.cover
in your config file, then the twitter_card.html
partial will throw errors during site build.
The theme lists cover images as optional, so we should test for the cover image setting before applying it within the template.
Here is an example of the build error:
Started building sites ...
ERROR 2017/10/15 10:40:53 Error while rendering "home": template: theme/index.html:1:3: executing "theme/index.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:8:7: executing "theme/partials/header.html" at <partial "twitter_car...>: error calling partial: template: theme/partials/twitter_card.html:11:64: executing "theme/partials/twitter_card.html" at <relURL>: wrong number of args for relURL: want 1 got 0
The theme doesn't have the twitter card meta tag.
Happy to make a PR if others need it.
I see a line at the end of the section in the header.html file.
{{ if .Site.Params.customHeaderPartial }}
{{ partial .Site.Params.customHeaderPartial . }}
{{ end }}
There isn't anything documented about this. Can someone provide some detail on this?
I am getting 404 page not found when I go to a tag page.
http://localhost:1313/tags/golang/
what do I need to check?
In screen.css vs icons.
Specific icon-link. The 600 series does not exist in the new icons.
Not really an issue more of a question. But I'm having a hard time figuring out how to display the 'cover' image that is on main page on the individual post's and page's.
The cover displays on 'tag' pages, and I want to display the cover image like it is on the tag pages (kind of shortened with the 'tag' overlaying the shortened image) on the post/page page's with the post/page title overlaying the image.
Thanks for your input and thanks for the theme.
Currently when posts, pages and the home page are shared to social media, the image pulled as the featured image is the first image found on the page. This image should be the cover image/featured image for the post.
Fix: Add the following lines to layouts/partials/header.html
{{if .Params.image }}
<meta property="og:image" content="{{ .Site.BaseURL }}{{.Params.image}}"/>
{{else}}
{{if .Site.Params.cover}}
<meta property="og:image" content="{{ .Site.BaseURL }}{{.Site.Params.cover}}"/>
{{end}}
{{end}}
My current ghost blog has urls at the root. Like www.mysite.com/post-slug
. But this theme assumes that all the posts are under /post/post-slug
. I want the same url structure as per my current blog structure.
How can I achieve this with this theme? Which files needs modifications? Can someone provide some guidance.
Thank you so much.
Possible feature: suggest other articles at the end of an article.
Casper for Ghost does this well.
Would it be possible to use Page Resources for the post image instead of a relative url to the static folder?
I'm not sure if its only my environment/site, but building it with hugo >= 0.33 results in the home page not rendering correctly. I haven't had a change to look into it more, but I thought I would raise the issue for people upgrading their hugo versions.
I'll add more info as I test things out. Right now hugo 0.32.4 works fine.
The layout logic changed, so that is probably part of the issue.
here's my blog http://john-qin.github.io/
I test it in dev, everything works. after I uploaded it to github, the arrow and subscribe icon are not showing. It only shows a tiny square. seems like the icon font is not found. how do I fix it?
The author thumbnail is used just in the mail page, in the posts list.
I want to add an video into my blog and set a favicon but i don't know how, is there anyone could help me plz!
I installed hugo from debian's apt repository and tried to create a new post using the helper command but it failed. Is this command deprecated?
hugo new -t casper post/my-post.md
Is there a version of this theme which has the postcss / sass version of the files.
Its a great theme but i'd like to make changes to it and recompile it again for my liking. Would be useful to know if there is a PostCSS / Sass version of the assets to work from.
Thanks
hey @vjeantet ,
In my pull request i realized that in the screen.css the class icon-hugo has this content:
content:"\f216";
but "\f216" is the codepen's icon. Is it correct ?
What do you think to add codepen link in the social area ?
I copy the entire config and Metadata in the readme, but hugo build error, the msg is as blow.
ERROR: 2017/05/14 11:03:43 template.go:131:
template: theme/partials/semantic.html:39:31:
executing "theme/partials/semantic.html" at <.Site.Language.Lang>:
can't evaluate field Language in type *hugolib.SiteInfo in theme/partials/semantic.html
I check the error place, the code seems that I miss the param in the config. I try something param still not work.
"alternateName": {{ .Site.Language.Lang }}
Finally I delete this line, then build error disapear.
Now sure how, but I assume there's config that can be applied, sometimes the image layout is out of control and frontpage looks bad.
Thanks.
The footer partial does not support rendering HTML Entities. When the site config
file contains the following:
Copyright = "© Example, Inc."
The rendered result contains the literal "ยฉ Example, inc." text.
The rendered output for the footer partial should contain "ยฉ Example, inc.".
Hi @vjeantet
Thanks a lot for porting this theme from Ghost to Hugo. I am a great fan of static pages, Go and the default Casper theme from Ghost, so it's a great combo.
I have made some tests to migrate my page but I stumbled into some issues. First of is the problem that I don't know how to create normal static pages that are not shown as normal posts? Is that possible? I tried to just generate a post directly inside the "content" folder but the CSS is wrong and the text is not centered.
It would be great to be able to create static pages that are not posts, like "about", etc.
Thanks a lot and keep up the good work! ๐
Regards,
Benjamin
Currently, we can add menu: "main" to add the post/page to the main menu. However, we cannot set its weight?
Can you add the options to add its weight?
First uppercase on file sysem
All lowercase in screen.css
Fails to load on file servers that care about this stuff.
I am new to hugo.
I follow the sample and run my own site, however I could not see the message digest in the main page instead of all text.
How should I do? Thx in advance.
I have difficulties managing the cover image and could use some guidance.
When I specify an image in cover, under [params] in the config.toml, I don't get the same result as on the demo site (http://vjeantet.fr/). On the demo site, the image is shown "full" screen while on my test site, the picture is shown as all width of the screen but about 25% of the hight. I tried with the same picture as on the demo site (cover_polenord).
I have no clue how to get the cover effect of the demo.
Jmm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.