Giter VIP home page Giter VIP logo

hugo-theme-fuji's Introduction

🍥 Fuji 🍥

Fuji is a minimal Hugo theme with full dark mode support and GitHub Primer markdown style.

RELEASE BUILD STATUS CODE SIZE LICENSE

English | 简体中文

After the release of v2, there may be major changes in the image lazyload shortcode to make it easier to use. If you want to change the color scheme, please check 🔧 Advanced configuration.

Now supported i18n langs: en, zh-hans, zh-hant, ja, nl, pt-pt. Check the i18n folder to add more languages.

📑 Table of contents

💻 Live demos

Live Demo (en) | My Blog (zh-Hans)

Screenshot of Fuji

❗ Notice

Remember to add summary divider <!--more--> to your post .md files to show blockquotes, links and codes with proper style in list pages' summary part.

🐣 Getting started

Inside the folder of your Hugo site run:

$ git submodule add https://github.com/amzrk2/hugo-theme-fuji.git themes/fuji

For more information read the official setup guide of Hugo.

Then copy the config.toml in the exampleSiteto the root of your Hugo site. Change strings as you like.

Run Hugo's built-in local server:

$ hugo server

If you want to generate your site, just run hugo or hugo --minify.

🆕 Update the theme

You can watch (release only) this repo to receive update notifications.

Inside the folder of your Hugo site run:

$ git submodule update --remote --merge

⚙️ Configuration

🎨 Favicon

Create [SITEROOT]/layouts/partials/favicon.html to cover theme's favicon.

You can generate your favicons in realfavicongenerator.net.

❌ License, toc und comments

Globally in config.toml:

showLicense = true # Enable or disable license for all post
showToc = true # Enable or disable ToC for all post

Or in posts' front matter:

showLicense = true # Enable or disable license for this specific post
showToc = true # Enable or disable ToC for this specific post

To disable comment area for specific post, add this in front matter:

showComments = false # Do not show comments in this post

🎵 APlayer

In-post APlayer supported, you can set these variables in post's front matter:

[[player]]
  playerName = "..." # Audio title or name
  playerArtist = "..." # Audio artist
  playerURL = "..." # Audio URL, support aac, mp3, wav and ogg
  playerCover = "..." # Audio cover
[[player]]
  playerName = "..."
  playerArtist = "..."
  playerURL = "..."
  playerCover = "..."

📷 Image zoom and lazyload settings

Zoomable, not lazyloaded:

![Alt text](test/example.png)

Zoomable, lazyloaded:

{{< img-lazy "Alt text" "test/example.png" >}}
{{< img-lazy "row" "Alt text" "test/example.png" >}}
{{< img-lazy "col" "Alt text" "test/example.png" >}}

Not zoomable, not lazyloaded, optional ext link:

{{< img-nz "Alt text" "test/example.png" ["https://example.com"] >}}

Not zoomable, lazyloaded, optional ext link:

{{< img-nz-lazy "Alt text" "test/example.png" ["https://example.com"] >}}
{{< img-nz-lazy "row" "Alt text" "test/example.png" ["https://example.com"] >}}
{{< img-nz-lazy "col" "Alt text" "test/example.png" ["https://example.com"] >}}

img-lazy will show a 16x9 placeholder before image is loaded, so img-lazy-row will show a 32x9 placeholder and img-lazy-col will show a 8x9 placeholder. You can choose different aspect ratios you want for different images. The placeholder image can be set in site's config.toml.

⚓ Markdown render hook

You can create the files below in your site to adjust the markdown render hook, see Hugo's Official Docs.

You can use [SITEROOT]/layouts/_default/_markup/render-link.html to decide whether or not links in the markdown content will open in new tab:

<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>

📨 Comments area

Theme supports Disqus, utterances and DisqusJS (for Mainland China user)。

by default, disqus uses {{ .Permalink }} as url, {{ .File.ContentBaseName }} as identifier.

Use the [SITEROOT]/layouts/partials/comment-*.html to cover themes/fuji/layouts/partials/comment-*.html. Then you can customize the url and identifier, or set multiple api key, add more settings for using DisqusJS. If you want to use DisqusJS, please remember to set disqusJSApi to anything in your config.toml to load CSS.

🔧 Advanced configuration

See Report und contributing.

If you just simply want to change the color scheme, set this in your config.toml:

useHugoPipes = true

This will make the theme use Hugo Pipes provided by Hugo Extended Vesion to compile the SCSS, then you can cover theme's internal SCSS with your own. Then create [SITEROOT]/assets/scss/_custom.scss cover variables in SCSS:

$body-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', 'PingFang SC', 'Hiragino Sans GB', 'Source Han Sans CN', 'Source Han Sans SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
$mono-font: 'Cascadia Code', 'SF Mono', 'Fira Code', 'Consolas', $body-font;
$title-font: 'Product Sans', $body-font;
$body-font-size: 16px;

$light-color-primary: #8aa2d3; // https://irocore.com/aofuji/
$light-color-secondary: #8f82bc; // https://irocore.com/fujimurasaki/
$light-color-focus: #3b469b; // https://irocore.com/aomurasaki/
$light-color-mute: #9ea1a3; // https://irocore.com/suzu-iro/
$light-color-font: #3f4551; // https://irocore.com/konnezu/
$light-color-divider: #e5e2e4; // https://irocore.com/komachinezu/
$light-color-bg: #fffffd; // https://irocore.com/shiro/
$light-color-codebg: #f6f8fa; // GitHub

$dark-color-primary: #8aa2d3; // https://irocore.com/aofuji/
$dark-color-secondary: #bab1df; // https://irocore.com/fujimurasaki/
$dark-color-focus: #e6e6e6; // https://irocore.com/shironezumi/
$dark-color-mute: #9ea1a3; // https://irocore.com/suzu-iro/
$dark-color-font: #c0c0c0; // https://irocore.com/gin-iro/
$dark-color-divider: #4d5158; // Discord
$dark-color-bg: #2f3136; // Discord
$dark-color-codebg: #414449; // GitHub

✏️ Issue und contributing

Feel free to use the issue tracker. The theme has only been fully tested on Firefox, so if there are some problems when accessing with Chrome or others please also report an issue.

Inside the folder of theme root run:

npm install

Dev:

npm run dev

Build:

npm run build

📝 License

The theme is released under the Apache License 2.0, for more information read the License.

© 2020 DSRKafuU(amzrk2) Twitter @amzrk2 GitHub @amzrk2

🤝 Annotations

Thanks to community contributors for great help.

Learned a lot in Sukka's Blog.

hugo-theme-fuji's People

Contributors

akgnah avatar bayuangora avatar c1c1 avatar emmaguy avatar hjiawei avatar

Watchers

 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.