From 4e2c8e74be959cbaba3247349d2f4235c05ccaa2 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 28 Dec 2021 10:48:22 +0100 Subject: [PATCH 1/5] fix: add missing diff syntax highlight (#445) closes: https://github.com/CaiJimmy/hugo-theme-stack/issues/434 --- assets/scss/partials/highlight/light.scss | 183 +++++++++--------- .../content/post/markdown-syntax/index.md | 10 + 2 files changed, 103 insertions(+), 90 deletions(-) diff --git a/assets/scss/partials/highlight/light.scss b/assets/scss/partials/highlight/light.scss index 9ddcff9..1798218 100644 --- a/assets/scss/partials/highlight/light.scss +++ b/assets/scss/partials/highlight/light.scss @@ -10,7 +10,8 @@ } /* Other */ -.chroma .x {} +.chroma .x { +} /* Error */ .chroma .err { @@ -40,367 +41,369 @@ .chroma .hl { display: block; width: 100%; - background-color: #ffffcc + background-color: #ffffcc; } /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; - color: #7f7f7f + color: #7f7f7f; } /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; - color: #7f7f7f + color: #7f7f7f; } /* Keyword */ .chroma .k { - color: #00a8c8 + color: #00a8c8; } /* KeywordConstant */ .chroma .kc { - color: #00a8c8 + color: #00a8c8; } /* KeywordDeclaration */ .chroma .kd { - color: #00a8c8 + color: #00a8c8; } /* KeywordNamespace */ .chroma .kn { - color: #f92672 + color: #f92672; } /* KeywordPseudo */ .chroma .kp { - color: #00a8c8 + color: #00a8c8; } /* KeywordReserved */ .chroma .kr { - color: #00a8c8 + color: #00a8c8; } /* KeywordType */ .chroma .kt { - color: #00a8c8 + color: #00a8c8; } /* Name */ .chroma .n { - color: #111111 + color: #111111; } /* NameAttribute */ .chroma .na { - color: #75af00 + color: #75af00; } /* NameBuiltin */ .chroma .nb { - color: #111111 + color: #111111; } /* NameBuiltinPseudo */ .chroma .bp { - color: #111111 + color: #111111; } /* NameClass */ .chroma .nc { - color: #75af00 + color: #75af00; } /* NameConstant */ .chroma .no { - color: #00a8c8 + color: #00a8c8; } /* NameDecorator */ .chroma .nd { - color: #75af00 + color: #75af00; } /* NameEntity */ .chroma .ni { - color: #111111 + color: #111111; } /* NameException */ .chroma .ne { - color: #75af00 + color: #75af00; } /* NameFunction */ .chroma .nf { - color: #75af00 + color: #75af00; } /* NameFunctionMagic */ .chroma .fm { - color: #111111 + color: #111111; } /* NameLabel */ .chroma .nl { - color: #111111 + color: #111111; } /* NameNamespace */ .chroma .nn { - color: #111111 + color: #111111; } /* NameOther */ .chroma .nx { - color: #75af00 + color: #75af00; } /* NameProperty */ .chroma .py { - color: #111111 + color: #111111; } /* NameTag */ .chroma .nt { - color: #f92672 + color: #f92672; } /* NameVariable */ .chroma .nv { - color: #111111 + color: #111111; } /* NameVariableClass */ .chroma .vc { - color: #111111 + color: #111111; } /* NameVariableGlobal */ .chroma .vg { - color: #111111 + color: #111111; } /* NameVariableInstance */ .chroma .vi { - color: #111111 + color: #111111; } /* NameVariableMagic */ .chroma .vm { - color: #111111 + color: #111111; } /* Literal */ .chroma .l { - color: #ae81ff + color: #ae81ff; } /* LiteralDate */ .chroma .ld { - color: #d88200 + color: #d88200; } /* LiteralString */ .chroma .s { - color: #d88200 + color: #d88200; } /* LiteralStringAffix */ .chroma .sa { - color: #d88200 + color: #d88200; } /* LiteralStringBacktick */ .chroma .sb { - color: #d88200 + color: #d88200; } /* LiteralStringChar */ .chroma .sc { - color: #d88200 + color: #d88200; } /* LiteralStringDelimiter */ .chroma .dl { - color: #d88200 + color: #d88200; } /* LiteralStringDoc */ .chroma .sd { - color: #d88200 + color: #d88200; } /* LiteralStringDouble */ .chroma .s2 { - color: #d88200 + color: #d88200; } /* LiteralStringEscape */ .chroma .se { - color: #8045ff + color: #8045ff; } /* LiteralStringHeredoc */ .chroma .sh { - color: #d88200 + color: #d88200; } /* LiteralStringInterpol */ .chroma .si { - color: #d88200 + color: #d88200; } /* LiteralStringOther */ .chroma .sx { - color: #d88200 + color: #d88200; } /* LiteralStringRegex */ .chroma .sr { - color: #d88200 + color: #d88200; } /* LiteralStringSingle */ .chroma .s1 { - color: #d88200 + color: #d88200; } /* LiteralStringSymbol */ .chroma .ss { - color: #d88200 + color: #d88200; } /* LiteralNumber */ .chroma .m { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberBin */ .chroma .mb { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberFloat */ .chroma .mf { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberHex */ .chroma .mh { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberInteger */ .chroma .mi { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberIntegerLong */ .chroma .il { - color: #ae81ff + color: #ae81ff; } /* LiteralNumberOct */ .chroma .mo { - color: #ae81ff + color: #ae81ff; } /* Operator */ .chroma .o { - color: #f92672 + color: #f92672; } /* OperatorWord */ .chroma .ow { - color: #f92672 + color: #f92672; } /* Punctuation */ .chroma .p { - color: #111111 + color: #111111; } /* Comment */ .chroma .c { - color: #75715e + color: #75715e; } /* CommentHashbang */ .chroma .ch { - color: #75715e + color: #75715e; } /* CommentMultiline */ .chroma .cm { - color: #75715e + color: #75715e; } /* CommentSingle */ .chroma .c1 { - color: #75715e + color: #75715e; } /* CommentSpecial */ .chroma .cs { - color: #75715e + color: #75715e; } /* CommentPreproc */ .chroma .cp { - color: #75715e + color: #75715e; } /* CommentPreprocFile */ .chroma .cpf { - color: #75715e + color: #75715e; } /* Generic */ -.chroma .g {} - +.chroma .g { +} /* GenericDeleted */ -.chroma .gd {} - +.chroma .gd { + color: #f92672; +} /* GenericEmph */ .chroma .ge { - font-style: italic + font-style: italic; } - /* GenericError */ -.chroma .gr {} - +.chroma .gr { +} /* GenericHeading */ -.chroma .gh {} - +.chroma .gh { +} /* GenericInserted */ -.chroma .gi {} - +.chroma .gi { + color: #7ca727; +} /* GenericOutput */ -.chroma .go {} - +.chroma .go { +} /* GenericPrompt */ -.chroma .gp {} - +.chroma .gp { +} /* GenericStrong */ .chroma .gs { - font-weight: bold + font-weight: bold; } - /* GenericSubheading */ -.chroma .gu {} - +.chroma .gu { + color: #75715e; +} /* GenericTraceback */ -.chroma .gt {} - +.chroma .gt { +} /* GenericUnderline */ -.chroma .gl {} - +.chroma .gl { +} /* TextWhitespace */ -.chroma .w {} \ No newline at end of file +.chroma .w { +} diff --git a/exampleSite/content/post/markdown-syntax/index.md b/exampleSite/content/post/markdown-syntax/index.md index 8c53bc2..85fdcff 100644 --- a/exampleSite/content/post/markdown-syntax/index.md +++ b/exampleSite/content/post/markdown-syntax/index.md @@ -113,6 +113,16 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou {{< /highlight >}} +#### Diff code block + +```diff +[dependencies.bevy] +git = "https://github.com/bevyengine/bevy" +rev = "11f52b8c72fc3a568e8bb4a4cd1f3eb025ac2e13" +- features = ["dynamic"] ++ features = ["jpeg", "dynamic"] +``` + ## List Types #### Ordered List From 455e23f22b796c900568d1b772e5af68ede95604 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 28 Dec 2021 11:28:20 +0100 Subject: [PATCH 2/5] feat: page links (#446) --- exampleSite/content/page/links/index.md | 37 ++++++++++++++++++ .../content/page/links/ts-logo-128.jpg | Bin 0 -> 2071 bytes layouts/_default/single.html | 4 ++ .../partials/article/components/links.html | 26 ++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 exampleSite/content/page/links/index.md create mode 100644 exampleSite/content/page/links/ts-logo-128.jpg create mode 100644 layouts/partials/article/components/links.html diff --git a/exampleSite/content/page/links/index.md b/exampleSite/content/page/links/index.md new file mode 100644 index 0000000..9e29bf3 --- /dev/null +++ b/exampleSite/content/page/links/index.md @@ -0,0 +1,37 @@ +--- +title: Links +links: + - title: GitHub + description: GitHub is the world's largest software development platform. + website: https://github.com + image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + - title: TypeScript + description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. + website: https://www.typescriptlang.org + image: ts-logo-128.jpg +menu: + main: + weight: -50 + params: + icon: link + +comments: false +--- + +To use this feature, add `links` section to frontmatter. + +This page's frontmatter: + +```yaml +links: + - title: GitHub + description: GitHub is the world's largest software development platform. + website: https://github.com + image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + - title: TypeScript + description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. + website: https://www.typescriptlang.org + image: ts-logo-128.jpg +``` + +`image` field accepts both local and external images. \ No newline at end of file diff --git a/exampleSite/content/page/links/ts-logo-128.jpg b/exampleSite/content/page/links/ts-logo-128.jpg new file mode 100644 index 0000000000000000000000000000000000000000..85e33236069a2534315630db8bfef9e02166c3e1 GIT binary patch literal 2071 zcmbuAX;2eL7RNgW;U1De7(pO`1XcoqLc+?S5N=_D5)K845RRZC9sz@0A!~=uGfH)i?XDNc9AgE|I&g@jp?$>>1c_=F>tEecef2a1Hx+V&VL}}`2Y0Fd3Y$JA~e3_Y87~_pC zOkBy9mSk5S=N-;Ip#cG*iN_N!UFwJYzXGyOfKmb}AO!|70#FnLhJwgMz*=4=1i-%4 z`d26-U~mN`Clgq92n>#Z%6@gNgYU+m`&8bRuXkSD_mn^_&U4-(Y{(TRLyRdNn!n&-crh3op1n6qz%!a$;D! z^7ZsSHJ!V6A;^N+Kfji`-2A)%lRXui6R;0cM&CQ$?;%IzfdmkkymeI-HN`($gFxkk z00O0mL~qs9`W|OQqWH(~P zUI%W>$iGN}P8;!ZFV}Jsj$Ra(&6PyXua@$BpX&!N#&>FaB~r zcQg?(b{rp5KCa~^d?Suu4SD`RqlFZ5GG@c%nF8uHYs1^O^&{4b ztQ*)wE55lj9M6Q;Y;IngbbXnwC#3nOYVir1^px;W>kwv?MSEA~*@i2smIhR`b(D^X z>u<9@X=YIC^FLZ6NAnv#c{q}*Y5b;JQXBe?LPEsa5MA{aCMS;fj9$^5g{haacT090 z0?>yvT3!_rY{*N1#Jr%p1(&1m-m?Z(P46=XudWQY(mPpRAFBHrtMENfx-^apUxi8> z`#x_Dty^U#5C8sI<8GC%U2sxc*LK~N0aJB^?$AgWnoZ7GcKhX_D+|%*a|~NkFF5kE zM;G@|&qBqGgF2p(Q2f)PT~*zjLv6Ey0FKMTIqPNWqFa?0VN zx*Ox!=r%)T!q>9~en;h2w?F}?-0KR8FopkoVsfhkI7-2At1pL#L~CKJNDW2|77p*^ zeC7{FLm_fU%VPsacs_}`e63NAu5gS zD1>HLw|1_arVh9{&v;hEwG|kMUoT>6fW_4GQXscoSO2WU%+K#-GOvD{Nu3E-CnNVT z9xRqe6tXc<4&B65h|?VyV87n6;1i08o@cDPSqV%7b>Ly#%U-r7+A?5LI4jH@FJ!a^ zw054L{SaZ_bEIP7n|AUbRuu5&E!^u>&R)1KJ=pxTZ@uGT-P^a8(5s!}5zxBu16O%_ z!!DIIE8&nVdqR`2@KNi@h*eU0%@zMJ2#4mLXPF>Hc~F}jrP&FX(q<2{4Skxz41i8l zk>lI^4IdPSfGhqrPX5GaxK#nEMe^mKjd%^3I4dV-28;FwJ^6rf1cbbuAMfHOG@iRf zz}z+>j}w)}w^Wm}=0X%Y+*kPX^}nH9$ zo!`+Gk}vYU_(>4W6GiiB3j5s%4Is@WL;pZpR+GYB_P@N*J4K}*92yf>1=qquUl($7 zDR;PO2QtqIM*IlY)nQhp>bp?fK%bH~CnMj!-4i0}7zlRG_q_jNsyMd9WJi!z&geeM zB7U)`$AL<}-{> + {{ range $i, $link := .Params.links }} + + {{ end }} + \ No newline at end of file From a669b60cdd22b6ed29b6acd766389f11d8e57911 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 28 Dec 2021 10:33:48 +0000 Subject: [PATCH 3/5] chore(exampleSite): make default pages use page bundle feature To avoid confusions --- exampleSite/content/page/{about.md => about/index.md} | 0 exampleSite/content/page/{archives.md => archives/index.md} | 0 exampleSite/content/page/{search.md => search/index.md} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename exampleSite/content/page/{about.md => about/index.md} (100%) rename exampleSite/content/page/{archives.md => archives/index.md} (100%) rename exampleSite/content/page/{search.md => search/index.md} (100%) diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about/index.md similarity index 100% rename from exampleSite/content/page/about.md rename to exampleSite/content/page/about/index.md diff --git a/exampleSite/content/page/archives.md b/exampleSite/content/page/archives/index.md similarity index 100% rename from exampleSite/content/page/archives.md rename to exampleSite/content/page/archives/index.md diff --git a/exampleSite/content/page/search.md b/exampleSite/content/page/search/index.md similarity index 100% rename from exampleSite/content/page/search.md rename to exampleSite/content/page/search/index.md From dde6a10cabb21ccdb707e90e7c0a9938a118aaa7 Mon Sep 17 00:00:00 2001 From: Nathan Harkenrider <824186+NateHark@users.noreply.github.com> Date: Tue, 28 Dec 2021 14:28:33 -0800 Subject: [PATCH 4/5] feat: implement cache busting for CSS (#444) --- layouts/partials/head/style.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/head/style.html b/layouts/partials/head/style.html index 431e212..ee6b017 100644 --- a/layouts/partials/head/style.html +++ b/layouts/partials/head/style.html @@ -1,3 +1,3 @@ {{ $sass := resources.Get "scss/style.scss" }} -{{ $style := $sass | resources.ToCSS | minify }} +{{ $style := $sass | resources.ToCSS | minify | resources.Fingerprint "sha256" }} \ No newline at end of file From d1656215684b042ea341e2ba93933722956630b5 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Wed, 29 Dec 2021 00:32:08 +0100 Subject: [PATCH 5/5] release: 3.6.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index ba38464..a2baf19 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.5.0" -}} +{{- $ThemeVersion := "3.6.0" -}}