Giter Club home page Giter Club logo

Comments (8)

arthur-flam avatar arthur-flam commented on July 22, 2024

Hi,
First of all thanks for the great work porting the casper theme to hugo.
I reworked this theme slightly last week to support "readnexts":
Sorry I don't have enough time in the short term to make a proper pull request.
Here are the changes:

  1. New partial readnext.html
<!-- needs to be improved: fails for first/last articles -->
{{ $next := or .NextInSection .Next . }}
{{ $prev := or .PrevInSection .Prev . }}

<aside class="read-next">
{{with $next}}
<a class="read-next-story next " style="background-image: url(/{{or .Params.cover .Site.Params.cover}})" href="{{ .Permalink }}">
  <section class="post">
    <h2>{{.Title}}</h2>
    <p>{{.Description}}</p>
  </section>
</a>
{{end}}
{{with $prev}}
<a class="read-next-story prev " style="background-image: url(/{{or .Params.cover .Site.Params.cover}})" href="{{ .Permalink }}">
  <section class="post">
    <h2>{{.Title}}</h2>
    <p>{{.Description}}</p>
  </section>
</a>
{{end}}
</aside>
  1. At the end of _default/single.html I added before the footer:
{{ partial "readnext.html" . }}
  1. I picked the current casper css, modified to use this theme's icon font.

Best,
Arthur

from hugo-theme-casper.

vjeantet avatar vjeantet commented on July 22, 2024

Thanks ! I'll implement this

from hugo-theme-casper.

sungwoncho avatar sungwoncho commented on July 22, 2024

I implemented something similar to @arthur-flam's suggestion in on my blog. Happy to do a PR.

from hugo-theme-casper.

anthonylavado avatar anthonylavado commented on July 22, 2024

@sungwoncho Just going through this now - how should this be implemented/turned on? We may want to suggest an update to the readme for this.

from hugo-theme-casper.

sungwoncho avatar sungwoncho commented on July 22, 2024

@anthonylavado The feature is turned on automatically. If I remember correctly, the implementation is as follows:

  • if inside a post page, the twitter card will use the post title, summary, and photo
  • if outside, it will use the site title, summary, and photo.

I agree that a doc might be helpful.

from hugo-theme-casper.

anthonylavado avatar anthonylavado commented on July 22, 2024

@sungwoncho Oh, I was referring to the suggestions. At any rate though, I wonder about updating the README.

@vjeantet, I can try to create a draft including this if you would like?

from hugo-theme-casper.

sungwoncho avatar sungwoncho commented on July 22, 2024

@anthonylavado sorry for the confusion. The suggestions is turned on by default. But I think we can make it optional (see this comment) if we need to.

Yes, we could update the feature list in the README to include this one.

from hugo-theme-casper.

anthonylavado avatar anthonylavado commented on July 22, 2024

@sungwoncho I figured out what's happening. The changes you've made are in the /layouts/page directory, but there are also template pages in the /layouts/_default/ directory.

The _default page takes precedence, and it doesn't have the include for the suggestions at the bottom.

from hugo-theme-casper.

Related Issues (20)

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.