Code Monkey home page Code Monkey logo

hugo-papermodx's Introduction

PaperModX

PaperModX is a forked version of PaperMod, it aims at adding new features and improving code quality, makes it easier to read and modify by anyone with basic knowledge of Hugo and HTML.

Features and changes:

  • Table of Contents (ToC) floating on the side
  • InstantClick integration
  • Social icons from Simple Icons
  • Opinionated UI enhancements

Getting started

You can use reorx/papermodx-example as a boilerplate to create a new Hugo site with PaperModX theme. For detailed instructions please see the README of papermodx-example repo.

Table of Contents (ToC) floating on the side

By adding config:

params:
  TocSide: 'left'  # or 'right'

ToC will float on the left/right side of the page. You can take a look at how 'right' feels like in Installation | Update.

The ToC box is responsive, it only shows on the side when minimum screen size is 1440px.

This feature is enabled on this site.

InstantClick integration

By adding config:

params:
  EnableInstantClick: true

InstantClick will be enabled, making navigation behaves like Single Page Application.

Note that /search pages are omitted from InstantClick to prevent conflicts from search's JavaScript, this may be changed in the future after refactoring those scripts.

Another thing to notice is smooth scrolling will be disabled if InstantClick is enabled, because they both listen click event on every <a> tags. IMO smooth scrolling is not very useful so it has to give way to InstantCllick.

This feature is enabled on this site.

Give links an accent color.

Though PaperModX is designed to be minimal, accent color is still essential. It's a good way to show personality and make your site feels more delightful.

The default color is a purple vibe, you can customize the colors of link, link underline and their hover variants by override the following css variables in assets/css/extended/custom.css of your site.

:root {
  --link-color: var(--primary);
  --link-hover-color: #573eaa;
  --link-underline-shadow: 0 1px 0 var(--link-color);
  --link-hover-underline-color: #573eaa;
  --link-hover-underline-shadow: 0 2px 0 var(--link-hover-underline-color);
}

Customize pagniator size

In section pages, if you want the paginator size be different from the global config, you can add paginate in the frontmatter to customize.

---
paginate: 10
---

Menus external link

You can add external: true to a menu item's params to mark it as an external link, this will add a small icon to the end, and make the link open in new tab when clicked.

menu:
  main:
    - name: "@Author"
      url: "https://reorx.com"
      params:
        external: true

Highlight code with Chroma, no bullshit

PaperMod uses highlight.js to highlight code blocks. In PaperModX, we use Chroma which is the recommended way in Hugo's official docs, thus changing theme is easily supported.

By default the themes are github for light and dracula for dark, you can change it by adding chroma-light.css and chroma-dark.css in site's assets/css/lib directory.

Social icons from Simple Icons

Add social icons with -simple suffix from Simple Icons.

Available icons:

  • github-simple
  • rss-simple
  • telegram-simple
  • twitter-simple
  • pinboard-simple

The icons are moved from layouts/partials/svg.html to data/svg.toml, makes it easier to maintain, it's now possible to have an index page to show all the icons, check it out at: Icons Preview

Opinionated UI enhancements

  • Distinguish home page width and post page width, post page is wider (800px) for better readability, you can change it by --post-width in theme-vars.css.
  • Menu links are always bold, this feels more consistent when clicking around. Active links have deeper color.

hugo-papermodx's People

Contributors

1000283 avatar adityatelange avatar agausmann avatar arkrz avatar canova avatar cbrownstein avatar chr4 avatar cljoly avatar danielfdickinson avatar dolsup avatar fkohrt avatar geeqla avatar ham1 avatar izdwuut avatar jannikarndt avatar kdecherf avatar kdkasad avatar mehdy avatar mohnoor94 avatar muhammadhanif avatar nanxiaobei avatar northerner-coder avatar pacientes avatar pxlfrk avatar reorx avatar rharter avatar syphdias avatar theclonker avatar track3 avatar zhangyuannie avatar

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.