GithubHelp home page GithubHelp logo

goto10 / hugo-startpage-theme Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whi-tw/hugo-startpage-theme

0.0 0.0 0.0 2.36 MB

Hugo start page theme, link listing built from yaml

Home Page: https://themes.gohugo.io/hugo-startpage-theme/

License: Apache License 2.0

CSS 76.19% HTML 23.81%

hugo-startpage-theme's Introduction

Startpage theme for hugo

Instructions

Create data/links.yml in your site directory

This file takes the following format:

---
- name: Some card title
  colour: blue # (a valid mdl color name)
  sections: # A section
  - links:
    - title: Google
      url: https://www.google.com
    - title: Bing
      url: https://www.bing.com/
  - links:
    - title: Hacker News
      url: https://news.ycombinator.com/
    - title: Reddit r/devops
      url: https://www.reddit.com/r/devops/
  - links:
    - title: Al Jazeera
      url: https://www.aljazeera.com/

Demo Site (partially using the above links.yml)

Offline Use

The theme includes an appcache manifest for offline use / quick launch.

This is disabled by default, and can be enabled through the site parameters in config.toml:

[params]
    offline = true

If offline use is not desired or required, either omit the parameter (it is off by default) or set offline = false.

Usage notes for offline-mode

For changes to your startpage to be applied after a build, this manifest must be modified on each build.

If your site is in a git repo, the suggested way to get this updated is by running the following after each successful build:

hugo
CURRENT_REVISION=$(git rev-parse --short HEAD)
sed -i "s/COMMIT_SHA/${CURRENT_REVISION}/" public/startpage.appcache

This will ensure that the manifest will be re-read by the browser, and all content re-cached.

Fixing a prematurely cached site

If the site is cached before you are ready, the following will help:

  1. Add a comment / modify the version string of the generated startpage.appcache (changing one character will work) and reload
  2. Build the site with offline = false and refresh the page
  3. Empty the cache on your browser, using Andy Gup's instructions.

Acknowledgements

@analbeard - for the inspiration to create the theme and guidance

hugo-startpage-theme's People

Contributors

whi-tw avatar goto10 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.