From e85caeeda5220ab7a7595e9734419f8c1de56e86 Mon Sep 17 00:00:00 2001 From: Urja Acharya Date: Sat, 23 May 2020 13:44:46 -0700 Subject: Initial Commit --- LICENSE | 20 ++ archetypes/default.md | 2 + exampleSite/config.toml | 27 +++ exampleSite/content/archive/_index.md | 5 + exampleSite/content/pinnedPosts/_index.md | 5 + exampleSite/content/post/_index.md | 6 + exampleSite/content/post/emoji-support.md | 48 ++++ exampleSite/content/post/markdown-syntax.md | 154 ++++++++++++ exampleSite/content/post/math-typesetting.mmark | 46 ++++ exampleSite/content/post/placeholder-text.md | 58 +++++ exampleSite/content/post/rich-content.md | 42 ++++ images/screenshot.png | Bin 0 -> 267212 bytes images/tn.png | Bin 0 -> 217094 bytes layouts/404.html | 3 + layouts/_default/baseof.html | 12 + layouts/_default/list.html | 6 + layouts/_default/single.html | 7 + layouts/_default/taxonomy.html | 6 + layouts/index.html | 41 ++++ layouts/partials/footer.html | 53 ++++ layouts/partials/head.html | 25 ++ layouts/partials/header.html | 37 +++ layouts/partials/homeIcon.html | 15 ++ layouts/partials/listPage.html | 12 + layouts/partials/taxa.html | 19 ++ layouts/section/archive.html | 10 + layouts/section/pinnedPosts.html | 9 + layouts/section/recent.html | 37 +++ static/css/main.css | 310 ++++++++++++++++++++++++ static/css/pagination.css | 33 +++ theme.toml | 15 ++ 31 files changed, 1063 insertions(+) create mode 100644 LICENSE create mode 100644 archetypes/default.md create mode 100644 exampleSite/config.toml create mode 100644 exampleSite/content/archive/_index.md create mode 100644 exampleSite/content/pinnedPosts/_index.md create mode 100644 exampleSite/content/post/_index.md create mode 100644 exampleSite/content/post/emoji-support.md create mode 100644 exampleSite/content/post/markdown-syntax.md create mode 100644 exampleSite/content/post/math-typesetting.mmark create mode 100644 exampleSite/content/post/placeholder-text.md create mode 100644 exampleSite/content/post/rich-content.md create mode 100644 images/screenshot.png create mode 100644 images/tn.png create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/homeIcon.html create mode 100644 layouts/partials/listPage.html create mode 100644 layouts/partials/taxa.html create mode 100644 layouts/section/archive.html create mode 100644 layouts/section/pinnedPosts.html create mode 100644 layouts/section/recent.html create mode 100644 static/css/main.css create mode 100644 static/css/pagination.css create mode 100644 theme.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f146874 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 Urja Acharya + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/exampleSite/config.toml b/exampleSite/config.toml new file mode 100644 index 0000000..8d32bfd --- /dev/null +++ b/exampleSite/config.toml @@ -0,0 +1,27 @@ +baseURL = "http://example.org/" +languageCode = "en-us" +title = "redgood" +theme = "redgood" + +[markup.goldmark.renderer] +unsafe = true + +[params] +author = "Urja Acharya" +description = "redgood is a clean minimal javascript-less theme for blogs" + +[params.theme] +dateFormat = "2006-01-02" +copyrightInFooter = true +footerText = "Short [text](#) **in** *footer*" + +[params.about] +profileImage = "https://images.pexels.com/photos/1274922/pexels-photo-1274922.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" +narrative = "I am dshfsdj flaksdjf lsjfasl dkfjlsdkfj lasdkfj. lasdkfj asdlkjf adlskf jlsakdf jasldkjfa **sdjfosdafjl** aksdfjsdfjk alskdjf. oasdif jioasdfj asdiof *jasdlkfj* asdf asdfu asdijfl kaejkljrwlk jwlkejrwejr ssad." + +[params.social] +email = "#" +linkedin = "#" +fb = "#" +twitter = "#" +github = "#" diff --git a/exampleSite/content/archive/_index.md b/exampleSite/content/archive/_index.md new file mode 100644 index 0000000..fa8cd5f --- /dev/null +++ b/exampleSite/content/archive/_index.md @@ -0,0 +1,5 @@ +--- +title: "All Posts" +weight: 3001 +hideFromHome: true +--- \ No newline at end of file diff --git a/exampleSite/content/pinnedPosts/_index.md b/exampleSite/content/pinnedPosts/_index.md new file mode 100644 index 0000000..c70e123 --- /dev/null +++ b/exampleSite/content/pinnedPosts/_index.md @@ -0,0 +1,5 @@ +--- +title: "Pinned Posts" +weight: 3000 +hideFromHome: true +--- \ No newline at end of file diff --git a/exampleSite/content/post/_index.md b/exampleSite/content/post/_index.md new file mode 100644 index 0000000..7c6bd54 --- /dev/null +++ b/exampleSite/content/post/_index.md @@ -0,0 +1,6 @@ ++++ +aliases = ["posts","articles","blog","showcase","docs"] +title = "Posts" +author = "Hugo Authors" +tags = ["index"] ++++ diff --git a/exampleSite/content/post/emoji-support.md b/exampleSite/content/post/emoji-support.md new file mode 100644 index 0000000..51f2e42 --- /dev/null +++ b/exampleSite/content/post/emoji-support.md @@ -0,0 +1,48 @@ ++++ +author = "Hugo Authors" +title = "Emoji Support" +date = "2019-03-05" +description = "Guide to emoji usage in Hugo" +tags = [ + "emoji", +] +pinned = true ++++ + +Emoji can be enabled in a Hugo project in a number of ways. + +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). + +To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. + + +

πŸ™ˆ :see_no_evil: πŸ™‰ :hear_no_evil: πŸ™Š :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. + +{{< highlight html >}} +.emoji { +font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} \ No newline at end of file diff --git a/exampleSite/content/post/markdown-syntax.md b/exampleSite/content/post/markdown-syntax.md new file mode 100644 index 0000000..cba3ba1 --- /dev/null +++ b/exampleSite/content/post/markdown-syntax.md @@ -0,0 +1,154 @@ ++++ +author = "Hugo Authors" +title = "Markdown Syntax Guide" +date = "2019-03-11" +description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +tags = [ + "markdown", + "css", + "html", + "themes", +] +categories = [ + "themes", + "syntax", +] +series = ["Themes Guide"] +aliases = ["migrate-from-jekyl"] +pinned = true ++++ + +This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + + +## Headings + +The following HTML `

`β€”`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +## Paragraph + +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +## Blockquotes + +The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. + +#### Blockquote without attribution + +> Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> **Note** that you can use *Markdown syntax* within a blockquote. + +#### Blockquote with attribution + +> Don't communicate by sharing memory, share memory by communicating.

+> β€” Rob Pike[^1] + + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + +## Tables + +Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. + + Name | Age +--------|------ + Bob | 27 + Alice | 23 + +#### Inline Markdown within tables + +| Inline    | Markdown    | In    | Table | +| ---------- | --------- | ----------------- | ---------- | +| *italics* | **bold** | ~~strikethrough~~    | `code` | + +## Code Blocks + +#### Code block with backticks + +``` +html + + + + + Example HTML5 Document + + +

Test

+ + +``` +#### Code block indented with four spaces + + + + + + Example HTML5 Document + + +

Test

+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +## List Types + +#### Ordered List + +1. First item +2. Second item +3. Third item + +#### Unordered List + +* List item +* Another item +* And another item + +#### Nested list + +* Item + 1. First Sub-item + 2. Second Sub-item + +## Miscellaneous `HTML` Tags β€” `abbr`, `sub`, `sup`, `kbd`, `mark` + +For `HTML` in markdown to be rendered, add following to the `config` file: + +``` +[markup.goldmark.renderer] + unsafe= true +``` + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. \ No newline at end of file diff --git a/exampleSite/content/post/math-typesetting.mmark b/exampleSite/content/post/math-typesetting.mmark new file mode 100644 index 0000000..7f421ae --- /dev/null +++ b/exampleSite/content/post/math-typesetting.mmark @@ -0,0 +1,46 @@ +--- +author: Hugo Authors +title: Math Typesetting +date: 2019-03-08 +description: A brief guide to setup KaTeX +markup: mmark +math: true +--- + +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + + +In this example we will be using [KaTeX](https://katex.org/) + +- Create a partial under `/layouts/partials/math.html` +- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. +- Include the partial in your templates like so: + +``` +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +``` +- To enable KaTex globally set the parameter `math` to `true` in a project's configuration +- To enable KaTex on a per page basis include the parameter `math: true` in content files. + +**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) +{{< math.inline >}} +{{ if or .Page.Params.math .Site.Params.math }} + + + + +{{ end }} +{{}} + +### Examples + +Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ + +Block math: + +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ + diff --git a/exampleSite/content/post/placeholder-text.md b/exampleSite/content/post/placeholder-text.md new file mode 100644 index 0000000..378b995 --- /dev/null +++ b/exampleSite/content/post/placeholder-text.md @@ -0,0 +1,58 @@ ++++ +author = "Hugo Authors" +title = "Placeholder Text" +date = "2019-03-09" +description = "Lorem Ipsum Dolor Si Amet" +tags = [ + "markdown", + "text", +] ++++ + +Lorem est tota propiore conpellat pectoribus de +pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice +subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc +caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis +lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus +silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria +tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +# Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +## Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra +dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere +furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli +Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare +Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert +ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae +vulnus haerentia iuste et exercebat, sui et. + +Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem +Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/post/rich-content.md b/exampleSite/content/post/rich-content.md new file mode 100644 index 0000000..5ff41d7 --- /dev/null +++ b/exampleSite/content/post/rich-content.md @@ -0,0 +1,42 @@ ++++ +author = "Hugo Authors" +title = "Rich Content" +date = "2019-03-10" +description = "A brief description of Hugo Shortcodes" +tags = [ + "shortcodes", + "privacy", +] ++++ + +Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. + +--- + +## Instagram Simple Shortcode + +{{< instagram_simple BGvuInzyFAe hidecaption >}} + +
+ +--- + +## YouTube Privacy Enhanced Shortcode + +{{< youtube ZJthWmvUzzc >}} + +
+ +--- + +## Twitter Simple Shortcode + +{{< twitter_simple 1085870671291310081 >}} + +
+ +--- + +## Vimeo Simple Shortcode + +{{< vimeo_simple 48912912 >}} diff --git a/images/screenshot.png b/images/screenshot.png new file mode 100644 index 0000000..cb16ada Binary files /dev/null and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png new file mode 100644 index 0000000..abe920d Binary files /dev/null and b/images/tn.png differ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..ae3ad77 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,3 @@ +{{ define "main" }} +Not Found +{{ end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..68fff46 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,12 @@ + + + {{- partial "head.html" . -}} + + {{- partial "header.html" . -}} +
+ {{- block "main" . }} + {{- end }} +
+ {{- partial "footer.html" . -}} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..eb7c0cd --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,6 @@ +{{ define "main" }} +

{{ .Title }}

+{{ range (.Paginator 10).Pages }} +{{ partial "listPage" . }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..917c4f9 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ define "main" }} +
+

{{ .Title }}

+

{{ dateFormat .Site.Params.theme.dateFormat .Date }} · {{ .Site.Params.author }}

+
+{{ .Content }} +{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..ea0c32f --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,6 @@ +{{ define "main" }} +

#{{ .Title }}

+{{ range (.Paginator 10).Pages.ByDate.Reverse }} +{{ partial "listPage" . }} +{{ end }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..696613d --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,41 @@ +{{ define "main" }} +{{ range ((where .Site.Pages "Params.pinned" true).ByDate.Reverse) | first 1 }} +

+ {{ .Title }} +

+
+

{{ .Summary | plainify | truncate 250 }}

+ + +
+{{ end }} + +

Recent Posts

+
+ {{ range ((where .Site.Pages "Kind" "page").ByDate.Reverse) | first 6 }} + {{ partial "listPage" . }} + {{ end }} + +
+ +

Sections

+
+ {{ range .Site.Sections }} + {{ if not .Params.hideFromHome }} +

+ {{ .Title }} - {{ len .Pages}} Articles +

+ {{ end }} {{ end }} +
+{{ partial "taxa" (dict "taxo" .Site.Taxonomies "mysite" .) }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..2b45773 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,53 @@ + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..de1d306 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,25 @@ + + + {{ .Site.Title }} + {{ if and (not .IsHome) (.Title) }} + - {{ .Title }} + {{ end }} + + + + + + + + + + + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..7fa7621 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,37 @@ +
+
+
+ profile image of {{ .Site.Params.author }} +
+
+
+ {{ if not .IsHome }} + + {{ partial "homeIcon" . }} + + {{ else }} +

{{- .Site.Title -}}

+ {{ end }} + +

+ + {{ if not .IsHome }} {{ .Site.Title }} {{ end }} + + {{ .Site.Params.about.narrative | markdownify }} +

+ + +
+
diff --git a/layouts/partials/homeIcon.html b/layouts/partials/homeIcon.html new file mode 100644 index 0000000..e13affe --- /dev/null +++ b/layouts/partials/homeIcon.html @@ -0,0 +1,15 @@ + diff --git a/layouts/partials/listPage.html b/layouts/partials/listPage.html new file mode 100644 index 0000000..5751345 --- /dev/null +++ b/layouts/partials/listPage.html @@ -0,0 +1,12 @@ +
+ + + {{ .Title }} + +
diff --git a/layouts/partials/taxa.html b/layouts/partials/taxa.html new file mode 100644 index 0000000..719d362 --- /dev/null +++ b/layouts/partials/taxa.html @@ -0,0 +1,19 @@ +{{ $scratch := newScratch }} +{{ $scratch.Delete "custom" }} +{{ range $name, $value := .taxo }} +{{ $scratch.Add "custom" (slice (dict "Name" $name "Value" $value "Num" (len $value))) }} +{{ end }} + +{{ range sort ($scratch.Get "custom") ".Num" "desc" }} +{{ $taxaTypeName := .Name }} +

+ {{ $taxaTypeName | humanize }} +

+{{ $this_taxa := index $.taxo .Name }} +
+ {{ range $this_taxa.ByCount }} + {{ $taxaValueName := .Page.Title }} + {{ .Page.Title }} + {{ end }} +
+{{ end }} diff --git a/layouts/section/archive.html b/layouts/section/archive.html new file mode 100644 index 0000000..686e8bb --- /dev/null +++ b/layouts/section/archive.html @@ -0,0 +1,10 @@ +{{ define "main" }} +

{{ .Title }}

+{{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 50 }} +
+ {{ range $paginator.Pages }} + {{ partial "listPage" . }} + {{ end }} +
+ +{{ end }} diff --git a/layouts/section/pinnedPosts.html b/layouts/section/pinnedPosts.html new file mode 100644 index 0000000..df67ed7 --- /dev/null +++ b/layouts/section/pinnedPosts.html @@ -0,0 +1,9 @@ +{{ define "main" }} +

{{ .Title }}

+{{$paginator := .Paginate (where .Site.Pages "Params.pinned" true).ByDate.Reverse 5 }} +{{ range $paginator.Pages }} +

{{ .Title }}

+ +

{{ .Summary | truncate 200 }}

+{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/section/recent.html b/layouts/section/recent.html new file mode 100644 index 0000000..3cd624e --- /dev/null +++ b/layouts/section/recent.html @@ -0,0 +1,37 @@ + + + + + + + Recent Posts + + + + + + + + + + + + {{$paginator := .Paginate (where .Site.Pages "Kind" "page").ByDate.Reverse 3 }} +
+ {{ range $paginator.Pages }} + {{ partial "listPage" . }} + {{ end }} +
+ {{ template "_internal/pagination.html" . }} +
+ +
+ + + diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..8fd8b7f --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,310 @@ +:root { + --bg: whitesmoke; + --bgDark: #b3b3b3; + --bgLight: white; + --mainText: rgb(0, 0, 0); + --secondaryText: rgb(105, 105, 105); + --primary: #a3001b; + --highlight: #b6ffb6; + --shadow: black; +} +html { + font-size: 18px; + overflow-y: scroll; + background-color: var(--bg); + box-sizing: border-box; +} +body { + font-family: "Quicksand", sans-serif; + font-weight: 400; + max-width: 960px; + margin: auto; + font-size: 1.2em; + color: var(--mainText); + border-radius: 5px; + min-height: 100vh; + display: flex; + flex-direction: column; + padding: 0 10px; +} +main { + flex: 1; +} +p { + margin: 1em 0 0.25em 0; + line-height: 1.5em; +} +a { + color: var(--primary); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +header { + background-color: var(--primary); + margin-top: 5px; + min-height: 275px; + display: flex; + flex-direction: row; + justify-content: start; + flex-wrap: wrap; +} +header img { + height: 100%; +} +.header-info { + padding: 10px; + width: calc(100% - 300px); + display: flex; + flex-direction: column; + justify-content: space-between; +} +.header-info p { + color: var(--bg); + margin: 0.25em 0 1em 0; + line-height: 1.5em; + font-size: 0.9em; + font-weight: 300; +} +.header-image-container { + height: 275px; + width: 275px; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; +} +.header-image { + height: 230px; + width: 230px; + border-radius: 50%; + overflow: hidden; + display: flex; + justify-content: center; + box-shadow: 3px 3px 5px 3px black; +} +@media only screen and (max-width: 600px) { + header { + justify-content: center; + } + .header-info { + width: 100%; + } +} +footer { + margin-top: 3em; + margin-bottom: 5px; +} +.footer { + text-align: center; + background-color: var(--primary); + color: var(--bg); + padding: 1em 5px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + min-height: 80px; + font-size: 0.9em; + font-weight: 300; +} +footer p { + margin: 0; +} +.footer a { + color: var(--bg); + text-decoration: underline; + font-weight: 600; +} +pre, +code { + font-family: "Inconsolata", monospace; + font-size: 1em; +} +kbd { + background-color: var(--bgLight); + border-radius: 5px; + padding: 4px; + margin: 0 3px; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 600; + margin: 1em 0 0.5em 0; +} +h1 { + font-size: 2.1em; +} +h2 { + font-size: 1.9em; +} +h3 { + font-size: 1.7em; +} +h4 { + font-size: 1.5em; +} +h5 { + font-size: 1.3em; +} +h6 { + font-size: 1.1em; +} +.site-title { + font-size: 2.5em; + color: var(--bg); + margin: 0; + text-shadow: 3px 3px var(--shadow); +} +.site-title.home-false { + display: block; + font-size: 1.5em; + font-weight: 600; + margin-bottom: 0.5em; + text-decoration: underline; + text-shadow: 2px 2px var(--shadow); +} +.front-matter { + border-bottom: solid 3px var(--primary); +} +pre { + padding: 15px; + border-radius: 5px; + border: solid 1px; + background-color: #272822; + color: white; +} +blockquote { + border-left: solid 5px var(--secondaryText); + padding: 0.5em; + background-color: var(--bgLight); + border-radius: 2px; + box-shadow: 1px 1px 4px 1px var(--shadow); +} +blockquote p { + margin: 0; +} +mark { + background-color: var(--highlight); +} +table { + border-collapse: collapse; + text-align: left; +} +th, +td { + border: solid 1px var(--primary); + padding: 5px; +} +svg { + height: 1em; + width: 1em; +} +.home-icon { + font-size: 1.5em; + color: var(--bg); + border-radius: 5px; +} +.home-icon svg { + padding: 0.25em; + border-radius: 5px; +} +.home-icon svg { + box-shadow: inset 0 0 2px var(--shadow); + transition: box-shadow 0.1s; +} +.home-icon svg:hover { + box-shadow: inset 0 0 6px var(--shadow); +} +.home-icon svg:active { + box-shadow: inset 0 0 10px var(--shadow); +} +.social-link { + color: var(--bg); + margin-right: 0.25em; + font-weight: 600; +} +.social-link::before { + content: "@"; + font-family: "Inconsolata", monospace; +} +.archive-table { + width: 100%; +} +.home-page-card { + background-color: var(--bgLight) !important; + padding: 15px; + border-radius: 5px; + box-shadow: 1px 1px 2px 1px var(--shadow); +} +.home-page-card > p:last-child { + margin-bottom: 0; +} +.home-page-card > p:first-child { + margin-top: 0; +} +.home-page-card-links { + margin-top: 1em; + display: flex; + flex-direction: row; + flex-wrap: wrap; + display: inline-block; +} +.home-page-card-links a { + background-color: var(--primary); + color: var(--bg); + margin-right: 10px; + padding: 5px 5px; + border-radius: 5px; + box-shadow: 3px 3px 5px 1px var(--shadow); + transition: box-shadow 0.2s; +} +.home-page-card-links > a:hover { + box-shadow: 1px 1px 5px 1px var(--shadow); + text-decoration: none; +} +.home-page-card-links > a:active { + box-shadow: 0px 0px 1px 1px var(--shadow); +} +.taxa-container { + display: flex; + flex-wrap: wrap; + padding: 5px 11px; +} +.taxa::before { + content: "#"; +} +.taxa { + margin: 0.4em 0.4em 0.4em 0; + padding: 4px; +} +.prev-next { + display: flex; + flex-direction: row; + justify-content: space-around; + margin-bottom: 3em; +} +.prev-next > div, +.prev-next > a { + font-size: 1.2em; + padding: 0 0.5em; + border-radius: 5px; +} +.list-page-data { + display: flex; + margin-bottom: 0.5em; +} +.list-page-date { + text-align: right; + padding-right: 1em; + min-width: 5em; +} +main img { + max-width: 100%; + margin: 1em auto; +} diff --git a/static/css/pagination.css b/static/css/pagination.css new file mode 100644 index 0000000..85311bb --- /dev/null +++ b/static/css/pagination.css @@ -0,0 +1,33 @@ +ul.pagination { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + list-style-type: none; +} +li.page-item { + padding: 10px; +} +li.page-item { + border-top: 1px solid var(--primary); + border-bottom: 1px solid var(--primary); + border-left: 1px solid var(--primary); + background-color: var(--bg); +} +li.page-item.disabled a { + color: var(--inactiveColor); +} +li.page-item.active { + background-color: var(--primary); +} +li.page-item.active a { + color: var(--bg); + font-weight: 600; +} +li.page-item:first-child { + border-radius: 10px 0 0 10px; +} +li.page-item:last-child { + border-radius: 0 10px 10px 0; + border-right: 1px solid var(--primary); +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..ad92e1e --- /dev/null +++ b/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "redgood" +license = "MIT" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "Clean minimal javascript-less theme for blogs." +homepage = "http://example.com/" +tags = ["personal", "blog",] +features = ["clean", "responsive", "minimal", "no javascript"] +min_version = "0.71.0" + +[author] + name = "Urja Acharya" + homepage = "https://www.urjaacharya.com/" -- cgit v1.2.3