Giter VIP home page Giter VIP logo

hugo-casper-two's Introduction

Casper Two

Casper Two is a port of the Casper, the default personal blogging theme for Ghost. While a legacy version (v1.x) has already been ported to Hugo years ago, it is incompatible with the recent 2.x version. So I ended up porting this new Casper version.

Screenshot

Theme Demo

Installation

Inside the folder of your Hugo site run:

$ cd themes
$ git clone https://github.com/eueung/hugo-casper-two.git casper-two

For more information read the official setup guide of Hugo.

Sample Configuration

The following config.toml is used for the demo site.

baseurl         = "/"
theme           = "casper-two"
languageCode    = "en-US"
disqusShortname = ""
paginate        = 6
#SectionPagesMenu = "main"

[params]
  title       = "Hugo Casper Two"
  subtitle    = "Port of Casper 2.x for Hugo"

  cover       = "img/blog-cover.jpg"
  description = "Here is a description of your site."
  metaDescription = ""
  googleAnalytics = ""
  customCSS = []
  RSSLink = ""

  twitterName = "faketryghost"
  fbName = "fakeghost"
  githubName = "eueung"

  logo = "hugo-logo.png"
  orgName = "EM"
  orgWebsite = "https://www.telematika.org"
  orgDescription = "Here is a description placeholder for your org"

  author = "EM"
  authorAvatar = "img/ghost-icon.png"
  authorLocation = "Bandung, ID"
  authorWebsite = "https://eueung.github.io"
  authorDescription = "Describe yourself.."

  pageNotFoundTitle = "404 - Page not found"

  #casper or caspertwo
  singleViewStyle = "casper"

[permalinks]
  post = "/:slug/"

[[menu.main]]
  name = "Home"
  url = "/"
  weight = 200

[[menu.main]]
  name = "Go"
  url = "/tags/golang/"
  weight = 100

[[menu.main]]
  name = "Food"
  url = "/categories/food/"
  weight = 99

[[menu.main]]
  name = "External"
  url = "https://google.com/"
  weight = 95

Sample content structure is given in the exampleSite folder. Have fun!

Screenshot Screenshot

License

This theme is released under the MIT license. For more information read the License.

hugo-casper-two's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hugo-casper-two's Issues

Home page issue in HUGO V.0.58.1

Thanks for a awesome template..

Home page rendering into post folder... So am using a downgraded version of Hugo V.0.57
Hugo support suggested that we need to use .Site.RegularPages variable to overcome the same..

Can author support in fixing the same??

Youtube Videos not showing up

Using singleViewStyle = "casper" causing Youtube videos not showing up on single post view. On the other hand, putting "caspertwo" showing Youtube videos just fine.

Site title element is not rendered correctly

The <title> element does not contain the correct string.

The behaviour I have observed is this:

  • On the homepage, nothing is passed into the <title> tag
  • On posts or pages, the page title is displayed, followed by a whitespace and then a dot, but the site title is still not present.

I have observed this behaviour in the following locations:

This line in partials/head.html could be the culprit

<title>{{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} &middot; {{ .Site.Title }}{{ end }}</title>

Should this line be:

<title>{{ if .IsHome }}{{ .Site.Params.Title }}{{ else }}{{ .Title }} &middot; {{ .Site.Params.Title }}{{ end }}</title>

instead?

Fork or take over this abandoned theme

There are now 4 PR's and 13 issues with zero response from @eueung who does not appear to be active on Github any more, not to mention having zero activity on this theme for 15 months.

I enjoy this theme, but would prefer the users/community be able to make fixes as needed. It would be nice if @eueung could hand this repo off to someone else. If no response, then maybe the next best thing would be to simply fork it and move on, call it 'hugo-casper-three' or something.

I'm not enough of a coder/programmer to handle this, but hopefully someone else could?

Thoughts?

Site renders not correct if RSS Subscribe Button is activated / path is given in config.toml

As discribed in #29 The Site doesn't render as expected if RSS Subscribe Button is Inserted in header.html

Using the following Code:

      <div class="site-nav-right">
        <div class="social-links">
                    {{ if .Site.Params.githubName }}<a class="social-link" href="https://github.com/{{ .Site.Params.githubName }}" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>{{end}}

                    {{ range .AlternativeOutputFormats -}}
                           {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
                    {{ end -}}

        </div>  
        {{ if .Site.Params.RSSLink}}
        <a class="subscribe-button" href="{{.Site.Params.RSSLink }}">Subscribe</a> </div>
        {{else if .Site.Params.showSubscribe}}
        <a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{"rss/index.xml" | absURL}}{{end}}">Subscribe</a>
        {{end}}    
      </div>

The Problematic Code seems to be:

        {{ if .Site.Params.RSSLink}}
        <a class="subscribe-button" href="{{.Site.Params.RSSLink }}">Subscribe</a> </div>
        {{else if .Site.Params.showSubscribe}}
        <a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{"rss/index.xml" | absURL}}{{end}}">Subscribe</a>
        {{end}}   

How do I get my RSS Subscribe Button to work?

Errors on site without expected parameters set

Hello!

$subj, when trying to run this theme against my blog source I get following (and main page won't render, only single posts pages):

Building sites … ERROR 2018/03/20 14:45:18 Error while rendering "page" in "post/": template: theme/_default/single.html:14:9: executing "theme/_default/single.html" at <partial "post-single...>: error calling partial: template: theme/partials/post-single.html:26:113: executing "theme/partials/post-single.html" at <absURL>: wrong number of args for absURL: want 1 got 0
ERROR 2018/03/20 14:45:21 Error while rendering "taxonomy" in "": template: theme/_default/taxonomy.html:14:9: executing "theme/_default/taxonomy.html" at <partial "post-list" ...>: error calling partial: template: theme/partials/post-list.html:33:113: executing "theme/partials/post-list.html" at <absURL>: wrong number of args for absURL: want 1 got 0
ERROR 2018/03/20 14:45:22 Error while rendering "section" in "": template: theme/_default/list.html:10:9: executing "theme/_default/list.html" at <partial "post-list" ...>: error calling partial: template: theme/partials/post-list.html:33:113: executing "theme/partials/post-list.html" at <absURL>: wrong number of args for absURL: want 1 got 0
ERROR 2018/03/20 14:45:22 Error while rendering "home" in "": template: theme/index.html:10:9: executing "theme/index.html" at <partial "post-list" ...>: error calling partial: template: theme/partials/post-list.html:33:113: executing "theme/partials/post-list.html" at <absURL>: wrong number of args for absURL: want 1 got 0


Change detected, rebuilding site
2018-03-20 14:46:02.483 +0000
Source changed "/srv/hugo/content/post/2018-03-19-lust-for-text-life.markdown": WRITE
ERROR 2018/03/20 14:46:02 Error while rendering "page" in "post/": template: theme/_default/single.html:14:9: executing "theme/_default/single.html" at <partial "post-single...>: error calling partial: template: theme/partials/post-single.html:26:113: executing "theme/partials/post-single.html" at <absURL>: wrong number of args for absURL: want 1 got 0
ERROR 2018/03/20 14:46:02 Error while rendering "home" in "": template: theme/index.html:10:9: executing "theme/index.html" at <partial "post-list" ...>: error calling partial: template: theme/partials/post-list.html:33:113: executing "theme/partials/post-list.html" at <absURL>: wrong number of args for absURL: want 1 got 0
Total in 120 ms

The reason is likely some absent .Site. parameter but you can't tell it from error message, I guess input parameters handling could be improved.

Just a question about suffix -sori

For partial layouts that end with suffix -sori what is different and is the use of -sori version or without the suffix determined by choice of "casper" or "caspertwo"?

Thanks.

Posts do not render when data is migrated from sample site

I could not figure out why, specially since Hugo docs specify the following:

"each new piece of content you place into a section will automatically inherit the type. Therefore a new file created at content/posts/new-post.md"

https://gohugo.io/content-management/types/

After explicitly declaring the document type as "post" the posts started to render on the homepage. Now that I think about it this may be an issue with Hugo and not with this theme at all but I thought you should be aware.

I am running Hugo v0.32.2

Weight-age for posts

Is there a way we can assign individual weights to posts (tags) or categories to display them in a particular order?

Thanks in advance for your help here!

Syntax highlighting

Hi
Love the theme! Thanks. I've been trying to change the syntax highlighting in the R code chunks, but no luck. I have modified the head.html file to include

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />

(note the "github" instead of the "default"), but it isn't working.

Any idea why?

Missing layouts?

First, thanks a lot for porting this theme!

I can't manage to reproduce how the demo site renders. Posts and pages don't have the cover image (as in the original Casper theme) but when I try to add posts and pages to my site, they all render like the home page (with the cover image). When comparing the theme's layouts and the source of the demo site, it seems that they don't match?

change fontFamily

I'm trying to replace the font family with Roboto font, but I have no idea how to change it...

I've tried to add:

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

in the head.html file but nothing happens.

I've also tried to add:

font-family: 'Roboto', sans-serif;

and I see no change in my website.

How can I change the website font?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.