Giter VIP home page Giter VIP logo

bencode.io's Introduction

Yet Another Hugo Site (YAHS)

My hugo static site, for software development related thoughts, published at https://www.bencode.net

favicon

Can never remember this.

  1. First read this
  2. Upload high resolution PNG you want to use into https://realfavicongenerator.net/
  3. Generate emoji based favicon using favicon.io
  4. Combine the outputs, first with the higher resolution versions for large formats, replacing low resolution formats (32x32 and lower) with the emoji based versions
  5. Inject the below head section into the hugo theme partial (i.e. ~/bencode.net/themes/terminal/layouts/partials/head.html)
  6. Rebuild the theme with npm/yarn (also described below)
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />

Theme customisation

Uses the mint terminal theme by Radek Kozieł.

Post sort order

Edit layouts/_default/index.html sort posts by lastmod descending with $paginator := .Paginate (where $PageContext.RegularPages.ByLastmod.Reverse "Type" $contentTypeName)

Simplify post summaries in the main list view

Rip out all content in layouts/_default/index.html except the title, and the last modified date of the post in January 2021 format.

Should end up with something similar to:

{{ define "main" }}
  {{ if .Content }}
    <div class="index-content {{ if .Params.framed -}}framed{{- end -}}">
      {{ .Content }}
    </div>
  {{ end }}
  <div class="posts">
    {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
    {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}

    {{ $PageContext := . }}
    {{ if .IsHome }}
      {{ $PageContext = .Site }}
    {{ end }}
    {{ $paginator := .Paginate (where $PageContext.RegularPages.ByLastmod.Reverse "Type" $contentTypeName) }}

    {{ range $paginator.Pages }}
      <div class="post on-list">
        <h1 class="post-title">
          <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
        </h1>
        <div class="post-meta">
          <span class="post-date">
            {{- .Lastmod | time.Format "January 2006" -}}
          </span>
        </div>
      </div>
    {{ end }}
    {{ partial "pagination.html" . }}
  </div>
{{ end }}

Padding tweaks now leaner post summaries

In assets/css/main.css patch ..headings--one-size setting the margin-top to 0.

Strip the double dotted line between posts

In assets/css/posts.scss jump down to line 47, remove these lines:

  • 47: $border: 3px dotted $accent
  • 52: border-bottom: $border
  • 60: border-bottom: $border

Customise the footer

Edit layouts/partials/footer.html

Rebuild the theme

A node toolchain is needed to proceed. Install dependencies and build:

cd themes/terminal
npm install
npm install yarn
yarn build

bencode.io's People

Contributors

bm4cs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.