You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.0 KiB

4 years ago
  1. +++
  2. title = "Featured Posts"
  3. description = "Display your favorite blog posts front-and-center."
  4. categories = ["navigation"]
  5. tags = ["seo", "retention", "layout", "templating", "style"]
  6. features = ["code highlighter", "snippets", "related content"]
  7. [[copyright]]
  8. owner = "Josh Habdas"
  9. date = "2019"
  10. license = "agpl-3.0-or-later"
  11. +++
  12. After Dark helps you showcase your favorite blog posts by allowing you to easily specify a set of pages to appear first in post listings using only site config.
  13. {{< hackcss-alert >}}
  14. {{< figure
  15. src="/images/screenshots/feature-featured-posts-fs8.png"
  16. >}}
  17. {{< /hackcss-alert >}}
  18. Use featured posts to drive more traffic to your highest value pages, increase the visibility of niche content or target pages for additional inbound links.
  19. Adjust featured posts from {{< external href="https://gohugo.io/getting-started/configuration/" text="Site Configuration" />}} by adding:
  20. ```toml
  21. [params.layout.post.featured]
  22. limit = 3
  23. items = [
  24. "borg-backup-minio-scaleway",
  25. "dual-boot-manjaro-mojave-macbook-pro",
  26. "surfing-uncensorable-web",
  27. "encrypted-internet-wireguard-manjaro-linux"
  28. ]
  29. ```
  30. Modify `items` using the {{< external "https://gohugo.io/content-management/organization#slug" "page slugs" />}} from your posts and adjust the featured `limit` to the total number of items you wish to display. Like [Custom Homepage](../custom-homepage/) and [Related Content](../related-content/) performance-optimized thumbnail images will appear automatically when a post contains a [Post Image](../post-images/) with `thumbnail` in the name.
  31. Optionally, customize thumbnail styling using [Custom Styles](../custom-styles/):
  32. ```css
  33. ul.thumbnail.grid li a:hover figure {
  34. filter: initial;
  35. }
  36. ul.thumbnail.grid li a figure {
  37. position: relative;
  38. line-height: 0;
  39. margin-bottom: 8px;
  40. }
  41. ul.thumbnail.grid li a:hover figure::after {
  42. content: "";
  43. position: absolute;
  44. bottom: 0;
  45. display: block;
  46. width: 100%;
  47. height: 100%;
  48. background: radial-gradient(
  49. circle,
  50. rgba(0,0,0,0.1) 0,
  51. rgba(0,0,0,0.3) 100%
  52. );
  53. }
  54. ```