A simple, performance-first, SEO-friendly Hugo theme

Related tags

CSS hugo-theme hugo
Overview

Hugo Theme Luna

A simple, performance-first, SEO-friendly Hugo theme

Luna

👉 Example | 中文文档

Introduction

  • Using Tailwindcss
  • Custom Themes
  • Many shortcodes
  • Dark mode
  • Image gallery
  • Responsive images
  • Article encryption (please do not encrypt important content under any circumstances)
  • Multilingual
  • Google Translate
  • PWA
  • Pjax, use swup.js
  • Lazy load images
  • <noscript>
  • Table of contents
  • Local search, use flexsearch
  • Twitter page template
  • GitHub page template
  • Archive page template
  • GitHub Actions
  • and more......

Usage

- Requirements

  • hugo-extended >= 0.97.0
  • NodeJs
  • postcss-cli, Install using npm install postcss-cli -g

For more information about Hugo's functionality, check official documentation of Hugo.

If you are using Windows, I recommend using Scoop to install Hugo:.

scoop install hugo-extended

- Install as git submodule

git submodule add https://github.com/Ice-Hazymoon/hugo-theme-luna themes/hugo-theme-luna
cd themes/hugo-theme-luna
npm install

There is a config.yaml file in the exampleSite directory, copy the file to your site directory and modify the contents.

- Configuration

Please refer to the config.yaml file to configure your site

If you prefer to use toml, you can convert it here

If you need to use templates for Twitter, GitHub, Search, Archives, etc., you will need to create the corresponding files in the content folder, see the cantent folder

If you want to add a Links page, you can refer to this File

You can find all available icons at Eva icons

You can set the post type to type: status to post a status

You can modify your website icons by adjusting the assets/icon.png file

- Comment

You can add the HTML part of the comment in comment.html and then add the script part in custom-script.html or custom-script-pjax.js / custom-script.js

- Shortcodes

The luna theme supports many shortcodes, see: Shortcodes

- Encryption

I suggest you use two repositories to manage your blog, a private repository for your blog's source code and a public repository for public files. If you need to use the post encryption feature, please make sure not to put your source code on the public repository.

Do not encrypt any important content with the encryption function

Please be careful with functions such as .RawContent to avoid exposing the body

If you're not using GitHub Actions and you need to use encryption, run the hugo-encrypt.js script in the theme directory after each site generation

{{% hugo-encrypt 2022 %}}

### Here is what needs to be encrypted

test content

![image test](test.jpg)

```js
console.log('some codes');
```
{{% /hugo-encrypt %}}

Note:

The images in the blog use Hugo's Image Processing feature, which automatically crops them to the right size to optimize page load speed, and can be time-consuming to generate the first time.

The local search function removes the shortcode and code blocks in order to reduce the size of the json file, but you can modify it here if necessary

For the format of new articles, please follow the archetypes/default.md file

If you have pjax enabled and have added additional <script> tags, add the data-swup-reload-script attribute to the tags, see: https://swup.js.org/plugins/scripts-plugin

You can add your custom script at custom-script.html

GitHub Action

Automatically deploy your blog to public repositories

image-20220426222913185

Copy the .github/workflows/main_example.yml file in the theme root directory to your blog's .github/workflows directory

Modify the external_repository, user_name, user_email, etc. fields in the main_example.yml file, see: actions-gh-pages

Note: If you need to enable encryption, you need to have two GitHub repositories, a private repository for your source code and a public repository for your blog, external_repository should be set as the public repository for your blog

If you only have one repository, modify the Deploy script section

Create a Token for deployment at https://github.com/settings/tokens, save the Token

Add a TOKEN field to github.com/{username}/{project}/settings/secrets/actions and enter the token you just generated

Development

git clone https://github.com/Ice-Hazymoon/hugo-theme-luna/
cd hugo-theme-luna
hugo server -s ./exampleSite -D --themesDir "../.."

Screenshots

https://imiku.me

- Performance tests (with pjax and katex turned off)

Lighthouse GTmetrix
Lighthouse GTmetrix

- Screenshots

Home

Home

Home(Dark)

Home(dark)

Tags

Tags

Search

Search

Archives

Archives

Links

Links

Twitter

Twitter

GitHub

GitHub

Encrypted Articles

Encrypted Articles

Gallery Layout

Gallery Layout

Acknowledgements

License

The theme uses the GPL V3.0 protocol open source, please comply with this agreement for secondary development and so on.

You might also like...

Lavender - A purple powercord theme

Lavender - A purple powercord theme

Lavender A good looking dark purple-ish theme for discord. If you got any sugges

Jan 6, 2023

Monkeytype - Soothing pastel theme for MonkeyType

Monkeytype - Soothing pastel theme for MonkeyType

Catppuccin for MonkeyType Usage Open settings on monkeytype.com Go to the theme

Dec 22, 2022

Standalone keycloak theme using Système de Design de l'État (french government design system)

keycloak-dsfr This template has been made thanks to keycloakify. It follows the french design system Système de Design de l'État. You can find guideli

May 25, 2022

implementing a hook to listen to system theme changes! it could be a good lib, who knows? 😏

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jan 15, 2022

A responsive HTML template for coding projects with a clean, user friendly design. Crafted with the latest web technologies, the template is suitable for landing pages and documentations.

A responsive HTML template for coding projects with a clean, user friendly design. Crafted with the latest web technologies, the template is suitable for landing pages and documentations.

Scribbler - a responsive HTML template for coding projects and documentations Scribbler is a responsive HTML/CSS/Javascript template designed for deve

Jan 1, 2023

Delightful, performance-focused pure css loading animations.

Loaders.css Delightful and performance-focused pure css loading animations. What is this? See the demo A collection of loading animations written enti

Jan 4, 2023

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Jan 1, 2023

A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Dec 30, 2022

A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Jan 1, 2023
Comments
  • Modify refs text presentation logic

    Modify refs text presentation logic

    current logic looks strange when display long link

    e.g.

    markdown content

    ---
    title: "test"
    refs:
      - name: long url test
        link: https://github.com/Ice-Hazymoon/hugo-theme-luna/blob/abadd6cbef141aaa99d2fa6f5d012e11c7112347/layouts/partials/article/components/refs.html#L9
      - name: short url
        link: https://google.com
      - link: http://link-without-name-set
    ---
    

    official version

    image

    my version

    image

    code changed

    only changed this line >{{- if $ref.name -}}{{- $ref.name -}}{{- else -}}{{- $ref.link -}}{{- end -}}</a

    whole refs.html

    {{- if .Params.refs -}}
        <div class="w-full overflow-x-hidden border-t border-b bg-gray-100 bg-opacity-80 p-6 dark:border-darkBorder dark:bg-darkBgAccent md:px-10">
            <div class="mb-2 inline-block border-b-2 border-text pb-1 text-base">{{- T "post.refs" -}}</div>
            <div class="">
                {{- range $index, $ref := .Params.refs -}}
                    <div class="overflow-hidden text-ellipsis whitespace-nowrap text-sm leading-loose">
                        <span>[{{- add $index 1 -}}] </span>
                        <a class="hover:underline" href="{{- or $ref.link "javascript:;" -}}" target="_blank" rel="noopener noreferrer"
                                                                                                              >{{- if $ref.name -}}{{- $ref.name -}}{{- else -}}{{- $ref.link -}}{{- end -}}</a
                        >
                    </div>
                {{- end -}}
            </div>
        </div>
    {{- end -}}
    
    opened by eastarpen 2
Releases(v0.9)
  • v0.9(Sep 25, 2022)

    • When searching, enter to select the first result
    • Tweet images are not downloaded when twitter.imageProcessing is false
    • Fix issue with night mode of Giscus comment system
    • Add support for GIFs in image processing
    • Added gradient background color for images
    • Modified Hugo minimum version to 0.104.0
    Source code(tar.gz)
    Source code(zip)
  • v0.8(Jun 20, 2022)

    • Add fixedNav mode 350a3e10ec48daaeec6ab81e7c6034366832b321
    • Add "Color text" shortcode 19033e41e7fdf04b2abb2dcc4ec4b7f5076ed26b
    • Fix google translate 806fe86305f9cc17ee54b84c735a091b7ab28606
    • Highlight Code add support for filenames c596d6cc2fb47fb6c1bd063b11405d9ceafdd23e
    • Add a nice console.log 91aa3667a89d5c3c8d2c7f9044b1359808956e6a
    • Add enter key support for encrypted blocks 92ccda7285405267f1410a5848482f507f5eb653
    • Add blackAndWhite configuration option f3c3b211ade5937548d672f20c5e8f87b21385e7
    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Jun 11, 2022)

  • v0.7(Jun 11, 2022)

    • Add headlineCounter configure https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/5b8e08ceda56da828a4f94bfff37f537259dd859
    • Add a default config.yaml file https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/fdea5a3bd51c3438637c7b8d38f56f36ebad90d7
    Source code(tar.gz)
    Source code(zip)
  • v0.6(Jun 11, 2022)

    • Add bionicReading custom configuration
    • Adjusting JS directory structure https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/c2a37ed0c38970fbafddd6749ea7561d89a37629
    • Fix some wrong words in the config file https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/c2a37ed0c38970fbafddd6749ea7561d89a37629
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Jun 10, 2022)

  • v0.5(Jun 10, 2022)

    This update has made big changes to the directory structure and I suggest you update it

    • Fix the featured image can't use external link https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/f82aae0c7c1c35e501d714670432104e779d961b
    • Modify directory structure https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/8f54fdf4b40c179643b237b9c8810dbb4c03b5eb
    • Fix page title https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/8f54fdf4b40c179643b237b9c8810dbb4c03b5eb
    • Add SwupHeadPlugin https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/8f54fdf4b40c179643b237b9c8810dbb4c03b5eb
    • Add qrcodeAPI configuration options https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/8f54fdf4b40c179643b237b9c8810dbb4c03b5eb
    • Add opengraph configuration options https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/8f54fdf4b40c179643b237b9c8810dbb4c03b5eb
    Source code(tar.gz)
    Source code(zip)
  • v0.4(Jun 3, 2022)

    • Convert thumbnails to jpg format 7a88ddca69e5908d0468b9b8b66f20beaef8f8ae
    • Add autoSize option to image processing 7a88ddca69e5908d0468b9b8b66f20beaef8f8ae
    • Add function/image-process partial 7a88ddca69e5908d0468b9b8b66f20beaef8f8ae
    • Optimize <noscript> support 7a88ddca69e5908d0468b9b8b66f20beaef8f8ae
    • Beautify code 7a88ddca69e5908d0468b9b8b66f20beaef8f8ae
    • Disable the enableGitInfo option for the exampleSite a03bfe748bdf18bc12f3b5bf51b3ccaeb3c3c290
    Source code(tar.gz)
    Source code(zip)
  • v0.3(May 30, 2022)

    Unified Time Format https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/6d180bd2a56856ce7d15860ce09a0a67124ed428 Add gallery-grid and gallery shortcode https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/c84f133d4316a320e42ef59020d2f844d740259c Cancel auto gallery layout for images https://github.com/Ice-Hazymoon/hugo-theme-luna/commit/c84f133d4316a320e42ef59020d2f844d740259c

    If you used theauto gallery layout for images feature before, you now need to replace it with the gallery or gallery-grid shortcode

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(May 29, 2022)

  • v0.2.2(May 29, 2022)

  • v0.2.1(May 29, 2022)

  • v0.2(May 26, 2022)

    • Add bionic-reading https://github.com/Ice-Hazymoon/hugo-theme-luna/discussions/5
    • Add TabView shortcode https://github.com/Ice-Hazymoon/hugo-theme-luna/discussions/7
    • Some small bug fixes
    Source code(tar.gz)
    Source code(zip)
  • v0.1(May 22, 2022)

Owner
Ice-Hazymoon
中文 | English | 日本語 | Español
Ice-Hazymoon
Beautiful theme for Obsidian, Base on Minimal theme

?? obsidian_orange 是什么? obsidian_orange 是一款基于 minimal theme 定制的主题。 ✨ obsidian_orange 实现了什么功能? 多样式“提示块” 图片并列显示 高亮块 & 文本多颜色高亮 徽章(Badge):在标题或文本的右上角添加状态信息

echoxu 84 Jan 6, 2023
Firefox theme that is minimalist, customizable and theme-compatible.

Oneliner Deluxe Installation 1. Download .zip Click the green 'Code' button above and then 'Download ZIP' 2. Copy files Extract contents of @programFi

null 11 Jul 21, 2022
Skeleton: A Dead Simple, Responsive Boilerplate for Mobile-Friendly Development

Skeleton Skeleton is a simple, responsive boilerplate to kickstart any responsive project. Check out http://getskeleton.com for documentation and deta

Dave Gamache 18.8k Dec 29, 2022
Jekyll Bootstrap theme

Landing Page Jekyll theme Jekyll theme based on landing-page bootstrap theme How to use Place a image in /img/services/ Create posts to display your s

Shane Weng 412 Dec 3, 2022
A web app landing page theme created by Start Bootstrap

Start Bootstrap - New Age New Age is a web app landing page theme for Bootstrap created by Start Bootstrap. Preview View Live Preview Status Download

Start Bootstrap 996 Dec 26, 2022
A modern static resume template and theme. Powered by Jekyll and GitHub pages.

modern-resume-theme A modern simple static resume template and theme. Powered by Jekyll and GitHub pages. Host your own resume on GitHub for free! Vie

James Grant 1.5k Dec 31, 2022
Orange Design System theme for Storybook

ODS Storybook Theme Orange Design System Storybook Theme provides a Storybook theme for Orange. Quick start Install with npm: npm install ods-storyboo

Orange 3 Jan 10, 2022
Cyberpunk Store - online supermarket project, using cyberpunk inspired theme.

if you downloaded the project from GITHUB >> TO START THE PROJECT WITHOUT ERRORS - Copy/Cut the "assets" folder into "Client/src/" folder (i threw the

Ariel Cohen 1 Jan 2, 2022
This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents.

jupyter-dragonfruit-theme This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents. Author Website Conta

Allen Chang 1 Jan 29, 2022
PostCSS plugin to render WordPress global styles from a theme.json file

postcss-wp-global-styles PostCSS plugin to render WordPress global styles from a theme.json file. As of now it only supports preset styles. Usage @wp-

Luehrsen // Heinrich 10 Aug 5, 2022