Comments (8)
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:
- 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>
- At the end of _default/single.html I added before the footer:
{{ partial "readnext.html" . }}
- I picked the current casper css, modified to use this theme's icon font.
Best,
Arthur
from hugo-theme-casper.
Thanks ! I'll implement this
from hugo-theme-casper.
I implemented something similar to @arthur-flam's suggestion in on my blog. Happy to do a PR.
from hugo-theme-casper.
@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.
@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.
@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.
@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.
@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)
- How to limit the width of image HOT 1
- Issue with syntax (code) highlighting in markdown
- Publishing date on mobile
- Hugo > 0.32.4 Layouts Issue HOT 4
- Use Page Resources for post image
- 404 page not found
- Limit text preview HOT 1
- Set weight for menu when set it in file metadata HOT 1
- how to add an video and set a favicon? HOT 3
- about deploy the blog to the github HOT 2
- Justify text HOT 1
- Changes for Hugo 0.20 HOT 1
- 'if isset .Site.Params "paginatedSections"' in 'home-content' doesn't work. HOT 2
- Build Error HOT 1
- simplify authors management
- Codepen Link HOT 2
- Class icon-hugo
- Twitter card partial template throws error when cover image is not set
- Twitter card should include cover image when present HOT 2
- Embedding stackoverflow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-theme-casper.