├── .github └── workflows │ ├── main.yml │ └── main_example.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── README.zh.md ├── archetypes └── default.md ├── assets ├── Cc-by-nc-nd.svg ├── icon.png ├── images │ ├── error.svg │ ├── i18n │ │ ├── en-us.svg │ │ ├── es-es.svg │ │ ├── ja.svg │ │ ├── sr-rs.svg │ │ ├── zh-cn.svg │ │ └── zh-tw.svg │ ├── outload.svg │ └── search.svg ├── jsconfig.json ├── manifest.json ├── offline.html ├── sass │ ├── _base.scss │ ├── _common │ │ ├── _back_top.scss │ │ ├── _google_translator.scss │ │ ├── _i18nlist.scss │ │ ├── _lazyload.scss │ │ ├── _medium_zoom.scss │ │ └── _shortcodes.scss │ ├── _partial │ │ ├── _navbar.scss │ │ ├── _page_archives.scss │ │ ├── _page_gallery.scss │ │ ├── _page_github.scss │ │ ├── _page_home.scss │ │ ├── _page_links.scss │ │ ├── _page_search.scss │ │ ├── _page_single.scss │ │ └── _page_twitter.scss │ ├── custom.scss │ ├── main.scss │ ├── modules │ │ ├── eva-icons.css │ │ ├── katex.css │ │ └── normalize.css │ ├── theme.scss │ ├── translateelement.scss │ └── typo.scss ├── sw.js ├── translate-google.js └── ts │ ├── _.ts │ ├── custom.ts │ ├── main.ts │ ├── modules │ ├── clipboard.js │ ├── flexsearch.js │ ├── jump.js │ ├── katex-copy.js │ ├── katex-render.js │ ├── katex.js │ ├── lazyload.js │ ├── medium-zoom.js │ ├── pangu.js │ ├── swup.js │ ├── swupFadeTheme.js │ ├── swupGaPlugin.js │ ├── swupHeadPlugin.js │ ├── swupMorphPlugin.js │ ├── swupProgressPlugin.js │ ├── swupScriptsPlugin.js │ └── swupSlideTheme.js │ ├── src │ ├── initActiveMenu.ts │ ├── initBackTop.ts │ ├── initBionicReading.ts │ ├── initClipboard.ts │ ├── initCodeBlockCopy.ts │ ├── initConsoleStyle.ts │ ├── initFooterTime.ts │ ├── initGallery.ts │ ├── initHugoEncrypt.ts │ ├── initKatex.ts │ ├── initLazyload.ts │ ├── initNightMode.ts │ ├── initPangu.ts │ ├── initPjax.ts │ ├── initSearch.ts │ ├── initToc.ts │ └── initZoom.ts │ └── window.d.ts ├── config.yaml ├── data └── luna │ ├── githubColors.json │ └── icon.yaml ├── exampleSite ├── .github │ └── workflows │ │ └── main.yml ├── assets │ ├── Cc-by-nc-nd.svg │ ├── README.ja.md │ ├── README.md │ ├── README.zh.md │ ├── featured.png │ └── icon.png ├── config.yaml ├── content │ ├── en-us │ │ ├── about.md │ │ ├── about.zh-cn.md │ │ ├── archives.md │ │ ├── archives.zh-cn.md │ │ ├── github.md │ │ ├── github.zh-cn.md │ │ ├── links │ │ │ ├── douban.png │ │ │ ├── github.png │ │ │ ├── index.md │ │ │ ├── index.zh-cn.md │ │ │ ├── sspai.png │ │ │ ├── tieba.png │ │ │ ├── translate.png │ │ │ ├── youtube.png │ │ │ └── zhihu.png │ │ ├── posts │ │ │ ├── ArticleEncryptionTest │ │ │ │ ├── index.md │ │ │ │ └── index.zh-cn.md │ │ │ ├── FlowersGallery │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 4.jpg │ │ │ │ ├── 5.jpg │ │ │ │ ├── 6.jpg │ │ │ │ ├── 7.jpg │ │ │ │ ├── cover.jpg │ │ │ │ ├── index.md │ │ │ │ └── index.zh-cn.md │ │ │ ├── Shortcodes │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── index.md │ │ │ │ └── index.zh-cn.md │ │ │ ├── Typography │ │ │ │ ├── cover.jpg │ │ │ │ ├── index.md │ │ │ │ └── index.zh-cn.md │ │ │ └── status │ │ │ │ ├── index.md │ │ │ │ └── index.zh-cn.md │ │ ├── search.md │ │ ├── search.zh-cn.md │ │ ├── twitter.md │ │ └── twitter.zh-cn.md │ ├── ja │ │ ├── archives.md │ │ ├── posts │ │ │ └── Typography │ │ │ │ └── index.md │ │ └── search.md │ └── zh-hans │ │ └── .gitkeep ├── layouts │ └── partials │ │ └── custom │ │ └── head.html ├── netlify.toml ├── static │ └── CNAME └── vercel.json ├── go.mod ├── hugo-encrypt.js ├── i18n ├── en-us.yaml ├── es-es.yaml ├── ja.yaml ├── sr-rs.yaml ├── zh-cn.yaml └── zh-tw.yaml ├── images ├── screenshot.png └── tn.png ├── layouts ├── 404.html ├── _default │ ├── _markup │ │ ├── render-heading.html │ │ ├── render-image.html │ │ └── render-link.html │ ├── archives.html │ ├── baseof.html │ ├── gallery.html │ ├── github.html │ ├── links.html │ ├── page.html │ ├── search.html │ ├── search.json │ ├── section.html │ ├── single.html │ ├── taxonomy.html │ ├── terms.html │ └── twitter.html ├── index.html ├── index.rss.xml ├── partials │ ├── article-list │ │ ├── article.html │ │ ├── components │ │ │ ├── cover.html │ │ │ ├── info.html │ │ │ ├── no-cover.html │ │ │ ├── pagination.html │ │ │ └── with-cover.html │ │ └── type │ │ │ ├── posts.html │ │ │ └── status.html │ ├── article │ │ ├── article.html │ │ └── components │ │ │ ├── content.html │ │ │ ├── cover.html │ │ │ ├── footer.html │ │ │ ├── info.html │ │ │ ├── lastmod.html │ │ │ ├── license.html │ │ │ ├── no-cover.html │ │ │ ├── pagination.html │ │ │ ├── refs.html │ │ │ ├── share.html │ │ │ ├── toc.html │ │ │ └── with-cover.html │ ├── comments │ │ ├── include.html │ │ └── provider │ │ │ ├── custom.html │ │ │ └── giscus.html │ ├── components │ │ ├── announcement.html │ │ ├── backtop.html │ │ ├── dark-mode.html │ │ ├── i18nlist.html │ │ └── run-time.html │ ├── custom │ │ ├── footer.html │ │ ├── head.html │ │ ├── icons.html │ │ └── script.html │ ├── data │ │ ├── description.html │ │ ├── image.html │ │ └── title.html │ ├── helper │ │ ├── image-process.html │ │ └── resources.html │ ├── html │ │ ├── footer.html │ │ ├── head │ │ │ ├── head.html │ │ │ ├── opengraph │ │ │ │ ├── include.html │ │ │ │ └── provider │ │ │ │ │ ├── base.html │ │ │ │ │ └── twitter.html │ │ │ └── site-schema.html │ │ ├── header.html │ │ └── style.html │ ├── noscript.html │ └── scripts │ │ ├── custom.html │ │ ├── google-translate.html │ │ ├── main-script.html │ │ ├── pwa.html │ │ └── theme-script.html └── shortcodes │ ├── abbr.html │ ├── accordion.html │ ├── align.html │ ├── bilibili.html │ ├── button-outline.html │ ├── button.html │ ├── carousel.html │ ├── color.html │ ├── gallery-grid.html │ ├── gallery.html │ ├── github-auto.html │ ├── github.html │ ├── hidden-text.html │ ├── hidden.html │ ├── hr.html │ ├── hugo-encrypt.html │ ├── link-card.html │ ├── link.html │ ├── notice.html │ ├── progress.html │ ├── quote-center.html │ ├── quote.html │ ├── rating.html │ ├── tab-panel.html │ ├── tab-view.html │ ├── tag-outlined.html │ ├── tag.html │ ├── timeline.html │ └── video.html ├── netlify.toml ├── package.json ├── postcss.config.js ├── screenshots ├── gtmetrix.png ├── lighthouse.png ├── luna-white.png ├── luna.png ├── screen-archives.png ├── screen-gallery.png ├── screen-github.png ├── screen-home-dark.png ├── screen-home.png ├── screen-links.png ├── screen-search.png └── screen-twitter.png ├── static ├── fonts │ ├── Eva-Icons.eot │ ├── Eva-Icons.svg │ ├── Eva-Icons.ttf │ ├── Eva-Icons.woff │ ├── Eva-Icons.woff2 │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_Caligraphic-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-Bold.woff │ ├── KaTeX_Main-Bold.woff2 │ ├── KaTeX_Main-BoldItalic.ttf │ ├── KaTeX_Main-BoldItalic.woff │ ├── KaTeX_Main-BoldItalic.woff2 │ ├── KaTeX_Main-Italic.ttf │ ├── KaTeX_Main-Italic.woff │ ├── KaTeX_Main-Italic.woff2 │ ├── KaTeX_Main-Regular.ttf │ ├── KaTeX_Main-Regular.woff │ ├── KaTeX_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── KaTeX_Math-Italic.ttf │ ├── KaTeX_Math-Italic.woff │ ├── KaTeX_Math-Italic.woff2 │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── KaTeX_SansSerif-Bold.woff2 │ ├── KaTeX_SansSerif-Italic.ttf │ ├── KaTeX_SansSerif-Italic.woff │ ├── KaTeX_SansSerif-Italic.woff2 │ ├── KaTeX_SansSerif-Regular.ttf │ ├── KaTeX_SansSerif-Regular.woff │ ├── KaTeX_SansSerif-Regular.woff2 │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Typewriter-Regular.woff │ └── KaTeX_Typewriter-Regular.woff2 └── offline.jpg ├── tailwind.config.js ├── theme.toml ├── updateModules.js └── vercel.json /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | deploy: 7 | env: 8 | HUGO_VERSION: ${{ github.sha }} 9 | TZ: Asia/Shanghai 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Git checkout 14 | uses: actions/checkout@v2 15 | with: 16 | fetch-depth: 0 17 | 18 | - name: Set git config core.quotepath false # https://github.com/gohugoio/hugo/issues/9810#issuecomment-1107519804 19 | run: git config --global core.quotepath false 20 | 21 | - name: Use Node.js 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: "22.x" 25 | 26 | - name: Install Theme 27 | run: yarn install --production 28 | 29 | - name: Install PostCSS-CLI 30 | run: npm install postcss-cli -g 31 | 32 | - name: Setup hugo 33 | uses: peaceiris/actions-hugo@v2 34 | with: 35 | hugo-version: "0.146.0" 36 | extended: true 37 | 38 | - name: Build Hugo 39 | run: echo "HUGO_VERSION -> $HUGO_VERSION" && hugo --gc --minify --cleanDestinationDir -s ./exampleSite --themesDir "../.." --enableGitInfo 40 | 41 | - name: Hugo-Encrypt 42 | run: node ./hugo-encrypt.js 43 | 44 | - name: Deploy 45 | uses: peaceiris/actions-gh-pages@v3 46 | with: 47 | personal_token: ${{ secrets.TOKEN }} 48 | publish_dir: ./exampleSite/public 49 | force_orphan: true 50 | -------------------------------------------------------------------------------- /.github/workflows/main_example.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | deploy: 7 | if: ${{ false }} # Please delete this line 8 | env: 9 | HUGO_VERSION: ${{ github.sha }} 10 | TZ: Asia/Shanghai 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Git checkout 15 | uses: actions/checkout@v2 16 | with: 17 | fetch-depth: 0 18 | submodules: true 19 | 20 | - name: Set git config core.quotepath false # https://github.com/gohugoio/hugo/issues/9810#issuecomment-1107519804 21 | run: git config --global core.quotepath false 22 | 23 | - name: Use Node.js 24 | uses: actions/setup-node@v1 25 | with: 26 | node-version: "16.x" 27 | 28 | - name: Install Theme 29 | run: cd themes/hugo-theme-luna && yarn install --production 30 | 31 | - name: Install PostCSS-CLI 32 | run: npm install postcss-cli -g 33 | 34 | - name: Setup hugo 35 | uses: peaceiris/actions-hugo@v2 36 | with: 37 | hugo-version: "0.146.0" 38 | extended: true 39 | 40 | - name: Build Hugo 41 | run: echo "HUGO_VERSION -> $HUGO_VERSION" && hugo --gc --minify --cleanDestinationDir 42 | 43 | - name: Hugo-Encrypt 44 | run: cd themes/hugo-theme-luna && node ./hugo-encrypt.js 45 | 46 | - name: Deploy 47 | uses: peaceiris/actions-gh-pages@v3 48 | with: 49 | personal_token: ${{ secrets.TOKEN }} 50 | external_repository: "Ice-Hazymoon/blog-hugo-pages" 51 | publish_branch: master 52 | publish_dir: ./public 53 | force_orphan: true 54 | user_name: Ice-Hazymoon 55 | user_email: imiku.me@gmail.com 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .parcelCache 3 | .cache 4 | _gen 5 | public 6 | yarn.lock 7 | .tmp 8 | .hugo_build.lock 9 | yarn-error.log 10 | package-lock.json 11 | pnpm-lock.yaml -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | ./assets/sass/main.scss 2 | layouts/_default/github.html -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [ 3 | { 4 | "files": ["*.html"], 5 | "options": { 6 | "parser": "go-template" 7 | }, 8 | "goTemplateBracketSpacing": true 9 | } 10 | ], 11 | "plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-go-template"], 12 | "tabWidth": 4, 13 | "singleQuote": true, 14 | "bracketSpacing": true, 15 | "bracketSameLine": false, 16 | "printWidth": 160, 17 | "arrowParens": "avoid", 18 | "semi": true, 19 | "useTabs": false 20 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Fork Changelog 2 | ---- 3 | 4 | - 20852fa build: update hugo version (dongfg, 2025-04-23) 5 | - ecc09ea feat: support latest hugo version(0.146.6) (dongfg, 2025-04-22) 6 | - 9e64392 build: pnpm up (dongfg, 2025-04-22) 7 | - 27e6e67 chore: prettier (dongfg, 2025-04-22) 8 | - 871beb2 chore: update package (dongfg, 2025-04-22) -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | # summary: "Some summaries..." 6 | # type: "post" or "status" 7 | # author: Author 8 | # featured_image: cover.jpg 9 | # slug: aaa-bbb-ccc 10 | # toc: true 11 | # categories: 12 | # - CategoryA 13 | # - CategoryB 14 | # tags: 15 | # - tagA 16 | # - tagB 17 | --- 18 | 19 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/assets/icon.png -------------------------------------------------------------------------------- /assets/images/i18n/en-us.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /assets/images/i18n/ja.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/images/i18n/zh-cn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /assets/images/i18n/zh-tw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /assets/images/outload.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /assets/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "*": [ 6 | "*" 7 | ] 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /assets/manifest.json: -------------------------------------------------------------------------------- 1 | {{- $icon := resources.Get "icon.png" -}} 2 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 3 | {{- $icon_192 := print $public_cdn ($icon.Resize "192x192").RelPermalink -}} 4 | {{- $icon_256 := print $public_cdn ($icon.Resize "256x256").RelPermalink -}} 5 | {{- $icon_384 := print $public_cdn ($icon.Resize "384x384").RelPermalink -}} 6 | {{- $icon_512 := print $public_cdn ($icon.Resize "512x512").RelPermalink -}} 7 | { 8 | "theme_color": "{{- .Site.Params.themeColor | safeHTML -}}", 9 | "background_color": "#ffffff", 10 | "display": "standalone", 11 | "scope": "/", 12 | "start_url": "{{- "/" | relLangURL -}}", 13 | "name": "{{- .Site.Title | safeHTML -}}", 14 | "short_name": "{{- .Site.Params.author.name | safeHTML -}}", 15 | "description": "{{- .Site.Title | safeHTML -}}", 16 | "icons": [ 17 | { 18 | "src": "{{- $icon_192 -}}", 19 | "sizes": "192x192", 20 | "type": "image/png", 21 | "purpose": "any maskable" 22 | }, 23 | { 24 | "src": "{{- $icon_256 -}}", 25 | "sizes": "256x256", 26 | "type": "image/png", 27 | "purpose": "any maskable" 28 | }, 29 | { 30 | "src": "{{- $icon_384 -}}", 31 | "sizes": "384x384", 32 | "type": "image/png", 33 | "purpose": "any maskable" 34 | }, 35 | { 36 | "src": "{{- $icon_512 -}}", 37 | "sizes": "512x512", 38 | "type": "image/png", 39 | "purpose": "any maskable" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /assets/offline.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ T "offline.title" }} 8 | 9 | 31 | 32 | 33 |

{{- T "offline.h1" -}}

34 |

{{- T "offline.h3" -}}

35 |

{{- T "offline.h4" -}}

36 | 37 | 38 | 39 | {{- T "offline.return" -}} 40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/sass/_base.scss: -------------------------------------------------------------------------------- 1 | html { 2 | @apply overflow-y-scroll; 3 | overflow-y: scroll; 4 | } 5 | 6 | * { 7 | // cursor: none; 8 | } 9 | 10 | .cursor-pointer { 11 | // cursor: none; 12 | } 13 | 14 | :root { 15 | @apply overflow-y-auto overflow-x-hidden; 16 | 17 | @media (max-width: 500px) { 18 | font-size: 14px; 19 | } 20 | 21 | @media (max-width: 380px) { 22 | font-size: 13px; 23 | } 24 | 25 | @media (max-width: 350px) { 26 | font-size: 11px; 27 | } 28 | } 29 | 30 | * { 31 | -webkit-tap-highlight-color: transparent; 32 | // cursor: url('../assets/images/a.png'); 33 | } 34 | 35 | body { 36 | background-color: #f4f8fb; 37 | color: var(--color-text); 38 | @apply w-screen overflow-hidden text-gray-700; 39 | @apply top-0 #{!important}; 40 | } 41 | 42 | ::selection { 43 | background: var(--theme); 44 | color: #fff; 45 | } 46 | 47 | ::-webkit-scrollbar { 48 | width: 6px; 49 | height: 10px; 50 | } 51 | 52 | ::-webkit-scrollbar-thumb { 53 | background-color: var(--theme); 54 | @apply rounded-full; 55 | } 56 | 57 | textarea, 58 | input { 59 | &:disabled { 60 | @apply cursor-not-allowed bg-gray-100 dark:bg-transparent; 61 | } 62 | } 63 | 64 | figure { 65 | margin: 0; 66 | } 67 | 68 | .main { 69 | box-shadow: 8px 14px 38px rgba(39, 44, 49, 0.06), 1px 3px 8px rgba(39, 44, 49, 0.03); 70 | min-height: 100vh; 71 | } 72 | 73 | .qrcode-wrapper { 74 | box-shadow: 0px 4px 40px 0px rgba(0, 0, 0, 0.25); 75 | } 76 | 77 | .com-footer { 78 | & > div { 79 | &:last-child { 80 | & > span.mx-2.opacity-50 { 81 | display: none; 82 | } 83 | } 84 | } 85 | } 86 | 87 | .hugo-encrypt-sha1sum { 88 | display: none; 89 | } 90 | 91 | bbb { 92 | font-weight: bold; 93 | opacity: 1; 94 | } 95 | 96 | .noscript-show { 97 | @apply hidden; 98 | } 99 | -------------------------------------------------------------------------------- /assets/sass/_common/_back_top.scss: -------------------------------------------------------------------------------- 1 | #back-top { 2 | box-shadow: 1px 1px 25px 1px rgba($color: #000000, $alpha: 0.07); 3 | &:active { 4 | transform: scale(0.95); 5 | } 6 | &.x { 7 | @apply translate-y-0 opacity-100; 8 | } 9 | &.back-top-completed { 10 | @apply text-white dark:text-darkText; 11 | background-color: lighten($theme, 7); 12 | svg circle { 13 | @apply stroke-current text-theme; 14 | } 15 | } 16 | } 17 | 18 | .dark { 19 | #back-top { 20 | &.back-top-completed { 21 | background-color: darken($theme, 10%); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assets/sass/_common/_google_translator.scss: -------------------------------------------------------------------------------- 1 | // Google Language Translator 2 | .goog-te-gadget { 3 | font-size: 0 !important; 4 | .goog-te-combo { 5 | @apply m-0 p-1 text-xs outline-none dark:bg-darkBgAccent dark:text-darkTextPlaceholder #{!important}; 6 | } 7 | .goog-logo-link { 8 | display: none !important; 9 | } 10 | } 11 | .goog-te-banner-frame { 12 | @apply fixed border-none shadow-custom #{!important}; 13 | } 14 | 15 | .skiptranslate { 16 | margin-bottom: 40px; 17 | } 18 | 19 | #google_translate_element { 20 | .skiptranslate { 21 | margin-bottom: 0px; 22 | } 23 | span[style='white-space:nowrap'] { 24 | display: none; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /assets/sass/_common/_i18nlist.scss: -------------------------------------------------------------------------------- 1 | #i18nlist-checkbox:checked + label { 2 | @apply hidden; 3 | & + ul { 4 | @apply block; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /assets/sass/_common/_lazyload.scss: -------------------------------------------------------------------------------- 1 | img[data-lazyload] { 2 | &[data-lazyload-blur] { 3 | @apply opacity-50 transition duration-500 ease-in-out; 4 | &.lazy-loading { 5 | // filter: blur(10px); 6 | opacity: 0.5; 7 | } 8 | &.lazy-loaded { 9 | // filter: blur(0px); 10 | opacity: 1; 11 | } 12 | } 13 | &.lazy-error, 14 | &.lazy-loaded { 15 | @apply bg-none opacity-100 #{!important}; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assets/sass/_common/_medium_zoom.scss: -------------------------------------------------------------------------------- 1 | .medium-zoom-overlay, 2 | .medium-zoom-overlay + .medium-zoom-image, 3 | .medium-zoom-overlay + .medium-zoom-image + .medium-zoom-image { 4 | @apply z-50 border-0; 5 | } 6 | 7 | .medium-zoom-image--opened { 8 | object-fit: contain !important; 9 | } 10 | -------------------------------------------------------------------------------- /assets/sass/_partial/_navbar.scss: -------------------------------------------------------------------------------- 1 | .navbar { 2 | .route-items { 3 | a { 4 | font-size: 0; 5 | &::before { 6 | content: ''; 7 | background-image: linear-gradient(to right, lighten($theme, 8%), cubic-bezier(0.5, 0.5, 0.5, 0.5), $theme); 8 | @apply absolute left-0 top-0 block h-full w-full rounded-full opacity-0 transition duration-300 ease-[ease]; 9 | transform: scale(0); 10 | box-shadow: 0px 0px 10px 0px rgba($color: $theme, $alpha: 0.5); 11 | @apply dark:bg-theme dark:shadow-none; 12 | } 13 | } 14 | 15 | i { 16 | &:hover { 17 | @apply text-theme; 18 | } 19 | &:active { 20 | transform: scale(0.8); 21 | transition: linear 0.1s transform; 22 | } 23 | } 24 | .link-exact-active { 25 | i { 26 | @apply text-theme; 27 | } 28 | span { 29 | @apply font-bold; 30 | } 31 | } 32 | @media (min-width: 768px) { 33 | .link-exact-active { 34 | transform: scale(0.9); 35 | i { 36 | @apply overflow-hidden text-white dark:text-darkText; 37 | } 38 | &::before { 39 | transform: scale(1.6); 40 | opacity: 1; 41 | } 42 | } 43 | } 44 | } 45 | } 46 | 47 | .sub-navbar { 48 | .link-exact-active { 49 | @apply text-theme; 50 | } 51 | } 52 | 53 | .dark { 54 | .link-exact-active::before { 55 | background-image: none !important; 56 | } 57 | } 58 | 59 | .swup-progress-bar { 60 | height: 4px; 61 | background-color: var(--theme); 62 | } 63 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_archives.scss: -------------------------------------------------------------------------------- 1 | .page-archives { 2 | .archives { 3 | .archives_title { 4 | @apply dark:shadow-none; 5 | } 6 | .dot { 7 | margin-left: -(0.5rem/2) - (0.25rem/2); 8 | &::before { 9 | content: attr(data-date) ''; 10 | @apply absolute top-0 -ml-10 flex h-full items-center text-sm; 11 | @media (max-width: 400px) { 12 | @apply -ml-12; 13 | } 14 | } 15 | } 16 | ul { 17 | left: -0.25rem; 18 | } 19 | a { 20 | &::before { 21 | content: ''; 22 | @apply absolute ml-0 mr-0 h-0 w-0 border-solid border-white transition duration-300 ease-[ease] dark:border-darkBgAccent; 23 | border-width: 5px 5px 5px 0; 24 | border-left-color: transparent !important; 25 | border-top-color: transparent !important; 26 | border-bottom-color: transparent !important; 27 | left: -5px; 28 | transform: translateX(0.5px); 29 | top: calc(50% - 5px); 30 | } 31 | &:hover { 32 | transform: translateX(2px) translateY(2px); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_gallery.scss: -------------------------------------------------------------------------------- 1 | .page-gallery { 2 | .gallery-box { 3 | .gallery { 4 | @apply mx-3 my-3 md:mx-4 md:my-4; 5 | figure + figure { 6 | @apply ml-3 md:ml-4; 7 | } 8 | } 9 | } 10 | .gallery-image { 11 | @apply relative mb-3 overflow-hidden rounded md:mb-4; 12 | figcaption { 13 | @apply pointer-events-none absolute bottom-0 w-full px-4 pb-4 pt-8 text-center text-lg text-white opacity-100 transition-opacity duration-300 md:opacity-0; 14 | background-image: linear-gradient(to bottom, hsla(330, 0%, 0%, 0), cubic-bezier(0.42, 0, 0.4, 1), hsla(210, 0%, 0%, 0.3)); 15 | } 16 | img { 17 | @apply w-full; 18 | } 19 | &:hover { 20 | figcaption { 21 | @apply opacity-100; 22 | } 23 | } 24 | } 25 | 26 | h2 { 27 | @apply mb-14 mt-20 text-center text-2xl; 28 | a { 29 | @apply hidden; 30 | } 31 | &::before { 32 | content: '「 '; 33 | @apply font-bold text-theme; 34 | } 35 | &::after { 36 | content: ' 」'; 37 | @apply font-bold text-theme; 38 | } 39 | } 40 | 41 | blockquote { 42 | @apply -mt-10 mb-12 text-center italic text-gray-400; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_github.scss: -------------------------------------------------------------------------------- 1 | .page-github { 2 | .card { 3 | @media (min-width: 640px) { 4 | box-shadow: 5 | 11px 11px 22px #ededed, 6 | -11px -11px 22px #ffffff; 7 | &:hover { 8 | box-shadow: 9 | 0px 0px 0px transparent, 10 | 0px 0px 0px transparent, 11 | inset 11px 11px 22px #ededed, 12 | inset -11px -11px 22px #ffffff; 13 | } 14 | @apply dark:shadow-none dark:hover:shadow-none; 15 | } 16 | } 17 | .github-language-dot { 18 | width: 10px; 19 | height: 10px; 20 | margin-right: 6px; 21 | @apply rounded-full; 22 | } 23 | .github-tabs { 24 | input { 25 | &[type='radio'] { 26 | @apply hidden; 27 | } 28 | &[type='radio']:checked + label { 29 | @apply rounded-sm border-b-2 border-b-theme bg-gray-50 text-theme; 30 | } 31 | &[type='radio']:checked + label + .github-tab { 32 | @apply block; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_home.scss: -------------------------------------------------------------------------------- 1 | .article-list { 2 | // width: calc(100% - 100px); 3 | .category-items a:last-child span:last-child { 4 | display: none; 5 | } 6 | .article { 7 | @media (min-width: 640px) { 8 | box-shadow: 9 | 8px 14px 38px rgba(39, 44, 49, 0.06), 10 | 1px 3px 8px rgba(39, 44, 49, 0.03); 11 | &:hover { 12 | // box-shadow: 0px 0px 1px 1px #e2e8f0; 13 | // box-shadow: 0px 0px 0px 0px transparent,0px 0px 0px 0px transparent, 14 | // inset 30px 30px 60px #d9d9d9, inset -30px -30px 60px #ffffff; 15 | .article-cover { 16 | img { 17 | @apply rounded-b-none; 18 | } 19 | &::after { 20 | content: ''; 21 | @apply opacity-25; 22 | } 23 | } 24 | .cover-shadow { 25 | opacity: 0; 26 | } 27 | } 28 | } 29 | &-title { 30 | text-shadow: 0px 1px 3px rgba($color: #000000, $alpha: 0.3); 31 | // position: absolute !important; 32 | line-height: 1.3; 33 | background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.4), cubic-bezier(0.25, 0, 0.5, 1), transparent); 34 | } 35 | &-cover { 36 | // padding-bottom: 42%; 37 | transform: scale(1); 38 | &::after { 39 | content: ''; 40 | @apply pointer-events-none absolute left-0 top-0 z-0 h-full w-full bg-black opacity-0 transition duration-500 ease-[ease]; 41 | } 42 | [data-lazyload]:not(.lazy-loaded) + noscript + .cover-shadow { 43 | @apply opacity-0 #{!important}; 44 | } 45 | } 46 | .cover-shadow { 47 | filter: blur(18px) saturate(3.5) brightness(1) contrast(1.3); 48 | transform: scale(0.94) translateY(5px); 49 | opacity: 1; 50 | } 51 | .tag { 52 | &:hover { 53 | box-shadow: 54 | -5px 5px 12px #f2f2f2, 55 | 5px -5px 12px #ffffff; 56 | @apply opacity-90 dark:shadow-none; 57 | } 58 | } 59 | } 60 | } 61 | 62 | .dark { 63 | .article-list { 64 | .article { 65 | .cover-shadow { 66 | opacity: 0.2; 67 | } 68 | @media (min-width: 640px) { 69 | box-shadow: 0px 5px 40px 0px rgba(0, 0, 0, 0.1); 70 | &:hover { 71 | box-shadow: 0px 0px 0px 0px transparent; 72 | .cover-shadow { 73 | opacity: 0; 74 | } 75 | } 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_links.scss: -------------------------------------------------------------------------------- 1 | .page-links { 2 | h4 { 3 | @apply m-8 mb-6 ml-0 border-l-4 border-theme pl-3 text-2xl leading-none; 4 | } 5 | 6 | a.link-item { 7 | .nr { 8 | width: calc(100% - 5rem); 9 | } 10 | &:hover { 11 | box-shadow: 12 | -14px 14px 28px #f2f2f2, 13 | 14px -14px 28px #ffffff; 14 | @apply dark:shadow-none; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_search.scss: -------------------------------------------------------------------------------- 1 | .page-search { 2 | .search-results-items { 3 | &:hover { 4 | div:first-child { 5 | color: var(--theme); 6 | } 7 | } 8 | &:last-child { 9 | @apply border-none; 10 | } 11 | &:first-child { 12 | @apply relative; 13 | &:after { 14 | content: '\ea90'; 15 | font-family: Eva-Icons; 16 | @apply absolute right-0 top-2 opacity-50; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_single.scss: -------------------------------------------------------------------------------- 1 | .article-content { 2 | p:empty { 3 | @apply my-0; 4 | } 5 | } 6 | 7 | .page-view-article { 8 | .article-cover { 9 | // padding-bottom: 42%; 10 | display: block; 11 | } 12 | .article-title { 13 | background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.4), cubic-bezier(0.51, 0.59, 0.58, 1), transparent); 14 | text-shadow: 1px 1px 3px rgba($color: #000000, $alpha: 0.2); 15 | } 16 | .toc { 17 | #TableOfContents { 18 | @apply overflow-y-auto text-sm; 19 | &.toc-scroll { 20 | max-height: calc(100vh - 7.5rem); 21 | } 22 | ul { 23 | li { 24 | @apply leading-6; 25 | margin-top: 0.5rem; 26 | &:hover { 27 | &::before { 28 | @apply text-text; 29 | } 30 | } 31 | a { 32 | @apply align-middle hover:text-theme 2xl:hover:text-text; 33 | &.toc-active { 34 | @apply text-theme outline-none hover:text-theme; 35 | } 36 | } 37 | } 38 | ul { 39 | @apply pl-4; 40 | // @apply border-l border-gray-300 dark:border-gray-600; 41 | li { 42 | &::before { 43 | content: '\ea70'; 44 | font-family: Eva-Icons; 45 | @apply mr-1 align-middle text-base text-gray-400 dark:text-gray-500; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /assets/sass/_partial/_page_twitter.scss: -------------------------------------------------------------------------------- 1 | .page-twitter { 2 | font-size: 0; 3 | .rss-card { 4 | &::after { 5 | content: ''; 6 | width: 5px; 7 | height: 5px; 8 | } 9 | } 10 | .dot { 11 | position: relative; 12 | margin-left: -(0.75rem/2) - (0.25rem/2); 13 | &::after { 14 | content: attr(data-date) ''; 15 | @apply absolute w-32 text-base; 16 | } 17 | } 18 | .card-r { 19 | &::after { 20 | content: ''; 21 | @apply absolute left-0 top-0 block h-3 w-3 rounded-full bg-gray-500 transition duration-150; 22 | margin-left: -(0.75rem/2) - (0.25rem/2); 23 | } 24 | &.end { 25 | &::after { 26 | @apply bg-theme; 27 | } 28 | } 29 | } 30 | .img-box { 31 | // width: calc(25% - 1rem); 32 | padding-bottom: calc(100% - 1rem); 33 | height: 0; 34 | picture { 35 | @apply absolute left-0 top-0 flex h-full w-full items-center justify-center bg-gray-50 bg-opacity-50 dark:bg-darkBg; 36 | } 37 | } 38 | .twitter-item { 39 | &:hover { 40 | .card-r::after { 41 | @apply bg-theme; 42 | } 43 | } 44 | &:last-child { 45 | .card-r { 46 | padding-bottom: 0; 47 | &::before { 48 | content: ''; 49 | @apply absolute bottom-0 left-0 block h-3 w-3 rounded-full bg-theme; 50 | margin-left: -(0.75rem/2) - (0.25rem/2); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /assets/sass/custom.scss: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | -------------------------------------------------------------------------------- /assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | /* prettier-ignore-start */ 2 | $theme: {{.Param "themeColor"}}; 3 | $font: {{.Param "font"}}; 4 | $headlineCounter: {{.Param "headlineCounter"}}; 5 | /* prettier-ignore-end */ 6 | 7 | @import 'modules/katex'; 8 | @import 'modules/eva-icons'; 9 | 10 | @tailwind base; 11 | @tailwind components; 12 | @tailwind utilities; 13 | @import './theme.scss'; 14 | @import './typo.scss'; 15 | 16 | @import './_base'; 17 | 18 | @import './_common/_medium_zoom'; 19 | @import './_common/_google_translator'; 20 | @import './_common/_lazyload'; 21 | @import './_common/_back_top'; 22 | @import './_common/_i18nlist'; 23 | @import './_common/_shortcodes'; 24 | 25 | @import './_partial/_navbar'; 26 | @import './_partial/_page_archives'; 27 | @import './_partial/_page_github'; 28 | @import './_partial/_page_links'; 29 | @import './_partial/_page_search'; 30 | @import './_partial/_page_home'; 31 | @import './_partial/_page_single'; 32 | @import './_partial/_page_twitter'; 33 | @import './_partial/_page_gallery'; 34 | 35 | @import './custom.scss'; -------------------------------------------------------------------------------- /assets/sass/theme.scss: -------------------------------------------------------------------------------- 1 | /* purgecss start ignore */ 2 | :root { 3 | --theme: #{$theme}; 4 | --color-zoom-bg: #fff; 5 | --color-text: rgba(55, 65, 81, 1); 6 | --color-dark-bg: #0d1117; 7 | --color-dark-bg-accent: #21262d; 8 | --color-dark-fg: #161b22; 9 | --color-dark-border: #30363d; 10 | --color-dark-text: #d3d4de; 11 | --color-dark-text-placeholder: #8b8c95; 12 | } 13 | .dark { 14 | --theme: #{darken($theme, 20%)}; 15 | --color-zoom-bg: #0d1117; 16 | } 17 | /* purgecss end ignore */ 18 | 19 | $opacities: 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90; 20 | 21 | @each $opacity in $opacities { 22 | $alpha: $opacity / 100; 23 | .bg-theme\/#{$opacity} { 24 | background-color: rgba( 25 | $color: $theme, 26 | $alpha: $alpha 27 | ); 28 | } 29 | .hover\:bg-theme\/#{$opacity}:hover { 30 | background-color: rgba( 31 | $color: $theme, 32 | $alpha: $alpha 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /assets/sw.js: -------------------------------------------------------------------------------- 1 | import * as params from '@params'; 2 | const CACHE_NAME = 'luna_sw'; 3 | const OFFLINE_URL = '../offline.html'; 4 | const OFFLINE_IMAGE = '../offline.jpg'; 5 | const ERROR_IMAGE = '../images/error.svg'; 6 | const baseURL = params.url; 7 | 8 | console.log('load sw.js', baseURL); 9 | 10 | self.addEventListener('install', (event) => { 11 | event.waitUntil( 12 | caches.open(CACHE_NAME).then((cache) => { 13 | cache.add(new Request(OFFLINE_URL, { 14 | cache: "reload" 15 | })) 16 | cache.add(new Request(OFFLINE_IMAGE, { 17 | cache: "reload" 18 | })) 19 | cache.add(new Request(ERROR_IMAGE, { 20 | cache: "reload" 21 | })) 22 | }) 23 | ); 24 | }); 25 | 26 | self.addEventListener('activate', (event) => { 27 | event.waitUntil((async () => { 28 | if ('navigationPreload' in self.registration) { 29 | await self.registration.navigationPreload.enable(); 30 | } 31 | })()); 32 | self.clients.claim(); 33 | }); 34 | 35 | self.skipWaiting(); 36 | 37 | self.addEventListener('fetch', (event) => { 38 | if (event.request.url.startsWith(self.location.origin) || event.request.url.match(/^https:\/\/cdn\.jsdelivr\.net/)) { 39 | // const isSwup = event.request.headers.get('X-Requested-With') === 'swup' 40 | event.respondWith((async () => { 41 | const cache = await caches.open(CACHE_NAME); 42 | try { 43 | const networkResponse = await fetch(event.request); 44 | if (networkResponse.status === 200) { 45 | await cache.put(event.request, networkResponse.clone()); 46 | } 47 | return networkResponse; 48 | } catch (error) { 49 | let cachedResponse = await cache.match(event.request); 50 | if (cachedResponse) { 51 | return cachedResponse; 52 | } else { 53 | return await cache.match(OFFLINE_URL); 54 | } 55 | } 56 | })()); 57 | } 58 | }); -------------------------------------------------------------------------------- /assets/translate-google.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | window.googleTranslateElementInit = function () { 3 | new google.translate.TranslateElement( 4 | {pageLanguage: 'en'}, 5 | 'google_translate_element' 6 | ); 7 | } 8 | 9 | var addScript = function (url) { 10 | var script = document.createElement('script'); 11 | script.src = url; 12 | document.body.appendChild(script); 13 | } 14 | 15 | addScript('//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'); 16 | })(); -------------------------------------------------------------------------------- /assets/ts/_.ts: -------------------------------------------------------------------------------- 1 | export default function() {} -------------------------------------------------------------------------------- /assets/ts/custom.ts: -------------------------------------------------------------------------------- 1 | console.log('custom.ts'); -------------------------------------------------------------------------------- /assets/ts/modules/swupGaPlugin.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGaPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;tString(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,i){const r=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var i;const n=t.findPlugin(e);return null!=(i=null==n?void 0:n.version)?i:""}}(e,i);return!!r&&((e,n)=>n.every(n=>{const[,i,r]=n.match(/^([\D]+)?(.*)$/)||[];var o,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=r,o=t(o=e),s=t(s),o.localeCompare(s,void 0,{numeric:!0})),i||">=")}))(r,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var i;t=!(i=t).name.startsWith("bound ")||i.hasOwnProperty("prototype")?t.bind(this):t;const r=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(r),r}once(t,n,i={}){return this.on(t,n,e({},i,{once:!0}))}before(t,n,i={}){return this.on(t,n,e({},i,{before:!0}))}replace(t,n,i={}){return this.on(t,n,e({},i,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(e){void 0===e&&(e={}),super(),this.name="SwupGaPlugin",this.requires={swup:">=4"},this.defaults={gaMeasurementId:null},this.options={...this.defaults,...e}}mount(){this.on("page:view",this.trackPageView)}trackPageView(){const e=document.title,t=window.location.pathname+window.location.search;"function"==typeof window.gtag?(this.trackPageViewInGtag({title:e,url:t}),this.swup.log(`GA page view: ${t} (gtag.js)`)):"function"==typeof window.ga?(this.trackPageViewInGa({title:e,url:t}),this.swup.log(`GA page view: ${t} (analytics.js)`)):console.warn("Neither window.gtag nor window.ga are present on the page")}trackPageViewInGtag(e){let{title:t,url:n}=e;const{gaMeasurementId:i}=this.options;i?window.gtag("config",i,{page_title:t,page_path:n}):console.error("The gaMeasurementId option is required for gtag.js")}trackPageViewInGa(e){let{title:t,url:n}=e;window.ga("set","title",t),window.ga("set","page",n),window.ga("send","pageview")}}}); 2 | //# sourceMappingURL=index.umd.js.map 3 | -------------------------------------------------------------------------------- /assets/ts/modules/swupScriptsPlugin.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;eString(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); 2 | //# sourceMappingURL=index.umd.js.map 3 | -------------------------------------------------------------------------------- /assets/ts/src/initActiveMenu.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | const activeMenu = document.querySelectorAll('.link-exact-active'); 3 | if (activeMenu) Array.from(activeMenu).forEach((el) => el.classList.remove('link-exact-active')); 4 | const currentMenu = document.querySelectorAll(`[data-active-link="${window.location.pathname.replace(/\/$/, '')}/"]`); 5 | if (currentMenu) Array.from(currentMenu).forEach(el => el.classList.add('link-exact-active')); 6 | } -------------------------------------------------------------------------------- /assets/ts/src/initBackTop.ts: -------------------------------------------------------------------------------- 1 | import jump from "jump.js"; 2 | 3 | export default function() { 4 | const el = document.getElementById('back-top'); 5 | if (!window.__theme.backtop) return false; 6 | window.addEventListener('scroll', () => { 7 | const scrollH = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight) - document.documentElement.clientHeight - 150; 8 | const css = 157 - (~~(document.documentElement.scrollTop / scrollH * 100) * 1.57); 9 | if (css <= 0) el.classList.add('back-top-completed'); 10 | else el.classList.remove('back-top-completed'); 11 | 12 | const circle = el.querySelector('svg circle') as HTMLElement; 13 | circle.style.strokeDashoffset = css < 0 ? '0' : css.toString(); 14 | }) 15 | 16 | const _disabledMouseWheel = (e) => e.stopPropagation(); 17 | function disabledMouseWheel(_) { 18 | if (_) { 19 | document.addEventListener('wheel', _disabledMouseWheel, { 20 | passive: true 21 | }); 22 | document.addEventListener('touchstart', _disabledMouseWheel, { 23 | passive: true 24 | }); 25 | } else { 26 | document.removeEventListener('wheel', _disabledMouseWheel); 27 | document.removeEventListener('touchstart', _disabledMouseWheel); 28 | } 29 | } 30 | el.onclick = (e) => { 31 | e.stopPropagation(); 32 | e.preventDefault(); 33 | if (this._jump) return false; 34 | this._jump = true; 35 | disabledMouseWheel(true); 36 | const easeInOut = (t, b, c, d) => { 37 | return t === d ? b + c : c * (-(2 ** ((-10 * t) / d)) + 1) + b; 38 | }; 39 | jump( 40 | document.body, 41 | { 42 | duration: 400, 43 | offset: 0, 44 | callback: () => { 45 | this._jump = false; 46 | disabledMouseWheel(false); 47 | }, 48 | easing: easeInOut, 49 | a11y: false 50 | } 51 | ); 52 | } 53 | window.addEventListener( 54 | 'scroll', 55 | () => { 56 | if (!el) return false; 57 | if (window.scrollY > 800) { 58 | el.classList.add('x'); 59 | } else { 60 | el.classList.remove('x'); 61 | } 62 | }, 63 | { 64 | passive: true 65 | } 66 | ); 67 | } -------------------------------------------------------------------------------- /assets/ts/src/initClipboard.ts: -------------------------------------------------------------------------------- 1 | import ClipboardJS from "clipboard"; 2 | 3 | export default function() { 4 | if (!document.querySelector('[data-clipboard-text]')) return false; 5 | if (this._clipboard) { 6 | this._clipboard.destroy(); 7 | } 8 | this._clipboard = new ClipboardJS('[data-clipboard-text]'); 9 | this._clipboard.on('success', function(e) { 10 | // alert(window.__theme.i18n.copy.success); 11 | e.trigger.classList.remove('eva-clipboard-outline'); 12 | e.trigger.classList.add('eva-checkmark-outline'); 13 | setTimeout(() => { 14 | e.trigger.classList.remove('eva-checkmark-outline'); 15 | e.trigger.classList.add('eva-clipboard-outline'); 16 | }, 2000); 17 | }) 18 | this._clipboard.on('error', function(e) { 19 | alert(window.__theme.i18n.copy.failed); 20 | console.error('Action:', e.action); 21 | console.error('Trigger:', e.trigger); 22 | }); 23 | } -------------------------------------------------------------------------------- /assets/ts/src/initCodeBlockCopy.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | const highlightList = Array.from(document.querySelectorAll('.highlight')); 3 | for (let index = 0; index < highlightList.length; index++) { 4 | const el = highlightList[index]; 5 | if (el.querySelector('[data-clipboard-text]')) continue; 6 | const header = document.createElement('header'); 7 | const codeEl = el.querySelector('pre code[data-lang]') as HTMLElement; 8 | const lang = codeEl.getAttribute('data-lang'); 9 | let code = el.querySelector('table td:nth-child(2) pre') as HTMLElement; 10 | if (!code) code = el.querySelector('pre') as HTMLElement; 11 | const codeText = code.textContent as string; 12 | 13 | header.innerHTML = `
${lang}
` 14 | const btn = header.querySelector('i.eva') as HTMLElement; 15 | el.prepend(header); 16 | btn.setAttribute('data-clipboard-text', codeText); 17 | } 18 | } -------------------------------------------------------------------------------- /assets/ts/src/initConsoleStyle.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | if (!window.__theme.console.enabled) return false; 3 | const text = `\n\n%c${window.__theme.console.leftText}%c${window.__theme.console.rightText}%c\n\nhttps://github.com/Ice-Hazymoon/hugo-theme-luna\n\n`; 4 | const leftStyle = `background: ${window.__theme.console.leftColor};padding:5px 10px;border-radius:5px 0 0 5px;font-size:16px;color:#fff;`; 5 | const rightStyle = `background: ${window.__theme.console.rightColor};padding:5px 10px;border-radius:0 5px 5px 0;font-size:16px;color:#fff;`; 6 | const linkStyle = `font-style:italic;`; 7 | console.log(text,leftStyle, rightStyle, linkStyle); 8 | } -------------------------------------------------------------------------------- /assets/ts/src/initFooterTime.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | const el = document.getElementById('run-time'); 3 | if (!el) return false; 4 | const runTimer = setInterval(() => { 5 | if (document.querySelector('.goog-te-banner-frame')) { 6 | el.remove(); 7 | clearInterval(runTimer); 8 | return false; 9 | }; 10 | const startDate = new Date(window.__theme.creatTime); 11 | const time = new Date(); 12 | const diff = time.getTime() - startDate.getTime(); 13 | 14 | const day = diff / (1000*60*60*24); 15 | const hour = 24 * parseFloat('0.' + day.toString().replace(/\d+\.(\d*)/, '$1')); 16 | const minute = 60 * parseFloat('0.' + hour.toString().replace(/\d+\.(\d*)/, '$1')); 17 | const second = 60 * parseFloat('0.' + minute.toString().replace(/\d+\.(\d*)/, '$1')); 18 | 19 | const dayEL = document.getElementById('run-time-d') as HTMLElement; 20 | const hourEL = document.getElementById('run-time-h') as HTMLElement; 21 | const minuteEL = document.getElementById('run-time-m') as HTMLElement; 22 | const secondEL = document.getElementById('run-time-s') as HTMLElement; 23 | dayEL.innerText = (~~(day)).toString(); 24 | hourEL.innerText = (~~(hour)).toString(); 25 | minuteEL.innerText = (~~(minute)).toString(); 26 | secondEL.innerText = (~~(second)).toString(); 27 | }, 1000); 28 | } -------------------------------------------------------------------------------- /assets/ts/src/initGallery.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | const figuresEl = Array.from(document.querySelectorAll('.gallery-box figure.gallery-image')) as HTMLElement[]; 3 | let currentGallery = [] as HTMLElement[]; 4 | if (figuresEl.length < 2) return false; 5 | for (const figure of figuresEl) { 6 | const parentElement = figure.parentElement as HTMLElement; 7 | if (parentElement.classList.contains('gallery')) return false; 8 | if (!currentGallery.length) { 9 | /// First iteration 10 | currentGallery = [figure]; 11 | } else if (figure.previousElementSibling === currentGallery[currentGallery.length - 1]) { 12 | /// Adjacent figures 13 | currentGallery.push(figure); 14 | } else if (currentGallery.length) { 15 | /// End gallery 16 | wrap(currentGallery); 17 | currentGallery = [figure]; 18 | } 19 | } 20 | if (currentGallery.length > 0) { 21 | wrap(currentGallery); 22 | } 23 | 24 | function wrap(figures) { 25 | const galleryContainer = document.createElement('div'); 26 | galleryContainer.className = 'gallery'; 27 | 28 | const parentNode = figures[0].parentNode, 29 | first = figures[0]; 30 | 31 | parentNode.insertBefore(galleryContainer, first) 32 | 33 | for (const figure of figures) { 34 | galleryContainer.appendChild(figure); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /assets/ts/src/initKatex.ts: -------------------------------------------------------------------------------- 1 | import katexRander from 'katex-render'; 2 | import 'katex-copy'; 3 | 4 | export default function() { 5 | this._renderKatex = () => { 6 | if (window.__theme.katex) { 7 | katexRander(document.body, { 8 | delimiters: [ 9 | {left: "$$", right: "$$", display: true}, 10 | {left: "$", right: "$", display: false}, 11 | {left: "\\(", right: "\\)", display: false}, 12 | {left: "\\begin{equation}", right: "\\end{equation}", display: true}, 13 | {left: "\\begin{align}", right: "\\end{align}", display: true}, 14 | {left: "\\begin{alignat}", right: "\\end{alignat}", display: true}, 15 | {left: "\\begin{gather}", right: "\\end{gather}", display: true}, 16 | {left: "\\begin{CD}", right: "\\end{CD}", display: true}, 17 | {left: "\\[", right: "\\]", display: true}, 18 | ], 19 | // • rendering keys, e.g.: 20 | throwOnError : true 21 | }) 22 | } 23 | }; 24 | this._renderKatex(); 25 | } -------------------------------------------------------------------------------- /assets/ts/src/initLazyload.ts: -------------------------------------------------------------------------------- 1 | import LazyLoad from "lazyload"; 2 | 3 | export default function() { 4 | if (window.__theme.lazyload) { 5 | this._lazyLoad = new LazyLoad({ 6 | elements_selector: '[data-lazyload]', 7 | class_loading: 'lazy-loading', 8 | class_error: 'lazy-error', 9 | class_loaded: 'lazy-loaded', 10 | unobserve_entered: true, 11 | callback_loaded: (el) => { 12 | if (window.__theme.imageZoom) { 13 | setTimeout(() => { 14 | if (el.hasAttribute('data-zoomable')) { 15 | el.setAttribute('src', el.currentSrc || el.getAttribute('src')); 16 | el.removeAttribute('srcset'); 17 | this._zoom.attach(el) 18 | } 19 | }, 500); 20 | } 21 | }, 22 | callback_error: (el) => { 23 | const errorImageURL = window.__theme.assets.error_svg; 24 | el.setAttribute("src", errorImageURL); 25 | el.setAttribute("srcset", errorImageURL); 26 | if (el.previousSibling.tagName === 'SOURCE') { 27 | el.previousSibling.setAttribute("src", errorImageURL); 28 | el.previousSibling.setAttribute("srcset", errorImageURL); 29 | } 30 | } 31 | }) 32 | } else { 33 | this._noLazyload = (zoom: boolean) => { 34 | const images = Array.from(document.querySelectorAll('[data-zoomable]:not([data-lazyload]):not(.medium-zoom-image)')) as HTMLImageElement[]; 35 | images.forEach(el => { 36 | el.setAttribute('src', el.currentSrc || (el.getAttribute('src') as string)); 37 | el.removeAttribute('srcset'); 38 | if (zoom) this._zoom.attach(el); 39 | }) 40 | } 41 | this._lazyLoad = { 42 | update: () => { 43 | if (window.__theme.imageZoom) { 44 | this._noLazyload(true); 45 | } 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /assets/ts/src/initNightMode.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | 3 | const el = document.querySelector('.dark-mode-switch') as HTMLElement; 4 | const _i = el.querySelector('i') as HTMLElement; 5 | 6 | function setDarkMode(isDark) { 7 | let Event = new CustomEvent("onThemeChange", { 8 | detail: isDark ? 'dark' : 'light' 9 | }); 10 | if (isDark) { 11 | _i.classList.remove('eva-moon'); 12 | _i.classList.add('eva-sun'); 13 | el.title = window.__theme.i18n.darkMode.light; 14 | document.documentElement.dataset.scheme = 'dark' 15 | document.documentElement.classList.add('dark'); 16 | } else { 17 | _i.classList.remove('eva-sun'); 18 | _i.classList.add('eva-moon'); 19 | el.title = window.__theme.i18n.darkMode.dark; 20 | document.documentElement.dataset.scheme = 'light' 21 | document.documentElement.classList.remove('dark'); 22 | } 23 | window.dispatchEvent(Event); 24 | } 25 | 26 | if (window.__theme.autoDarkMode) { 27 | setDarkMode(localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)); 28 | } else { 29 | setDarkMode(localStorage.theme === 'dark'); 30 | } 31 | 32 | 33 | el.addEventListener('click', () => { 34 | if (_i.classList.contains('eva-sun')) { 35 | localStorage.setItem('theme', 'light'); 36 | setDarkMode(false); 37 | } else { 38 | localStorage.setItem('theme', 'dark'); 39 | setDarkMode(true); 40 | } 41 | }) 42 | } -------------------------------------------------------------------------------- /assets/ts/src/initPangu.ts: -------------------------------------------------------------------------------- 1 | import pangu from "pangu"; 2 | 3 | export default function() { 4 | if (window.__theme.pangu) { 5 | pangu.spacingElementById('swup'); 6 | } 7 | } -------------------------------------------------------------------------------- /assets/ts/src/initPjax.ts: -------------------------------------------------------------------------------- 1 | // pjax 2 | import Swup from 'swup'; 3 | import SwupFadeTheme from '../modules/swupFadeTheme'; 4 | import SwupProgressPlugin from '../modules/swupProgressPlugin'; 5 | import SwupGaPlugin from '../modules/swupGaPlugin'; 6 | import SwupScriptsPlugin from '../modules/swupScriptsPlugin'; 7 | import SwupMorphPlugin from '../modules/swupMorphPlugin'; 8 | import SwupHeadPlugin from '../modules/swupHeadPlugin'; 9 | 10 | export default function () { 11 | if (!window.__theme.pjax) return false; 12 | const swup = new Swup({ 13 | cache: true, 14 | plugins: [ 15 | new SwupMorphPlugin({ 16 | containers: ['#i18nlist'], 17 | }), 18 | new SwupFadeTheme(), 19 | new SwupProgressPlugin(), 20 | new SwupScriptsPlugin({ 21 | optin: true, 22 | // head: false, 23 | // body: false 24 | }), 25 | new SwupHeadPlugin({ 26 | persistAssets: true, 27 | }), 28 | ].concat(window.__theme.googleAnalytics ? [new SwupGaPlugin() as any] : []) as any, 29 | animateHistoryBrowsing: true, 30 | linkSelector: 'a[href^="' + window.location.origin + '"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])', 31 | }); 32 | 33 | this.swup = swup; 34 | 35 | swup.hooks.on('page:view', async function (n) { 36 | await window.Luna.initHugoEncrypt(); 37 | window.Luna.initActiveMenu(); 38 | window.Luna.renderPost(); 39 | 40 | const backTopEl = document.getElementById('back-top'); 41 | 42 | if (!n && backTopEl) { 43 | backTopEl.click(); 44 | } 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /assets/ts/src/initZoom.ts: -------------------------------------------------------------------------------- 1 | import mediumZoom from "medium-zoom"; 2 | 3 | export default function() { 4 | if (window.__theme.imageZoom) { 5 | if (!window.__theme.lazyload) { 6 | this._noLazyload(false); 7 | } 8 | this._zoom = mediumZoom('[data-zoomable]:not([data-lazyload]):not(.medium-zoom-image)', { 9 | background: 'var(--color-zoom-bg)', 10 | }); 11 | } 12 | this._updateZoom = () => { 13 | if (!window.__theme.imageZoom) return false; 14 | if (!window.__theme.lazyload) { 15 | this._noLazyload(true); 16 | } 17 | // this._zoom.detach(); 18 | this._zoom.attach('[data-zoomable]:not([data-lazyload]):not(.medium-zoom-image)'); 19 | } 20 | } -------------------------------------------------------------------------------- /assets/ts/window.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | Luna: any; 4 | rednerKatex: any; 5 | __theme: { 6 | cdn: string, 7 | pjax: boolean, 8 | imageZoom: boolean, 9 | lazyload: boolean, 10 | backtop: boolean, 11 | pangu: boolean, 12 | console: { 13 | enabled: boolean, 14 | leftText: string, 15 | leftColor: string, 16 | rightText: string, 17 | rightColor: string, 18 | }, 19 | bionicReading: { 20 | enabled: boolean, 21 | autoBionic: boolean, 22 | skipLinks: boolean, 23 | excludeWords: string[], 24 | excludeNodeNames: string[], 25 | excludeClasses: string[], 26 | }, 27 | katex: boolean, 28 | search: boolean, 29 | isServer: boolean, 30 | $version: string, 31 | autoDarkMode: boolean, 32 | googleAnalytics: boolean, 33 | lang: string, 34 | hugoEncrypt: { 35 | wrongPasswordText: string, 36 | userStorage: any, 37 | }, 38 | assets: { 39 | error_svg: string, 40 | search_svg: string, 41 | }, 42 | i18n: { 43 | copy: { 44 | success: string, 45 | failed: string, 46 | copyCode: string, 47 | } 48 | search: { 49 | untitled: string, 50 | loadFailure: string, 51 | input: string, 52 | results: Function, 53 | }, 54 | darkMode: { 55 | dark: string, 56 | light: string 57 | } 58 | }, 59 | createTime: Date; 60 | } 61 | } 62 | } 63 | 64 | export {}; -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | module: 2 | hugoVersion: 3 | extended: true 4 | min: "0.146.0" 5 | 6 | params: 7 | publicCDN: "" 8 | 9 | topTitle: false 10 | 11 | announcement: 12 | enabled: false 13 | file: "README.md" 14 | 15 | comments: 16 | enabled: false 17 | provider: "custom" 18 | giscus: 19 | mapping: "title" 20 | reactionsEnabled: 1 21 | emitMetadata: 0 22 | lang: "en" 23 | lazy: false 24 | 25 | rss: 26 | enabled: true 27 | fullText: true 28 | 29 | sitemap: true 30 | 31 | themeColor: "#dd6065" 32 | 33 | blackAndWhite: false 34 | 35 | console: 36 | enabled: true 37 | leftColor: "#dd6065" 38 | leftText: "Hugo Theme Luna" 39 | rightColor: "#feb462" 40 | rightText: "Powered by Hugo ❤ Luna" 41 | 42 | headlineCounter: true 43 | 44 | fixedNav: false 45 | 46 | font: 'Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif' 47 | 48 | customScript: 49 | enabled: false 50 | pjax: true 51 | 52 | runTime: 53 | enabled: true 54 | creatTime: 2022/01/01 55 | 56 | since: "2022" 57 | 58 | outdatedInfoWarning: 59 | enabled: true 60 | day: 90 61 | 62 | autoDarkMode: false 63 | 64 | share: 65 | twitter: true 66 | facebook: true 67 | weibo: true 68 | copyLinkText: true 69 | qrcode: true 70 | 71 | qrcodeAPI: "https://www.lofter.com/genBitmaxImage?url=" 72 | 73 | license: 74 | enabled: true 75 | name: "CC BY-NC-ND 4.0" 76 | icon: "Cc-by-nc-nd.svg" 77 | url: "https://creativecommons.org/licenses/by-nc-nd/4.0" 78 | 79 | i18nlist: false 80 | 81 | github: 82 | id: "" 83 | minStars: 5 84 | 85 | imageZoom: true 86 | 87 | lazyload: true 88 | 89 | bionicReading: 90 | enabled: true 91 | autoBionic: false 92 | skipLinks: false 93 | excludeWords: [] 94 | excludeNodeNames: [] 95 | excludeClasses: [] 96 | 97 | googleTranslate: true 98 | 99 | pangu: true 100 | 101 | search: true 102 | 103 | lastmod: true 104 | 105 | readingTime: true 106 | 107 | wordCount: false 108 | 109 | toc: 110 | enabled: true 111 | wordCount: 400 112 | 113 | HugoEncrypt: 114 | Password: "" 115 | Storage: "session" 116 | 117 | pjax: true 118 | 119 | pwa: true 120 | 121 | katex: true 122 | 123 | backtop: true 124 | 125 | defaultFeaturedImage: false 126 | 127 | featuredImageHeight: "42%" 128 | 129 | imageProcessing: 130 | cover: true 131 | content: true 132 | autoResize: 133 | - 1080 134 | - 1440 135 | webp: true 136 | 137 | opengraph: 138 | twitter: 139 | cardType: summary_large_image 140 | site: 141 | image: 142 | -------------------------------------------------------------------------------- /exampleSite/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | deploy: 7 | env: 8 | HUGO_VERSION: ${{ github.sha }} 9 | TZ: Asia/Shanghai 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Git checkout 14 | uses: actions/checkout@v2 15 | with: 16 | fetch-depth: 0 17 | submodules: true 18 | 19 | - name: Set git config core.quotepath false # https://github.com/gohugoio/hugo/issues/9810#issuecomment-1107519804 20 | run: git config --global core.quotepath false 21 | 22 | - name: Use Node.js 23 | uses: actions/setup-node@v1 24 | with: 25 | node-version: "16.x" 26 | 27 | - name: Install Theme 28 | run: cd themes/hugo-theme-luna && yarn install 29 | 30 | - name: Install PostCSS-CLI 31 | run: npm install postcss-cli -g 32 | 33 | - name: Setup hugo 34 | uses: peaceiris/actions-hugo@v2 35 | with: 36 | hugo-version: "0.146.0" 37 | extended: true 38 | 39 | - name: Build Hugo 40 | run: echo "HUGO_VERSION -> $HUGO_VERSION" && hugo --gc --minify --cleanDestinationDir 41 | 42 | - name: Hugo-Encrypt 43 | run: cd themes/hugo-theme-luna && node ./hugo-encrypt.js 44 | 45 | - name: Deploy 46 | uses: peaceiris/actions-gh-pages@v3 47 | with: 48 | personal_token: ${{ secrets.TOKEN }} # https://github.com/settings/tokens 49 | external_repository: "Ice-Hazymoon/blog-hugo-pages" # The build will be pushed to this repository when it is complete 50 | publish_branch: master 51 | publish_dir: ./public 52 | user_name: Ice-Hazymoon 53 | user_email: imiku.me@gmail.com 54 | -------------------------------------------------------------------------------- /exampleSite/assets/README.ja.md: -------------------------------------------------------------------------------- 1 | 詳しくは、[英語](/)または[中国語](/zh-cn/)のウェブサイトをご覧ください。 -------------------------------------------------------------------------------- /exampleSite/assets/README.md: -------------------------------------------------------------------------------- 1 | 🎉🎉🎉 Hi everyone!! Hugo theme Luna has been released, welcome to use it, if you encounter problems, you can ask questions in [issues](https://github.com/Ice-Hazymoon/hugo-theme-luna/issues). Here are some notices that you can modify in [this file](https://github.com/Ice-Hazymoon/hugo-theme-luna/blob/master/exampleSite/assets/README.md) or delete it 2 | 3 | 4 | -------------------------------------------------------------------------------- /exampleSite/assets/README.zh.md: -------------------------------------------------------------------------------- 1 | 🎉🎉🎉 哈喽,大家好!!HUGO 主题 Luna 已经发布,欢迎使用,如果遇到问题可以在 [issues](https://github.com/Ice-Hazymoon/hugo-theme-luna/issues) 里提问。这里是一些公告内容,你可以在 [这里](https://github.com/Ice-Hazymoon/hugo-theme-luna/blob/master/exampleSite/assets/README.zh.md) 修改它,或者删除这个文件。 2 | -------------------------------------------------------------------------------- /exampleSite/assets/featured.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/assets/featured.png -------------------------------------------------------------------------------- /exampleSite/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/assets/icon.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | date: 2017-01-14T06:31:45+00:00 4 | layout: "page" 5 | type: page 6 | comments: false 7 | --- 8 | 9 | # About me 10 | 11 | Some introductions... 12 | 13 | ![Random images from Unsplash](https://source.unsplash.com/random/1000x500) -------------------------------------------------------------------------------- /exampleSite/content/en-us/about.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "关于" 3 | date: 2017-01-14T06:31:45+00:00 4 | layout: "page" 5 | type: page 6 | comments: false 7 | --- 8 | 9 | # 关于我 10 | 11 | 一些介绍... 12 | 13 | ![来自 Unsplash 的随机图片](https://source.unsplash.com/random/1000x500) -------------------------------------------------------------------------------- /exampleSite/content/en-us/archives.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Archives" 3 | layout: "archives" 4 | date: 2021-08-23T15:26:35+08:00 5 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/archives.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "归档" 3 | layout: "archives" 4 | date: 2021-08-23T15:26:35+08:00 5 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/github.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "GitHub" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "github" 5 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/github.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "GitHub" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "github" 5 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/douban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/douban.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/github.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Links" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "links" 5 | --- 6 | 7 | #### WebSite 8 | 9 | {{< link url="https://github.com/" image="github.png" title="GitHub" desc="some desc text..." >}} 10 | {{< link url="https://douban.com/" image="douban.png" title="Douban" desc="some desc text..." >}} 11 | {{< link url="https://youtube.com/" image="youtube.png" title="YouTube" desc="some desc text..." >}} 12 | {{< link url="https://sspai.com/" image="sspai.png" title="Sspai" desc="some desc text..." >}} 13 | {{< link url="https://translate.google.com" image="translate.png" title="Translate" desc="some desc text..." >}} 14 | {{< link url="https://tieba.com/" image="tieba.png" title="Tieba" desc="some desc text..." >}} 15 | {{< link url="https://zhihu.com/" image="zhihu.png" title="Zhihu" desc="some desc text..." >}} 16 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/index.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "友情链接" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "links" 5 | --- 6 | 7 | #### 常用网站 8 | 9 | {{< link url="https://github.com/" image="github.png" title="GitHub" desc="some desc text..." >}} 10 | {{< link url="https://douban.com/" image="douban.png" title="Douban" desc="some desc text..." >}} 11 | {{< link url="https://youtube.com/" image="youtube.png" title="YouTube" desc="some desc text..." >}} 12 | {{< link url="https://sspai.com/" image="sspai.png" title="Sspai" desc="some desc text..." >}} 13 | {{< link url="https://translate.google.com" image="translate.png" title="Translate" desc="some desc text..." >}} 14 | {{< link url="https://tieba.com/" image="tieba.png" title="Tieba" desc="some desc text..." >}} 15 | {{< link url="https://zhihu.com/" image="zhihu.png" title="Zhihu" desc="some desc text..." >}} 16 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/sspai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/sspai.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/tieba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/tieba.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/translate.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/youtube.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/links/zhihu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/links/zhihu.png -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/ArticleEncryptionTest/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Article Encryption Test" 3 | date: 2022-04-09T02:49:13+02:00 4 | slug: hugo-encrypt 5 | summary: "This is a test article for encryption" 6 | tags: 7 | - "Hugo" 8 | --- 9 | 10 | ## Hugo Encrypt 11 | 12 | > password: **2022** 13 | 14 | ````markdown 15 | {{%/* hugo-encrypt 2022 */%}} 16 | ![Night city](https://unsplash.it/1920/1080/?random=1) 17 | {{%/* /hugo-encrypt */%}} 18 | ```` 19 | 20 | {{% hugo-encrypt 2022 %}} 21 | ![Night city](https://unsplash.it/1920/1080/?random=1) 22 | {{% /hugo-encrypt %}} 23 | 24 | *** 25 | 26 | ## Multi-block encryption 27 | 28 | > Default password: **123456** 29 | 30 | ```markdown 31 | {{%/* hugo-encrypt */%}}`Here is the test content `{{%/* /hugo-encrypt */%}} 32 | ``` 33 | 34 | {{% hugo-encrypt %}}`Here is the test content `{{%/ hugo-encrypt %}} 35 | 36 | End... -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/ArticleEncryptionTest/index.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "加密文章测试" 3 | date: 2022-04-09T02:49:13+02:00 4 | slug: hugo-encrypt 5 | summary: "Hugo 文章加密测试" 6 | --- 7 | 8 | ## 加密文章测试 9 | 10 | > 密码:**2022** 11 | 12 | ````markdown 13 | {{%/* hugo-encrypt 2022 */%}} 14 | ![加密图片测试](https://unsplash.it/1920/1080/?random=1) 15 | {{%/* /hugo-encrypt */%}} 16 | ```` 17 | 18 | {{%hugo-encrypt 2022 %}} 19 | ![加密图片测试](https://unsplash.it/1920/1080/?random=1) 20 | {{%/hugo-encrypt %}} 21 | 22 | *** 23 | 24 | ## 多块测试 25 | 26 | > 默认密码:**123456** 27 | 28 | ```markdown 29 | {{%/*hugo-encrypt */%}}`这里是第二段密文`{{%/*/hugo-encrypt */%}} 30 | ``` 31 | 32 | {{%hugo-encrypt %}}`这里是第二段密文`{{%/hugo-encrypt %}} 33 | 34 | 小尾巴~ 35 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/1.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/2.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/3.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/4.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/5.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/6.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/7.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/FlowersGallery/cover.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Flower Gallery 3 | date: 2022-04-15T02:49:13+02:00 4 | slug: flower-gallery 5 | featured_image: cover.jpg 6 | summary: Some photos of flowers 7 | layout: gallery 8 | tags: 9 | - Flower 10 | categories: 11 | - Gallery 12 | --- 13 | 14 | {{< gallery >}} 15 | ![ROSE](1.jpg) 16 | ![ROSE](2.jpg) 17 | ![ROSE](3.jpg) 18 | 19 | ![ROSE](5.jpg) 20 | ![ROSE](4.jpg) 21 | ![ROSE](6.jpg) 22 | {{< /gallery >}} 23 | 24 | ## Grid Gallery 25 | 26 | > Spring, the sweet spring, is the year's pleasant king. 27 | 28 | {{< gallery-grid >}} 29 | ![some text](1.jpg) 30 | ![some text](2.jpg) 31 | ![some text](3.jpg) 32 | ![some text](4.jpg) 33 | ![some text](5.jpg) 34 | ![some text](6.jpg) 35 | {{< /gallery-grid >}} 36 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/FlowersGallery/index.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 画廊(春) 3 | date: 2022-04-15T02:49:13+02:00 4 | slug: flower-gallery 5 | featured_image: cover.jpg 6 | summary: 一些关于花的照片 7 | layout: gallery 8 | tags: 9 | - 花 10 | categories: 11 | - 画廊 12 | --- 13 | 14 | {{< gallery >}} 15 | ![ROSE](1.jpg) 16 | ![ROSE](2.jpg) 17 | ![ROSE](3.jpg) 18 | 19 | ![ROSE](5.jpg) 20 | ![ROSE](4.jpg) 21 | ![ROSE](6.jpg) 22 | {{< /gallery >}} 23 | 24 | ## Grid 布局 25 | 26 | > 春,甘美之春,一年之中的尧舜, 27 | 28 | {{< gallery-grid >}} 29 | ![some text](1.jpg) 30 | ![some text](2.jpg) 31 | ![some text](3.jpg) 32 | ![some text](4.jpg) 33 | ![some text](5.jpg) 34 | ![some text](6.jpg) 35 | {{< /gallery-grid >}} 36 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/Shortcodes/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/Shortcodes/1.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/Shortcodes/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/Shortcodes/2.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/Shortcodes/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/Shortcodes/3.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/Typography/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/en-us/posts/Typography/cover.jpg -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/status/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: Ice-Hazymoon 3 | type: status 4 | date: 2019-02-15T07:01:32+00:00 5 | slug: luna-released 6 | categories: 7 | - Luna 8 | --- 9 | 10 | Hugo theme luna has been released, welcome to use it! -------------------------------------------------------------------------------- /exampleSite/content/en-us/posts/status/index.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: Ice-Hazymoon 3 | type: status 4 | date: 2019-02-16T07:01:32+00:00 5 | slug: luna-released 6 | categories: 7 | - 主题 8 | --- 9 | 10 | Hugo 主题 Luna 已发布,欢迎使用! 11 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/search.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Search" 3 | layout: "search" 4 | outputs: 5 | - html 6 | - json 7 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/search.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "搜索" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "search" 5 | outputs: 6 | - html 7 | - json 8 | --- -------------------------------------------------------------------------------- /exampleSite/content/en-us/twitter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Twitter" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "twitter" 5 | --- 6 | -------------------------------------------------------------------------------- /exampleSite/content/en-us/twitter.zh-cn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Twitter" 3 | date: 2021-08-23T15:26:35+08:00 4 | layout: "twitter" 5 | --- 6 | -------------------------------------------------------------------------------- /exampleSite/content/ja/archives.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "アーカイブ" 3 | layout: "archives" 4 | date: 2021-08-23T15:26:35+08:00 5 | --- -------------------------------------------------------------------------------- /exampleSite/content/ja/posts/Typography/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "源氏物語 1 桐壷 きりつぼ" 3 | date: 2022-06-15T20:15:03+02:00 4 | slug: typography 5 | featured_image: https://upload.wikimedia.org/wikipedia/commons/b/ba/Ch5_wakamurasaki.jpg 6 | tags: 7 | - 源氏物語 8 | refs: 9 | - link: http://james.3zoku.com/genji/genji01.html 10 | --- 11 | 12 | ## 父帝と母桐壺更衣の物語 13 | 14 | いずれの帝の御代であったか、大勢の女御、更衣がお仕えしているなかで、身分はそれほど高くはないが、ひときわ時めいていた更衣がいた。入内のときから、われこそはと思い上がっていた女御たちは、その更衣を目障りな女、とさげすみ妬んだ。それより下位の更衣たちは、なおのこと心安からず思っていた。朝夕の宮仕えのたびに、女御たちの心を掻き立て、怨みを負ったせいか、その更衣は病気がちになり、里帰りがしげく、(帝は)それにつれいっそう 更衣を不憫に思われ、人々のそしりをもかまわず、世間の語り草になるほどのご寵愛であった。 15 | 16 | 殿上人たちも、かかわるのを避けるように見ないふりをして、「大変なご寵愛ぶりだ。唐の国でもこのようなことがあって、世が乱れる悪い先例があった」と私語をかわし、世間でも苦々しく人々の噂の種になって、楊貴妃の例も引き合いに出され、更衣は居たたまれなかったが、恐れ多い帝の類ない御心をただ一筋の頼りとして仕えていた。 17 | 更衣の父の大納言は亡くなり、母は旧家の出で教養もあり、両親がそろっていて、当世の高い評判を得ている人々にもさほど劣ることなく、どんな儀式もそつなくやってきたが、格別の頼りになる後ろ盾がないので、事あるときは、拠り所がなく心細げであった。 18 | 19 | ![土佐光起绘《源氏物语绘卷》](https://upload.wikimedia.org/wikipedia/commons/b/ba/Ch5_wakamurasaki.jpg) 20 | 21 | ## 御子誕生(一歳) 22 | 23 | 前世でも深い契りがあったのであろうか、その更衣に世にも稀な美しい男の子が生まれた。帝は早く見たいと心がせいて、急ぎ参上させてご覧になるに、実に美しい容貌の稚児であった。 24 | 25 | 一の宮の皇子は右大臣の女御が生んだ子であったから、後見もしっかりし、当然皇太子だ、と世間でも見られていたが、この輝くような稚児の美しさには比べようもなく、帝は一の宮を一通りは大事にしていたが、この稚児に対しては、自分のものとして格別に可愛がられた。 26 | 27 | もともとこの更衣は普通の宮仕えする身分ではなかった。世間の信望もあり貴人の品格もあったが、帝が無理にもそばに呼び、管弦の遊びの折々、また行事の折々に参上させたのであった。あるときには寝過ごしてなお引き続きお傍に侍らせ、御前から去らせようとしなかったこともあり、身分の軽い女房のようにも見えたのだが、この稚児がお生まれになってからは、一段とご寵愛が深くなり、「ひよっとすると、この稚児が皇太子の御所に入るべきとお考えなのだろうか」と一の宮の女御は疑念をもつほどであった。この女御は最初に入内した方であったから、帝の思いも並々ならぬものがあり、皇女たちもいましたので、帝は一の宮の女御の苦言だけは、けむたくまた心苦しく思っていたのであった。 28 | 29 | おそれおおくも帝の庇護のみを頼りにしていたが、あらさがしをする人は多く、更衣は病弱で心もとない状態のなかで、かえって辛い思いをしたのであった。お部屋は桐壷であった。帝はたくさんの女御たちの部屋を通り過ぎて、ひんぱんに通うので、女御たちが気をやきもきさせるのも無理からぬことであった。更衣が御前に参上されるときも、あまりに繁くなると、打橋、渡殿などの通り道のあちこちに、よからぬ仕掛けをして、送り迎えの女官の着物の裾が汚れてどうにもならないこともあった。またあるときは、どうしても通らなけれならない馬道の戸が、示しあわせて閉じられて、中でみじめな思いをしたこともしばしばあった。事あるごとに嫌がらせにあって、すっかり気落ちした更衣を、帝はあわれに思い、後涼殿に元からいた更衣を他の局に移し、この更衣に上局として賜った。その怨みたるや、晴らしようがなかったであろう。 30 | 31 | ## 若宮の御袴着(三歳) 32 | 33 | この稚児が三歳になった年、御袴着の行事は一の宮に劣らず、内蔵寮、納殿の宝物をふんだんにつかって盛大に行った。このようなやり方に世間の批判も多かったが、この御子の早熟な容姿の世にも稀な美しさに、そんな非難も自然におさまっていった。物知りの老人たちも「このような美しい子供が本当にいるものだ」と讃嘆の声をあげたのであった。 34 | -------------------------------------------------------------------------------- /exampleSite/content/ja/search.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "検索" 3 | layout: "search" 4 | outputs: 5 | - html 6 | - json 7 | --- -------------------------------------------------------------------------------- /exampleSite/content/zh-hans/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/exampleSite/content/zh-hans/.gitkeep -------------------------------------------------------------------------------- /exampleSite/layouts/partials/custom/head.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /exampleSite/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "cd themes/hugo-theme-luna && npm install postcss-cli -g && npm install --production && cd ../../ && hugo --gc --minify --cleanDestinationDir --enableGitInfo" 3 | publish = "public" 4 | 5 | [build.environment] 6 | HUGO_VERSION = "0.146.0" 7 | 8 | [[plugins]] 9 | package = "netlify-plugin-hugo-cache-resources" 10 | [plugins.inputs] 11 | debug = true -------------------------------------------------------------------------------- /exampleSite/static/CNAME: -------------------------------------------------------------------------------- 1 | hugo-theme-luna.imiku.me -------------------------------------------------------------------------------- /exampleSite/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "public": true, 3 | "build": { 4 | "env": { 5 | "HUGO_VERSION": "0.146.0" 6 | } 7 | }, 8 | "buildCommand": "hugo --gc --minify --cleanDestinationDir --enableGitInfo", 9 | "installCommand": "cd themes/hugo-theme-luna && npm install postcss-cli -g && npm install --production && cd ../../", 10 | "outputDirectory": "public" 11 | } 12 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Ice-Hazymoon/hugo-theme-luna 2 | 3 | go 1.16 -------------------------------------------------------------------------------- /i18n/es-es.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/i18n/es-es.yaml -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/images/screenshot.png -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/images/tn.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 3 | 4 | 5 |
6 |
7 | 404 8 | {{- T "notFound" -}} 11 |
12 |
13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | 2 | {{/* prettier-ignore-start */}} 3 | {{- .Text | safeHTML -}} 7 | {{/* prettier-ignore-end */}} 8 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-link.html: -------------------------------------------------------------------------------- 1 | {{- .Text | safeHTML -}} 7 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- partial "html/head/head" . -}} 5 | {{- block "head" . -}}{{ end }} 6 | 7 | 8 | 9 |
10 |
11 | {{- partial "html/header" . -}} 12 | 13 | 14 |
15 | {{- partial "html/style" . -}} 16 |
{{- block "main" . -}}{{- end -}}
17 |
18 | 19 | {{- partial "html/footer" . -}} 20 |
21 |
22 | {{- partial "components/backtop" . -}} 23 | 24 | {{- partial "components/i18nlist" . -}} 25 | 26 | {{- partial "noscript" . -}} 27 | 28 | 29 | -------------------------------------------------------------------------------- /layouts/_default/gallery.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | 57 | {{- end -}} 58 | -------------------------------------------------------------------------------- /layouts/_default/links.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | 17 | 18 | {{- partial "comments/include" . }} 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /layouts/_default/page.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
{{- .Content -}}
4 |
5 | {{- partial "comments/include" . }} 6 | {{- end -}} 7 | -------------------------------------------------------------------------------- /layouts/_default/search.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 3 | 4 | 5 | 38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /layouts/_default/search.json: -------------------------------------------------------------------------------- 1 | {{- $pages := where .Site.RegularPages "Type" "in" (slice "posts" "status") -}} 2 | {{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} 3 | {{- $filtered := ($pages | intersect $notHidden) -}} 4 | 5 | {{- $result := slice -}} 6 | 7 | {{- range $filtered -}} 8 | {{- $data := slice (slice .Title (.Date.Format "2006年01月01日") .RelPermalink (replaceRE "( )+?|\r?\n" " " (replaceRE "```(.|\n)+?```|{{.+?}}(.|\r?\n?)+?{{.+?}}|{{.+?}}|`(.+?)`" " " .RawContent | markdownify | plainify)) ) -}} 9 | 10 | {{- $result = $result | append slice (slice .Title (.Date.Format "2006年01月01日") .RelPermalink (replaceRE "( )+?|\r?\n" " " (replaceRE "```(.|\n)+?```|{{.+?}}(.|\r?\n?)+?{{.+?}}|{{.+?}}|`(.+?)`" " " .RawContent | markdownify | plainify)) ) -}} 11 | {{- end -}} 12 | 13 | {{- jsonify $result -}} 14 | -------------------------------------------------------------------------------- /layouts/_default/section.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/layouts/_default/section.html -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | {{- partial "article/article" . }} 3 | {{ end }} 4 | -------------------------------------------------------------------------------- /layouts/_default/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
4 |
5 | 6 | {{- $coundHTML := printf `%s` (len .Pages | string) -}} 7 | {{- $titleHTML := printf `%s` .Title -}} 8 | {{- if eq .Data.Plural "tags" -}} 9 | {{- T "taxonomy.tag" (dict "Count" $coundHTML "Title" $titleHTML) | safeHTML -}} 10 | {{- else -}} 11 | {{- T "taxonomy.category" (dict "Count" $coundHTML "Title" $titleHTML) | safeHTML -}} 12 | {{- end -}} 13 |
14 |
15 | {{- $paginator := .Paginate (where .Pages "Type" "in" (slice "posts" "status")) -}} 16 | {{- range $paginator.Pages -}} 17 | {{- partial "article-list/article" . -}} 18 | {{- end -}} 19 |
20 |
21 | 22 | {{- partial "article-list/components/pagination" . -}} 23 |
24 | {{- end -}} 25 | -------------------------------------------------------------------------------- /layouts/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
4 |
5 | {{- if eq .Title "Categories" -}} 6 | 7 | {{- else -}} 8 | 9 | {{- end -}} 10 | {{- .Title -}} 11 |
12 |
13 | {{- if eq .Title "Categories" -}} 14 | {{- $totalCategories := len .Site.Taxonomies.categories | string -}} 15 | {{- $totalCategoriesHTML := printf `%s` $totalCategories -}} 16 | {{- T "taxonomy.totalCategories" $totalCategoriesHTML | safeHTML -}} 17 | {{- else -}} 18 | {{- $totalTags := len .Site.Taxonomies.tags | string -}} 19 | {{- $totalTagsHTML := printf `%s` $totalTags -}} 20 | {{- T "taxonomy.totalTags" $totalTagsHTML | safeHTML -}} 21 | {{- end -}} 22 |
23 |
24 | 25 |
26 | {{- if eq .Title "Categories" -}} 27 | {{- range sort .Site.Taxonomies.categories "Count" "desc" -}} 28 | 32 | {{- .Page.Title -}} 33 | {{- .Count -}} 34 | 35 | {{- end -}} 36 | {{- else -}} 37 | {{- range sort .Site.Taxonomies.tags "Count" "desc" -}} 38 | {{- $size := add (mul .Count 0.15) 0.75 -}} 39 | {{- if gt $size 4 -}} 40 | {{- $size = 3 -}} 41 | {{- end -}} 42 | 47 | {{- .Page.Title -}} 48 | {{- .Count -}} 49 | 50 | {{- end -}} 51 | {{- end -}} 52 |
53 |
54 | {{- end -}} 55 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
4 |
5 | 6 | {{- $totalPost := len (where site.RegularPages "Type" "in" (slice "posts" "status")) | string -}} 7 | {{- $totalPostHTML := printf `%s` $totalPost -}} 8 | {{- T "post.archiveCounter" $totalPostHTML | safeHTML -}} 9 |
10 | 11 | {{- partial "components/announcement" . -}} 12 | 13 |
14 | {{- $paginator := .Paginate (where site.RegularPages "Type" "in" (slice "posts" "status")) -}} 15 | {{- range $paginator.Pages -}} 16 | {{- partial "article-list/article" . -}} 17 | {{- end -}} 18 |
19 |
20 | 21 | {{- partial "article-list/components/pagination" . -}} 22 |
23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /layouts/index.rss.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | {{- .Site.Title -}} 12 | 13 | {{- .Permalink -}} 14 | {{- .Site.Params.author.name -}} 15 | {{- or .Site.Params.Description .Site.Title -}} 16 | {{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}} 17 | {{- .Site.LanguageCode -}} 18 | Hugo -- gohugo.io 19 | {{- $outputFullText := .Site.Params.rss.fullText -}} 20 | {{- range first 10 (where .Site.RegularPages "Type" "in" (slice "posts" "status")) -}} 21 | 22 | {{- .Title -}} 23 | {{- .Permalink -}} 24 | {{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}} 25 | {{- with .Site.Params.author.email -}}{{.}}{{- with $.Site.Params.author.name -}} ({{.}}){{end}}{{end}} 26 | {{- .Permalink -}} 27 | {{- if $outputFullText -}} 28 | {{- (replaceRE "" (print "

" (T "encrypt.protectedByPassword") "

") (replaceRE "(.|\n)+?|" "" .Content)) | html -}}
29 | {{- else -}} 30 | {{- .Summary -}} 31 | {{- end -}} 32 |
33 | {{- end -}} 34 |
35 |
-------------------------------------------------------------------------------- /layouts/partials/article-list/article.html: -------------------------------------------------------------------------------- 1 | {{- if eq .Type "posts" -}} 2 | {{- partial "article-list/type/posts" . }} 3 | {{- else -}} 4 | {{- partial "article-list/type/status" . }} 5 | {{- end -}} 6 | -------------------------------------------------------------------------------- /layouts/partials/article-list/components/cover.html: -------------------------------------------------------------------------------- 1 | {{- $hasCover := or (.Site.Params.defaultFeaturedImage) (.Params.featured_image) -}} 2 | 3 | {{- if $hasCover -}} 4 | {{- partial "article-list/components/with-cover" . }} 5 | {{- else -}} 6 | {{- partial "article-list/components/no-cover" . }} 7 | {{- end -}} 8 | -------------------------------------------------------------------------------- /layouts/partials/article-list/components/info.html: -------------------------------------------------------------------------------- 1 | {{- $hasCover := or (.Site.Params.defaultFeaturedImage) (.Params.featured_image) -}} 2 | 60 | -------------------------------------------------------------------------------- /layouts/partials/article-list/components/no-cover.html: -------------------------------------------------------------------------------- 1 | {{- $Summary := .Summary | plainify -}} 2 | 3 |
{{- .Title -}}
4 | {{- with $Summary -}}
{{ . }}
{{- end -}} 5 |
6 | -------------------------------------------------------------------------------- /layouts/partials/article-list/components/pagination.html: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /layouts/partials/article-list/type/posts.html: -------------------------------------------------------------------------------- 1 |
4 | {{- partial "article-list/components/cover" . }} 5 | {{- partial "article-list/components/info" . }} 6 |
7 | -------------------------------------------------------------------------------- /layouts/partials/article-list/type/status.html: -------------------------------------------------------------------------------- 1 | {{- $Summary := .Summary | plainify -}} 2 | 3 | 25 | -------------------------------------------------------------------------------- /layouts/partials/article/article.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | {{- partial "article/components/cover" . }} 5 | 6 | {{- partial "article/components/info" . }} 7 | 8 | {{- partial "article/components/toc" . }} 9 | 10 | {{- partial "article/components/lastmod" . }} 11 | 12 | {{- partial "article/components/content" . }} 13 | 14 | {{- partial "article/components/footer" . }} 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /layouts/partials/article/components/content.html: -------------------------------------------------------------------------------- 1 |
2 | {{- if .Site.Params.bionicReading.enabled -}} 3 | {{- $.Site.Data.luna.icon.wand | safeHTML -}} 6 | {{- end -}} 7 | {{- .Content -}} 8 |
9 | -------------------------------------------------------------------------------- /layouts/partials/article/components/cover.html: -------------------------------------------------------------------------------- 1 |
2 | {{- if .Params.featured_image -}} 3 | {{- partial "article/components/with-cover" . }} 4 | {{- else -}} 5 | {{- partial "article/components/no-cover" . }} 6 | {{- end -}} 7 |
8 | -------------------------------------------------------------------------------- /layouts/partials/article/components/footer.html: -------------------------------------------------------------------------------- 1 | {{- partial "article/components/refs" . }} 2 | {{- partial "article/components/share" . }} 3 |
4 | {{- partial "article/components/pagination" . }} 5 | {{- partial "comments/include.html" . -}} 6 | -------------------------------------------------------------------------------- /layouts/partials/article/components/lastmod.html: -------------------------------------------------------------------------------- 1 | {{- $config := .Site.Params.outdatedInfoWarning -}} 2 | {{- if $config.enabled -}} 3 | {{- $updateTime := .Lastmod -}} 4 | {{- if .GitInfo -}} 5 | {{- if lt .GitInfo.AuthorDate.Unix .Lastmod.Unix -}} 6 | {{- $updateTime := .GitInfo.AuthorDate -}} 7 | {{- end -}} 8 | {{- end -}} 9 | {{- $lastMod := int (div (now.Sub ($updateTime)).Hours 24) -}} 10 | {{- $lastModHTML := printf `%s` ($lastMod | string) -}} 11 | {{- if (gt $lastMod $config.day) -}} 12 |
13 | 17 |
18 | {{- end -}} 19 | {{- end -}} 20 | -------------------------------------------------------------------------------- /layouts/partials/article/components/license.html: -------------------------------------------------------------------------------- 1 | {{- $license := .Site.Params.license -}} 2 | 3 | {{- if $license.enabled -}} 4 | 9 |
10 | 11 | {{- $license.name -}} 12 | 13 |
14 | {{- end -}} 15 | -------------------------------------------------------------------------------- /layouts/partials/article/components/no-cover.html: -------------------------------------------------------------------------------- 1 | {{- $Title := or $.Title (T "post.untitled") -}} 2 | 3 |
4 |
5 | {{ $Title }} 6 |
7 |
8 | -------------------------------------------------------------------------------- /layouts/partials/article/components/pagination.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 14 |
15 | 16 | {{- partial "article/components/license" . }} 17 | 18 | 29 |
30 | -------------------------------------------------------------------------------- /layouts/partials/article/components/refs.html: -------------------------------------------------------------------------------- 1 | {{- if .Params.refs -}} 2 |
3 |
{{- T "post.refs" -}}
4 |
5 | {{- range $index, $ref := .Params.refs -}} 6 | 12 | {{- end -}} 13 |
14 |
15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /layouts/partials/article/components/share.html: -------------------------------------------------------------------------------- 1 | {{- $url := .Permalink | safeURL -}} 2 | {{- $text := (trim (replaceRE "\r?\n" "" (.Summary | plainify)) " ") | safeURL -}} 3 | {{- $config := .Site.Params.share -}} 4 | {{- if $config -}} 5 |
6 | {{- if (index $config "twitter") -}} 7 | 15 | {{- end -}} 16 | 17 | {{- if (index $config "facebook") -}} 18 | 26 | {{- end -}} 27 | 28 | {{- if (index $config "weibo") -}} 29 | 36 | {{- $.Site.Data.luna.icon.weibo | safeHTML -}} 37 | 38 | {{- end -}} 39 | {{- if (index $config "copyLinkText") -}} 40 | 41 | {{- end -}} 42 | 43 | {{- if (index $config "qrcode") -}} 44 | 52 | {{- end -}} 53 |
54 | {{- end -}} 55 | -------------------------------------------------------------------------------- /layouts/partials/article/components/toc.html: -------------------------------------------------------------------------------- 1 | {{- $showTOC := false -}} 2 | 3 | {{- if isset .Params "toc" -}} 4 | {{- $showTOC = .Params.Toc -}} 5 | {{- else if .Site.Params.Toc.enabled -}} 6 | {{- $showTOC = true -}} 7 | {{- end -}} 8 | 9 | {{- if $showTOC -}} 10 | {{- if gt .WordCount .Site.Params.Toc.wordCount -}} 11 | 19 | {{- end -}} 20 | {{- end -}} 21 | -------------------------------------------------------------------------------- /layouts/partials/comments/include.html: -------------------------------------------------------------------------------- 1 | {{- $showComments := .Site.Params.comments.enabled -}} 2 | 3 | {{- if isset .Page.Params "comments" -}} 4 | {{- if not .Page.Params.comments -}} 5 | {{- $showComments = false -}} 6 | {{- end -}} 7 | {{- end -}} 8 | 9 | {{- if $showComments -}} 10 |
11 | {{ partial (printf "comments/provider/%s" .Site.Params.comments.provider) . }} 12 |
13 | {{ end }} 14 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/custom.html: -------------------------------------------------------------------------------- 1 | your comment code 2 | 5 | -------------------------------------------------------------------------------- /layouts/partials/comments/provider/giscus.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.comments.giscus -}} 2 | 19 | 20 | 53 | {{- end -}} 54 | -------------------------------------------------------------------------------- /layouts/partials/components/announcement.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.announcement.enabled -}} 2 | {{- with resources.Get .Site.Params.announcement.file -}} 3 |
4 | 5 | {{- .Content | markdownify -}} 6 |
7 | {{- end -}} 8 | {{- end -}} 9 | -------------------------------------------------------------------------------- /layouts/partials/components/backtop.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.backtop -}} 2 | 8 |
9 |
10 | 11 |
12 | 13 | 24 | 25 |
26 |
27 | {{- end -}} 28 | -------------------------------------------------------------------------------- /layouts/partials/components/dark-mode.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /layouts/partials/components/i18nlist.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.i18nlist -}} 2 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 3 | 4 | 5 |
6 | {{- if .IsTranslated -}} 7 |
15 | 16 | 21 | 35 |
36 | {{- end -}} 37 |
38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /layouts/partials/components/run-time.html: -------------------------------------------------------------------------------- 1 |
2 | {{ T "runTime.text" }} 0 3 | {{ T "runTime.days" }} 4 | 0 5 | {{ T "runTime.hours" }} 6 | 0 7 | {{ T "runTime.minutes" }} 8 | 0 9 | {{ T "runTime.seconds" }} 10 |
11 | -------------------------------------------------------------------------------- /layouts/partials/custom/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /layouts/partials/custom/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /layouts/partials/custom/icons.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /layouts/partials/custom/script.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /layouts/partials/data/description.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $description := or .Description .Site.Params.description }} 3 | {{- if .IsPage -}} 4 | 5 | {{- $description = .Summary -}} 6 | {{- end -}} 7 | 8 | {{- return ($description | plainify) -}} 9 | -------------------------------------------------------------------------------- /layouts/partials/data/image.html: -------------------------------------------------------------------------------- 1 | {{ $image := false }} 2 | {{- if or .Site.Params.opengraph.image .Params.featured_image -}} 3 | {{- if .Params.featured_image -}} 4 | {{- $image = .Resources.GetMatch .Params.featured_image -}} 5 | {{- else -}} 6 | {{- $image = resources.Get .Site.Params.opengraph.image -}} 7 | {{- end -}} 8 | {{- end -}} 9 | 10 | {{- return $image -}} 11 | -------------------------------------------------------------------------------- /layouts/partials/data/title.html: -------------------------------------------------------------------------------- 1 | {{- $title := .Title -}} 2 | {{- $siteTitle := .Site.Title -}} 3 | 4 | {{- if .IsHome -}} 5 | 6 | 7 | 8 | {{ $pages := where site.RegularPages "Type" "in" (slice "posts" "status") }} 9 | {{ $pag := .Paginate $pages }} 10 | 11 | {{ if .Paginator.HasPrev }} 12 | 13 | {{ $title = printf "%s - %s" (T "page.page" (string .Paginator.PageNumber)) $siteTitle }} 14 | {{ else }} 15 | {{ $title = $siteTitle }} 16 | {{ end }} 17 | {{- else if eq .Kind "term" -}} 18 | 19 | 20 | 21 | {{ $pages := where .Pages "Type" "in" (slice "posts" "status") }} 22 | {{ $pag := .Paginate $pages }} 23 | 24 | 25 | 26 | {{ $title = slice (T (printf `taxonomy._%s` .Data.Plural)) ": " $title }} 27 | 28 | {{ if .Paginator.HasPrev }} 29 | 30 | {{ $title = $title | append " - " (T "page.page" (string .Paginator.PageNumber)) }} 31 | {{ end }} 32 | 33 | {{ $title = $title | append " - " $siteTitle }} 34 | {{ $title = delimit $title "" }} 35 | {{- else -}} 36 | {{ $title = printf "%s - %s" $title $siteTitle }} 37 | {{- end -}} 38 | 39 | {{ return $title }} 40 | -------------------------------------------------------------------------------- /layouts/partials/helper/resources.html: -------------------------------------------------------------------------------- 1 | {{- $svg_files := dict "error_svg" "images/error.svg" "search_svg" "images/search.svg" "outload_svg" "images/outload.svg" "offline_html" "offline.html" -}} 2 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 3 | 4 | {{- range $filename, $path := $svg_files -}} 5 | {{- $svg := resources.Get $path | resources.ExecuteAsTemplate $path $ -}} 6 | {{- $.Store.Set $filename (print $public_cdn $svg.RelPermalink) -}} 7 | {{- end -}} 8 | -------------------------------------------------------------------------------- /layouts/partials/html/head/head.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | 3 | {{- $title := partial "data/title" . .RelPermalink -}} 4 | {{- $description := partial "data/description" . .RelPermalink -}} 5 | 6 | {{- partial "helper/resources" . -}} 7 | 8 | 9 | 10 | {{- if .Site.Params.keywords -}} 11 | 12 | {{- end -}} 13 | 14 | 15 | 16 | 17 | 18 | {{- $title -}} 19 | {{- $sassTemplate := resources.Get "sass/main.scss" -}} 20 | {{- $styles := $sassTemplate | resources.ExecuteAsTemplate "main.css" . | css.Sass | postCSS (dict "config" "postcss.config.js") -}} 21 | 22 | {{- if hugo.IsServer -}} 23 | 24 | {{- else -}} 25 | {{- $styles := $styles | fingerprint | resources.PostProcess -}} 26 | 27 | {{- end -}} 28 | 29 | {{- partial "html/head/opengraph/include.html" . -}} 30 | 31 | {{- $favicon_icon := resources.Get "icon.png" -}} 32 | {{- $favicon_icon = $favicon_icon.Resize "48x48 ico icon" -}} 33 | {{- $favicon_icon = slice $favicon_icon | resources.Concat "favicon.ico" -}} 34 | {{- $favicon_icon = print $public_cdn $favicon_icon.RelPermalink -}} 35 | 36 | 37 | 38 | {{- $manifest := resources.Get "manifest.json" | resources.ExecuteAsTemplate (print ("/" | relLangURL) "manifest.json") . -}} 39 | 40 | 41 | {{- $icon := print $public_cdn (resources.Get "icon.png").RelPermalink -}} 42 | 43 | 44 | 45 | {{- partial "html/head/site-schema.html" . -}} 46 | 47 | {{- partial "custom/head" . -}} 48 | -------------------------------------------------------------------------------- /layouts/partials/html/head/opengraph/include.html: -------------------------------------------------------------------------------- 1 | {{ partial "html/head/opengraph/provider/base" . }} 2 | {{ partial "html/head/opengraph/provider/twitter" . }} 3 | -------------------------------------------------------------------------------- /layouts/partials/html/head/opengraph/provider/base.html: -------------------------------------------------------------------------------- 1 | {{- $title := partial "data/title" . .RelPermalink -}} 2 | {{- $description := partial "data/description" . .RelPermalink -}} 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{- if .Site.Params.opengraph.image -}} 10 | {{- $image := partial "data/image" . .RelPermalink -}} 11 | {{- with $image.Permalink -}}{{- end -}} 12 | {{- with $image.Width -}}{{- end -}} 13 | {{- with $image.Height -}}{{- end -}} 14 | {{- end -}} 15 | 16 | 17 | {{- if .IsPage -}} 18 | {{- if not .Date.IsZero -}} 19 | 20 | {{- end -}} 21 | {{- if not .Lastmod.IsZero -}} 22 | 23 | {{- end -}} 24 | {{- else -}} 25 | {{- if not .Site.Lastmod.IsZero -}} 26 | 27 | {{- end -}} 28 | {{- end -}} 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /layouts/partials/html/head/opengraph/provider/twitter.html: -------------------------------------------------------------------------------- 1 | {{- $twitterSummary := .Site.Params.opengraph.twitter -}} 2 | {{- $title := partial "data/title" . .RelPermalink -}} 3 | {{- $description := partial "data/description" . .RelPermalink -}} 4 | 5 | 6 | {{- with $twitterSummary.site -}} 7 | 8 | 9 | {{- end -}} 10 | 11 | 12 | 13 | 14 | {{- if .Site.Params.opengraph.image -}} 15 | {{- $image := partial "data/image" . .RelPermalink -}} 16 | 17 | {{- end -}} 18 | -------------------------------------------------------------------------------- /layouts/partials/html/head/site-schema.html: -------------------------------------------------------------------------------- 1 | {{- if .IsHome -}} 2 | {{/* "potentialAction": { 28 | "@type": "SearchAction", 29 | "target": "http://example.com/search?&q={query}", 30 | "query-input": "required" 31 | } 32 | */}} 33 | {{- else if .IsPage -}} 34 | 96 | {{- end -}} 97 | -------------------------------------------------------------------------------- /layouts/partials/html/style.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /layouts/partials/noscript.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /layouts/partials/scripts/custom.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | {{- $customScript := resources.Get "ts/custom.ts" | js.Build (dict "minify" hugo.IsProduction) -}} 3 | {{- if hugo.IsServer -}} 4 | 9 | {{- else -}} 10 | {{- $customScript = $customScript | fingerprint -}} 11 | 17 | {{- end -}} 18 | -------------------------------------------------------------------------------- /layouts/partials/scripts/google-translate.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | {{- $script := resources.Get "translate-google.js" | js.Build (dict "minify" hugo.IsProduction) -}} 3 | 4 | {{- if hugo.IsServer -}} 5 | 6 | {{- else -}} 7 | {{- $script := $script | fingerprint -}} 8 | 9 | {{- end -}} 10 | 11 | {{- $sass := resources.Get "sass/translateelement.scss" -}} 12 | {{- $style := $sass | css.Sass | minify | fingerprint -}} 22 | -------------------------------------------------------------------------------- /layouts/partials/scripts/main-script.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | 3 | {{- $scratch := newScratch -}} 4 | {{- $scratch.SetInMap "jsModules" "lazyload" (cond .Site.Params.lazyload "ts/modules/lazyload.js" "ts/_.ts") -}} 5 | {{- $scratch.SetInMap "jsModules" "medium-zoom" (cond .Site.Params.imageZoom "ts/modules/medium-zoom.js" "ts/_.ts") -}} 6 | {{- $scratch.SetInMap "jsModules" "jump.js" (cond .Site.Params.backtop "ts/modules/jump.js" "ts/_.ts") -}} 7 | {{- $scratch.SetInMap "jsModules" "pangu" (cond .Site.Params.pangu "ts/modules/pangu.js" "ts/_.ts") -}} 8 | {{- $scratch.SetInMap "jsModules" "katex" (cond .Site.Params.katex "ts/modules/katex" "ts/_.ts") -}} 9 | {{- $scratch.SetInMap "jsModules" "katex-render" (cond .Site.Params.katex "ts/modules/katex-render" "ts/_.ts") -}} 10 | {{- $scratch.SetInMap "jsModules" "katex-copy" (cond .Site.Params.katex "ts/modules/katex-copy" "ts/_.ts") -}} 11 | {{- $scratch.SetInMap "jsModules" "flexsearch" (cond .Site.Params.search "ts/modules/flexsearch" "ts/_.ts") -}} 12 | {{- $scratch.SetInMap "jsModules" "clipboard" "ts/modules/clipboard" -}} 13 | 14 | {{- $scratch.SetInMap "jsModules" "swup" (cond .Site.Params.pjax "ts/modules/swup.js" "ts/_.ts") -}} 15 | {{- $scratch.SetInMap "jsModules" "swupFadeTheme" (cond .Site.Params.pjax "ts/modules/swupFadeTheme.js" "ts/_.ts") -}} 16 | {{- $scratch.SetInMap "jsModules" "swupProgressPlugin" (cond .Site.Params.pjax "ts/modules/swupProgressPlugin.js" "ts/_.ts") -}} 17 | {{- $scratch.SetInMap "jsModules" "swupGaPlugin" (cond .Site.Params.pjax "ts/modules/swupGaPlugin.js" "ts/_.ts") -}} 18 | {{- $scratch.SetInMap "jsModules" "swupScriptsPlugin" (cond .Site.Params.pjax "ts/modules/swupScriptsPlugin.js" "ts/_.ts") -}} 19 | {{- $scratch.SetInMap "jsModules" "swupMorphPlugin" (cond .Site.Params.pjax "ts/modules/swupMorphPlugin.js" "ts/_.ts") -}} 20 | {{- $scratch.SetInMap "jsModules" "swupHeadPlugin" (cond .Site.Params.pjax "ts/modules/swupHeadPlugin.js" "ts/_.ts") -}} 21 | 22 | {{- $mainScript := resources.Get "ts/main.ts" | js.Build (dict "minify" hugo.IsProduction "params" (dict "foo" "bar") "shims" ($scratch.Get "jsModules")) -}} 23 | {{- if hugo.IsServer -}} 24 | 25 | {{- else -}} 26 | {{- $mainScript := $mainScript | fingerprint -}} 27 | 28 | {{- end -}} 29 | -------------------------------------------------------------------------------- /layouts/partials/scripts/pwa.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | 3 | {{- $script := resources.Get "sw.js" | js.Build (dict "minify" hugo.IsProduction "params" (dict "cdn" $public_cdn "url" .Site.BaseURL)) -}} 10 | -------------------------------------------------------------------------------- /layouts/partials/scripts/theme-script.html: -------------------------------------------------------------------------------- 1 | {{- $pjax := .Site.Params.pjax -}} 2 | {{- $isServer := hugo.IsServer -}} 3 | {{- $version := getenv "HUGO_VERSION" -}} 4 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 63 | -------------------------------------------------------------------------------- /layouts/shortcodes/abbr.html: -------------------------------------------------------------------------------- 1 | {{- .Get 0 -}} 2 | -------------------------------------------------------------------------------- /layouts/shortcodes/accordion.html: -------------------------------------------------------------------------------- 1 |
2 | {{- index .Params 0 -}} 3 |
{{- .Inner | markdownify -}}
4 |
5 | -------------------------------------------------------------------------------- /layouts/shortcodes/align.html: -------------------------------------------------------------------------------- 1 |

{{- index .Params 1 | markdownify -}}

2 | -------------------------------------------------------------------------------- /layouts/shortcodes/bilibili.html: -------------------------------------------------------------------------------- 1 | {{- $vid := (.Get 0) -}} 2 | {{- $videopage := default 1 (.Get 1) -}} 3 | {{- $basicQuery := querify "page" $videopage "high_quality" 1 "as_wide" 1 -}} 4 | {{- $videoQuery := "" -}} 5 | 6 | {{- if strings.HasPrefix (lower $vid) "av" -}} 7 | {{- $videoQuery = querify "aid" (strings.TrimPrefix "av" (lower $vid)) -}} 8 | {{- else if strings.HasPrefix (lower $vid) "bv" -}} 9 | {{- $videoQuery = querify "bvid" $vid -}} 10 | {{- else -}} 11 |

Bilibili 视频av号或BV号错误!请检查视频av号或BV号是否正确

12 |

当前视频av或BV号:{{- $vid -}},视频分P:{{- $videopage -}}

13 | {{- end -}} 14 |
15 | 26 |
27 | -------------------------------------------------------------------------------- /layouts/shortcodes/button-outline.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "theme" "bg-theme/10 text-theme hover:bg-theme/5" -}} 3 | {{- $colors.Set "red" "bg-red-500/10 text-red-500 hover:bg-red-500/5" -}} 4 | {{- $colors.Set "green" "bg-green-500/10 text-green-500 hover:bg-green-500/5" -}} 5 | {{- $colors.Set "blue" "bg-blue-500/10 text-blue-500 hover:bg-blue-500/5" -}} 6 | {{- $colors.Set "orange" "bg-orange-500/10 text-orange-500 hover:bg-orange-500/5" -}} 7 | {{- $color := $colors.Get (or (.Get "color") "theme") -}} 8 | 9 | {{- $sizes := newScratch -}} 10 | {{- $sizes.Set "small" "text-sm px-3 py-1.5" -}} 11 | {{- $sizes.Set "normal" "text-base px-4 py-2" -}} 12 | {{- $sizes.Set "large" "text-lg px-5 py-3" -}} 13 | {{- $size := $sizes.Get (or (.Get "size") "normal") -}} 14 | 15 | {{- if .Get "link" -}} 16 | 21 | 22 | {{- .Get "content" | markdownify -}} 23 | 24 | {{- else -}} 25 |
26 | 27 | {{- .Get "content" | markdownify -}} 28 |
29 | {{- end -}} 30 | -------------------------------------------------------------------------------- /layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "theme" "bg-theme" -}} 3 | {{- $colors.Set "red" "bg-red-400" -}} 4 | {{- $colors.Set "green" "bg-green-400" -}} 5 | {{- $colors.Set "blue" "bg-blue-400" -}} 6 | {{- $colors.Set "orange" "bg-orange-400" -}} 7 | {{- $color := $colors.Get (or (.Get "color") "theme") -}} 8 | 9 | {{- $sizes := newScratch -}} 10 | {{- $sizes.Set "small" "text-sm px-3 py-1.5" -}} 11 | {{- $sizes.Set "normal" "text-base px-4 py-2" -}} 12 | {{- $sizes.Set "large" "text-lg px-5 py-3" -}} 13 | {{- $size := $sizes.Get (or (.Get "size") "normal") -}} 14 | 15 | {{- if .Get "link" -}} 16 | 21 | 22 | {{- .Get "content" | markdownify -}} 23 | 24 | {{- else -}} 25 |
26 | 27 | {{- .Get "content" | markdownify -}} 28 |
29 | {{- end -}} 30 | -------------------------------------------------------------------------------- /layouts/shortcodes/carousel.html: -------------------------------------------------------------------------------- 1 | {{- $id := print "slide-" (delimit (shuffle (seq 1 9)) "") "-" -}} 2 | 3 | 4 | 57 | -------------------------------------------------------------------------------- /layouts/shortcodes/color.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "red" "text-red-400" -}} 3 | {{- $colors.Set "green" "text-green-400" -}} 4 | {{- $colors.Set "blue" "text-blue-400" -}} 5 | {{- $colors.Set "orange" "text-orange-400" -}} 6 | {{- $colors.Set "theme" "text-theme" -}} 7 | 8 | {{- $color := index .Params 0 -}} 9 | {{- $content := index .Params 1 | markdownify -}} 10 | 11 | {{- if ($colors.Get $color) -}} 12 | {{- $content -}} 13 | {{- else -}} 14 | {{- $content -}} 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /layouts/shortcodes/gallery-grid.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /layouts/shortcodes/gallery.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /layouts/shortcodes/github-auto.html: -------------------------------------------------------------------------------- 1 | {{- $githubData := dict -}} 2 | {{ with try (resources.GetRemote (print "https://api.github.com/repos/" (.Get "name"))) }} 3 | {{ with .Err }} 4 | {{ errorf "%s" . }} 5 | {{ else with .Value }} 6 | {{ $githubData = . | transform.Unmarshal }} 7 | {{ else }} 8 | {{ errorf "Unable to get remote resource %q" (print "https://api.github.com/repos/" (.Get "name")) }} 9 | {{ end }} 10 | {{ end }} 11 | {{- $githubColors := .Site.Data.luna.githubColors -}} 12 | {{- with $githubData -}} 13 |
14 |
15 | 16 | {{- .full_name -}} 17 |
18 |
{{- .description -}}
19 |
20 |
21 | 22 | {{- .language -}} 23 |
24 |
25 | 26 | {{- .stargazers_count -}} 27 |
28 |
29 | 30 | {{- .forks -}} 31 |
32 |
33 |
34 | {{- end -}} 35 | -------------------------------------------------------------------------------- /layouts/shortcodes/github.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | {{- .Get "name" -}} 5 |
6 |
{{- .Get "description" -}}
7 |
8 | 9 | {{- .Get "language" -}} 10 |
11 |
12 | -------------------------------------------------------------------------------- /layouts/shortcodes/hidden-text.html: -------------------------------------------------------------------------------- 1 | {{- if .Get 1 -}} 2 | {{- .Get 0 | markdownify -}} 3 | {{- else -}} 4 | {{- .Get 0 | markdownify -}} 8 | {{- end -}} 9 | -------------------------------------------------------------------------------- /layouts/shortcodes/hidden.html: -------------------------------------------------------------------------------- 1 | {{- if .Get 0 -}} 2 |
3 | {{- .Inner | markdownify -}} 4 |
5 | {{- else -}} 6 |
9 | {{- .Inner | markdownify -}} 10 |
11 | {{- end -}} 12 | -------------------------------------------------------------------------------- /layouts/shortcodes/hr.html: -------------------------------------------------------------------------------- 1 |
2 | {{- .Get 0 -}} 3 |
4 | -------------------------------------------------------------------------------- /layouts/shortcodes/hugo-encrypt.html: -------------------------------------------------------------------------------- 1 | {{ $_hugo_config := `{ "version": 1 }` }} 2 | {{- $randomID := delimit (shuffle (split (md5 now.Unix) "" )) "" -}} 3 | 4 | {{- if .Get 0 -}} 5 | {{- $.Page.Store.Set "passphrase" (.Get 0) -}} 6 | {{- else if .Site.Params.HugoEncrypt.Password -}} 7 | {{- $.Page.Store.Set "passphrase" .Site.Params.HugoEncrypt.Password -}} 8 | {{- else -}} 9 | {{- warnf "!!! [Hugo Encrypt] Please set a password" -}} 10 | {{- end -}} 11 | 12 | {{- if ($.Page.Store.Get "passphrase") -}} 13 | 14 |
15 |
{{- i18n "encrypt.protectedByPassword" -}}
16 | 17 | 18 |
19 | 23 | 29 |
30 |
31 |
32 | 38 |
39 | {{- end -}} 40 | -------------------------------------------------------------------------------- /layouts/shortcodes/link-card.html: -------------------------------------------------------------------------------- 1 | 7 |
8 |
9 |
{{- .Get "name" -}}
10 | {{- if (.Get "desc") -}} 11 |
{{- .Get "desc" -}}
12 | {{- end -}} 13 |
14 | 15 | {{- if (.Get "link") -}} 16 |
17 | {{- $url := urls.Parse (.Get "link") -}} 18 | 19 |
{{- .Get "link" -}}
20 |
21 | {{- end -}} 22 |
23 | {{- if (.Get "img") -}} 24 | {{- .Get 25 | {{- end -}} 26 |
27 | -------------------------------------------------------------------------------- /layouts/shortcodes/link.html: -------------------------------------------------------------------------------- 1 | {{- $title := .Get "title" -}} 2 | {{- $url := .Get "url" -}} 3 | {{- $desc := .Get "desc" -}} 4 | {{- $image := .Get "image" -}} 5 | {{- $lazyload := .Site.Params.lazyload -}} 6 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 7 | {{- $svg_outload := "images/outload.svg" | relURL -}} 8 | 9 | {{- if not (urls.Parse $image).Scheme -}} 10 | {{- $image = print $public_cdn (.Page.Resources.Get $image).RelPermalink -}} 11 | {{- end -}} 12 | 41 | -------------------------------------------------------------------------------- /layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 | {{- $noticeType := .Get 0 -}} 2 | 3 | {{- $raw := (markdownify .Inner | chomp) -}} 4 | 5 | {{- $block := findRE "(?is)^<(?:address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h(?:1|2|3|4|5|6)|header|hgroup|hr|li|main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video)\\b" $raw 1 -}} 6 | 7 | {{- $icons := newScratch -}} 8 | {{- $colors := newScratch -}} 9 | 10 | {{- $icons.Set "warn" "eva-alert-circle-outline" -}} 11 | {{- $colors.Set "warn" "yellow-400" -}} 12 | 13 | {{- $icons.Set "success" "eva-checkmark-circle-2-outline" -}} 14 | {{- $colors.Set "success" "green-400" -}} 15 | 16 | {{- $icons.Set "error" "eva-minus-circle-outline" -}} 17 | {{- $colors.Set "error" "red-400" -}} 18 | 19 | {{- $icons.Set "info" "eva-question-mark-circle-outline" -}} 20 | {{- $colors.Set "info" "blue-400" -}} 21 | 22 | 23 |
24 |
25 |
26 | 27 |
31 |
32 | 33 |
34 | {{- if or $block (not $raw) -}} 35 | {{- $raw -}} 36 | {{- else -}} 37 |

{{- $raw -}}

38 | {{- end -}} 39 |
40 | -------------------------------------------------------------------------------- /layouts/shortcodes/progress.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "red" "bg-red-400" -}} 3 | {{- $colors.Set "green" "bg-green-400" -}} 4 | {{- $colors.Set "blue" "bg-blue-400" -}} 5 | {{- $colors.Set "orange" "bg-orange-400" -}} 6 | {{- $colors.Set "theme" "bg-theme" -}} 7 | 8 | 9 |
10 |
11 |
{{- index .Params 2 -}}
12 |
{{- index .Params 0 -}}%
13 |
14 |
15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /layouts/shortcodes/quote-center.html: -------------------------------------------------------------------------------- 1 |
2 | {{- $content := .Inner | markdownify -}} 3 | {{- if not (strings.HasPrefix $content "

") -}} 4 | {{ printf `

%s

` $content | safeHTML -}} 5 | {{- else -}} 6 | {{- $content -}} 7 | {{- end -}} 8 |
9 | -------------------------------------------------------------------------------- /layouts/shortcodes/quote.html: -------------------------------------------------------------------------------- 1 |
2 | {{- $content := .Inner | markdownify -}} 3 | {{- if not (strings.HasPrefix $content "

") }} 4 | {{- printf `

%s

` $content | safeHTML -}} 5 | {{- else }} 6 | {{- $content }} 7 | {{- end -}} 8 |
9 | -------------------------------------------------------------------------------- /layouts/shortcodes/rating.html: -------------------------------------------------------------------------------- 1 | 2 | {{- if ge (.Get 0) (.Get 1) -}} 3 | {{- $star_outline := sub (int (.Get 0)) (int (.Get 1)) -}} 4 | {{- range $i, $sequence := (seq (.Get 1)) -}} 5 | 6 | {{- end -}} 7 | {{- range $i, $sequence := (seq $star_outline) -}} 8 | 9 | {{- end -}} 10 | {{- end -}} 11 | 12 | -------------------------------------------------------------------------------- /layouts/shortcodes/tab-panel.html: -------------------------------------------------------------------------------- 1 | {{- $id := print "tab-" (delimit (shuffle (seq 1 9)) "") "-" -}} 2 | 3 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /layouts/shortcodes/tab-view.html: -------------------------------------------------------------------------------- 1 |
2 | {{- .Inner -}} 3 |
4 | -------------------------------------------------------------------------------- /layouts/shortcodes/tag-outlined.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "red" "bg-red-500/10 text-red-500" -}} 3 | {{- $colors.Set "green" "bg-green-500/10 text-green-500" -}} 4 | {{- $colors.Set "blue" "bg-blue-500/10 text-blue-500" -}} 5 | {{- $colors.Set "orange" "bg-orange-500/10 text-orange-500" -}} 6 | {{- $colors.Set "theme" "bg-theme/10 text-theme" -}} 7 | 8 | 9 | {{- index .Params 1 | markdownify -}} 10 | -------------------------------------------------------------------------------- /layouts/shortcodes/tag.html: -------------------------------------------------------------------------------- 1 | {{- $colors := newScratch -}} 2 | {{- $colors.Set "red" "bg-red-500" -}} 3 | {{- $colors.Set "green" "bg-green-500" -}} 4 | {{- $colors.Set "blue" "bg-blue-500" -}} 5 | {{- $colors.Set "orange" "bg-orange-500" -}} 6 | {{- $colors.Set "theme" "bg-theme" -}} 7 | 8 | 9 | {{- index .Params 1 | markdownify -}} 10 | -------------------------------------------------------------------------------- /layouts/shortcodes/timeline.html: -------------------------------------------------------------------------------- 1 |
2 | {{- range $i, $text := .Params -}} 3 |
4 | {{- $text -}} 5 |
6 | {{- end -}} 7 |
8 | -------------------------------------------------------------------------------- /layouts/shortcodes/video.html: -------------------------------------------------------------------------------- 1 | {{- $public_cdn := cond hugo.IsServer "" .Site.Params.publicCDN -}} 2 | {{- $src := .Get "src" | default (.Get 0) -}} 3 | {{- if not (urls.Parse $src).Scheme -}} 4 | {{- $src = print $public_cdn .Page.RelPermalink $src -}} 5 | {{- end -}} 6 |
7 | 18 |
19 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm install postcss-cli -g && npm install --production && hugo --gc --minify --cleanDestinationDir -s ./exampleSite --themesDir ../.. --enableGitInfo" 3 | publish = "exampleSite/public" 4 | 5 | [build.environment] 6 | HUGO_VERSION = "0.146.0" 7 | HUGO_THEME = "repo" 8 | 9 | [[plugins]] 10 | package = "netlify-plugin-hugo-cache-resources" 11 | [plugins.inputs] 12 | debug = true 13 | # Relative path to source directory in case you use Hugo's "--s" option 14 | srcdir = "exampleSite" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hugo-theme-luna", 3 | "description": "A simple, performance-first, SEO-friendly Hugo theme", 4 | "version": "0.0.1", 5 | "license": "GPL V3.0 ", 6 | "author": "Ice-Hazymoon", 7 | "scripts": { 8 | "updateModules": "node ./updateModules.js", 9 | "prettier": "npx prettier --write ./layouts/**/*.html ./assets/sass/**/*.scss" 10 | }, 11 | "homepage": "https://github.com/Ice-Hazymoon/hugo-theme-luna", 12 | "bugs": { 13 | "url": "https://github.com/Ice-Hazymoon/hugo-theme-luna/issues" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/Ice-Hazymoon/hugo-theme-luna.git" 18 | }, 19 | "dependencies": { 20 | "@fullhuman/postcss-purgecss": "^5.0.0", 21 | "autoprefixer": "^10.4.21", 22 | "cssnano": "^6.1.2", 23 | "cssnano-preset-advanced": "^6.1.2", 24 | "postcss-cli": "^10.1.0", 25 | "postcss-easing-gradients": "^3.0.1", 26 | "postcss-font-display": "^0.3.0", 27 | "postcss-pxtorem": "^6.1.0", 28 | "postcss-replace-values": "^2.3.0", 29 | "tailwindcss": "^3.4.17" 30 | }, 31 | "devDependencies": { 32 | "@swup/fade-theme": "^2.0.1", 33 | "@swup/ga-plugin": "^2.0.0", 34 | "@swup/head-plugin": "^2.3.1", 35 | "@swup/progress-plugin": "^3.2.0", 36 | "@swup/scripts-plugin": "^2.1.0", 37 | "@swup/slide-theme": "^2.0.1", 38 | "clipboard": "^2.0.11", 39 | "eva-icons": "^1.1.3", 40 | "flexsearch": "^0.7.43", 41 | "jump.js": "github:Ice-Hazymoon/jump.js", 42 | "katex": "^0.16.22", 43 | "medium-zoom": "^1.1.0", 44 | "normalize.css": "^8.0.1", 45 | "pangu": "^4.0.7", 46 | "postcss": "^8.5.3", 47 | "prettier": "^3.5.3", 48 | "prettier-plugin-go-template": "^0.0.15", 49 | "prettier-plugin-tailwindcss": "^0.5.14", 50 | "swup": "^4.8.1", 51 | "swup-morph-plugin": "^1.3.0", 52 | "vanilla-lazyload": "^17.9.0" 53 | }, 54 | "browserslist": [ 55 | "last 1 Chrome versions" 56 | ] 57 | } 58 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const isDev = process.env.HUGO_ENVIRONMENT !== 'production'; 3 | module.exports = { 4 | modules: true, 5 | plugins: !isDev ? [ 6 | require('tailwindcss')({ 7 | config: path.join(__dirname, '/tailwind.config.js') 8 | }), 9 | require('postcss-pxtorem')({ 10 | rootValue: 16, 11 | propList: ['*'], 12 | selectorBlackList: ['html'] 13 | }), 14 | require('autoprefixer')({}), 15 | require('postcss-easing-gradients')({}), 16 | require('postcss-font-display')({ 17 | display: 'swap', 18 | replace: false 19 | }), 20 | require('@fullhuman/postcss-purgecss')({ 21 | content: [ 22 | path.join(__dirname, '/data/luna/icon.yaml').split(path.sep).join(path.posix.sep), 23 | path.join(__dirname, '/layouts/**/*.html').split(path.sep).join(path.posix.sep), 24 | path.join(__dirname, '/layouts/*.html').split(path.sep).join(path.posix.sep), 25 | path.join(__dirname, '/assets/**/*.ts').split(path.sep).join(path.posix.sep), 26 | ], 27 | safelist: { 28 | // xx 29 | standard: [/scrollbar/, /sm|md|lg|xl|2xl|[0-9]{1,2}\.[0-9]{1,2}/, /:/, /\//, /h[1-6]|hover|dark|last|after|before/, 'a', 'blockquote', 'body', 'code', 'fieldset', 'figure', 'hr', 'html', 'img', 'kbd', 'ol', 'p', 'pre', 'strong', 'sup', 'table', 'ul'], 30 | // xx包括子项 31 | deep: [/skiptranslate/, /goog-te/, /katex/, /hugo-encrypt/, /medium-zoom/, /lazy/, /swup/, /eva/], 32 | // button.bg-xx.other-class 33 | greedy: [] 34 | }, 35 | keyframes: true, 36 | fontFace: false, 37 | variables: false, 38 | rejected: true, 39 | }), 40 | require('cssnano')({ 41 | preset: ['cssnano-preset-advanced', { 42 | discardComments: { 43 | removeAll: true, 44 | } 45 | }] 46 | }), 47 | ] : [ 48 | require('tailwindcss')({ 49 | config: path.join(__dirname, '/tailwind.config.js') 50 | }), 51 | require('postcss-easing-gradients')({}), 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /screenshots/gtmetrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/gtmetrix.png -------------------------------------------------------------------------------- /screenshots/lighthouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/lighthouse.png -------------------------------------------------------------------------------- /screenshots/luna-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/luna-white.png -------------------------------------------------------------------------------- /screenshots/luna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/luna.png -------------------------------------------------------------------------------- /screenshots/screen-archives.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-archives.png -------------------------------------------------------------------------------- /screenshots/screen-gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-gallery.png -------------------------------------------------------------------------------- /screenshots/screen-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-github.png -------------------------------------------------------------------------------- /screenshots/screen-home-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-home-dark.png -------------------------------------------------------------------------------- /screenshots/screen-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-home.png -------------------------------------------------------------------------------- /screenshots/screen-links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-links.png -------------------------------------------------------------------------------- /screenshots/screen-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-search.png -------------------------------------------------------------------------------- /screenshots/screen-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/screenshots/screen-twitter.png -------------------------------------------------------------------------------- /static/fonts/Eva-Icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/Eva-Icons.eot -------------------------------------------------------------------------------- /static/fonts/Eva-Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/Eva-Icons.ttf -------------------------------------------------------------------------------- /static/fonts/Eva-Icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/Eva-Icons.woff -------------------------------------------------------------------------------- /static/fonts/Eva-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/Eva-Icons.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /static/offline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ice-Hazymoon/hugo-theme-luna/f3a4b5ec418b9e23a6a92576a72332fb10254534/static/offline.jpg -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const { boxShadow } = require('tailwindcss/defaultTheme'); 2 | const plugin = require('tailwindcss/plugin'); 3 | const path = require('path'); 4 | module.exports = { 5 | future: { 6 | removeDeprecatedGapUtilities: true, 7 | purgeLayersByDefault: true 8 | }, 9 | content: [ 10 | path.join(__dirname, '/data/luna/icon.yaml'), 11 | path.join(__dirname, '/layouts/**/*.html'), 12 | path.join(__dirname, '/layouts/*.html'), 13 | path.join(__dirname, '/assets/**/*.ts'), 14 | ], 15 | safelist: [], 16 | darkMode: 'class', // or 'media' or 'class' 17 | theme: { 18 | extend: { 19 | colors: { 20 | theme: 'var(--theme)', 21 | text: 'var(--color-text)', 22 | transparent: 'transparent', 23 | darkBg: 'var(--color-dark-bg)', 24 | darkFg: 'var(--color-dark-fg)', 25 | darkBgAccent: 'var(--color-dark-bg-accent)', 26 | darkBorder: 'var(--color-dark-border)', 27 | darkText: 'var(--color-dark-text)', 28 | darkTextPlaceholder: 'var(--color-dark-text-placeholder)', 29 | }, 30 | boxShadow: Object.assign(boxShadow, { 31 | custom: 32 | '8px 14px 38px rgba(39, 44, 49, 0.06), 1px 3px 8px rgba(39, 44, 49, 0.03);', 33 | custom2: '-8px 14px 38px rgba(39, 44, 49, 0.06), -1px 3px 8px rgba(39, 44, 49, 0.03);' 34 | }) 35 | }, 36 | }, 37 | plugins: [ 38 | plugin(function({ addUtilities, addComponents, e, prefix, config }) { 39 | const obj = {}; 40 | // obj[`.line-clamp-1`] = { 41 | // 'text-overflow': 'ellipsis', 42 | // 'white-space': 'nowrap', 43 | // overflow: 'hidden' 44 | // }; 45 | addUtilities(obj, { 46 | variants: ['responsive'] 47 | }); 48 | }), 49 | ] 50 | } -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Luna" 2 | license = "GPL V3.0" 3 | licenselink = "https://github.com/Ice-Hazymoon/hugo-theme-luna/blob/master/LICENSE" 4 | description = "A simple, performance-first, SEO-friendly Hugo theme" 5 | homepage = "https://github.com/Ice-Hazymoon/hugo-theme-luna" 6 | demosite = "https://hugo-theme-luna.imiku.me" 7 | tags = [ 8 | "blog", 9 | "responsive", 10 | "minimal", 11 | "personal", 12 | "light", 13 | "dark", 14 | "gallery", 15 | "archive", 16 | "tailwind", 17 | "search", 18 | "multilingual" 19 | ] 20 | features = [ 21 | "blog", 22 | "responsive", 23 | "minimal", 24 | "personal", 25 | "light", 26 | "dark", 27 | "gallery", 28 | "tailwind", 29 | "search", 30 | "multilingual" 31 | ] 32 | min_version = "0.146.0" 33 | 34 | [author] 35 | name = "Ice-Hazymoon" 36 | homepage = "https://imiku.me" 37 | -------------------------------------------------------------------------------- /updateModules.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const js_modules_path = './assets/ts/modules'; 5 | const css_modules_path = './assets/sass/modules'; 6 | const static_path = './static'; 7 | 8 | const modules = { 9 | 'jump.js/dist/jump.js': `${js_modules_path}/jump.js`, 10 | 'clipboard/dist/clipboard.js': `${js_modules_path}/clipboard.js`, 11 | 'vanilla-lazyload/dist/lazyload.js': `${js_modules_path}/lazyload.js`, 12 | 'medium-zoom/dist/medium-zoom.js': `${js_modules_path}/medium-zoom.js`, 13 | 'swup/dist/Swup.umd.js': `${js_modules_path}/swup.js`, 14 | '@swup/fade-theme/dist/index.umd.js': `${js_modules_path}/swupFadeTheme.js`, 15 | '@swup/ga-plugin/dist/index.umd.js': `${js_modules_path}/swupGaPlugin.js`, 16 | '@swup/progress-plugin/dist/index.umd.js': `${js_modules_path}/swupProgressPlugin.js`, 17 | '@swup/scripts-plugin/dist/index.umd.js': `${js_modules_path}/swupScriptsPlugin.js`, 18 | '@swup/slide-theme/dist/index.umd.js': `${js_modules_path}/swupSlideTheme.js`, 19 | '@swup/head-plugin/dist/index.umd.js': `${js_modules_path}/swupHeadPlugin.js`, 20 | 'swup-morph-plugin/dist/index.umd.js': `${js_modules_path}/swupMorphPlugin.js`, 21 | 'flexsearch/dist/flexsearch.bundle.min.js': `${js_modules_path}/flexsearch.js`, 22 | 'katex/dist/katex.js': `${js_modules_path}/katex.js`, 23 | 'pangu/dist/browser/pangu.js': `${js_modules_path}/pangu.js`, 24 | 'katex/dist/katex.css': `${css_modules_path}/katex.css`, 25 | 'katex/dist/fonts': `${static_path}/fonts`, 26 | 'katex/dist/contrib/auto-render.js': `${js_modules_path}/katex-render.js`, 27 | 'katex/dist/contrib/copy-tex.js': `${js_modules_path}/katex-copy.js`, 28 | 'normalize.css/normalize.css': `${css_modules_path}/normalize.css`, 29 | 'eva-icons/style/eva-icons.css': `${css_modules_path}/eva-icons.css`, 30 | 'eva-icons/style/fonts': `${static_path}/fonts`, 31 | } 32 | 33 | function copyFolderSync(from, to) { 34 | try { 35 | fs.mkdirSync(to); 36 | } catch (error) {} 37 | fs.readdirSync(from).forEach(element => { 38 | if (fs.lstatSync(path.join(from, element)).isFile()) { 39 | fs.copyFileSync(path.join(from, element), path.join(to, element)); 40 | } else { 41 | copyFolderSync(path.join(from, element), path.join(to, element)); 42 | } 43 | }); 44 | } 45 | 46 | for (let index = 0; index < Object.keys(modules).length; index++) { 47 | const key = Object.keys(modules)[index]; 48 | const key_path = `node_modules/${key}`; 49 | const value = modules[key]; 50 | const value_path = value; 51 | if (!fs.existsSync(key_path)) { 52 | console.log(`${key_path} not found`); 53 | continue; 54 | } 55 | 56 | const dir_path = path.join(value_path, '..'); 57 | if (!fs.existsSync(dir_path)) { 58 | fs.mkdirSync(dir_path, { recursive: true }); 59 | } 60 | if (fs.lstatSync(key_path).isDirectory() ) { 61 | // copy dir 62 | copyFolderSync(key_path, value_path); 63 | } else { 64 | // copy file 65 | fs.copyFileSync(key_path, value_path); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "public": true, 3 | "build": { 4 | "env": { 5 | "HUGO_VERSION": "0.146.0", 6 | "HUGO_THEME": "path0" 7 | } 8 | }, 9 | "buildCommand": "hugo --gc --minify --cleanDestinationDir -s ./exampleSite --themesDir ../.. --enableGitInfo", 10 | "installCommand": "npm install postcss-cli -g && npm install --production", 11 | "outputDirectory": "exampleSite/public" 12 | } --------------------------------------------------------------------------------