add codex theme and initial content

This commit is contained in:
francesco 2021-05-27 21:05:41 +02:00
parent c2347a55ab
commit a9207b2040
8 changed files with 374 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "themes/hugo-theme-codex"]
path = themes/hugo-theme-codex
url = https://github.com/jakewies/hugo-theme-codex.git

View File

@ -4,9 +4,14 @@ Homepage of Francesco made with :heart: and HUGO
## Installation guide
On Arch Linux you can Install HUGO and HUGO-extenden for Sass/SCSS support like this
```bash
paru -S hugo-extended
```
### Install theme
As the origin theme is untouched, we are redy to customize the content of the examle page and if needed the theme itself.
Follow this guide for installing [Codex-Hugo-Theme](https://github.com/jakewies/hugo-theme-codex)
### Developing with Docker

68
config.toml Normal file
View File

@ -0,0 +1,68 @@
# DO NOT REMOVE THIS
theme = "hugo-theme-codex"
# Override these settings with your own
title = "francesco"
languageCode = "en-us"
baseURL = "https://fr.r4o.ch"
copyright = "© {year}"
# Add your Disqus shortname here.
# disqusShortname = ""
# Add your Google Analytics identifier: UA-XXXXXXXX-X
# googleAnalytics = ""
# Optional params
[params]
# Follow the Hugo date/time format reference here:
# https://gohugo.io/functions/format/#gos-layout-string
dateFormat = "Jan 2 2006"
# Links to your social accounts, comment/uncomment as needed. Icons will be displayed for those specified.
twitter = "https://twitter.com/<your handle>"
github = "https://github.com/<your handle>"
# email = "mailto:<your email>"
# mastodon = "https://mastodon.social/@nickname"
# facebook = "https://facebook.com/<your handle>"
# gitlab = "https://gitlab.com/<your handle>"
# instagram = "https://instagram.com/<your handle>"
# linkedin = "<link to your profile>"
# youtube = "https://www.youtube.com/channel/<your channel>"
# Titles for your icons (shown as tooltips), and also their display order.
# Currently, these icons are supported:
# "Twitter", "GitHub", "Email", "Mastodon", "Facebook", "GitLab", "Instagram", "LinkedIn", "YouTube"
iconOrder = ["Twitter", "GitHub"]
# Metadata for Twitter cards, defaults to params.twitter
# twitterSite = "@<your handle>"
# twitterAuthor = "@<your handle>"
# Set to true to display page title in table of contents in blog posts.
showPageTitleInTOC = false
# This disables Hugo's default syntax highlighting in favor
# of prismjs. If you wish to use Hugo's default syntax highlighting
# over prismjs, remove this. You will also need to remove the prismjs
# vendor script in layouts/blog/single.html.
[markup]
[markup.highlight]
codeFences = false
# Set to false to disallow raw HTML in markdown files
[markup.goldmark.renderer]
unsafe = true
# Controls the navigation
[[menu.main]]
identifier = "about"
name = "about"
title = "About"
url = "/"
[[menu.main]]
identifier = "blog"
name = "blog"
title = "Blog"
url = "/blog"

5
content/_index.md Normal file
View File

@ -0,0 +1,5 @@
---
heading: "Hi, I'm Codex"
subheading: "A minimal blog theme for hugo."
handle: "hugo-theme-codex"
---

View File

@ -0,0 +1,23 @@
---
title: "Welcome To Codex"
date: 2020-06-04T09:19:29-04:00
slug: "example-post"
description: "This is an example post for hugo-theme-codex."
keywords: ["gohugo", "hugo", "go", "blog"]
draft: false
tags: ["hugo"]
math: false
toc: true
---
## The standard Lorem Ipsum passage
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
## written by Cicero in 45 BC
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
## 1914 translation by H. Rackham
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"

View File

@ -0,0 +1,156 @@
---
title: "Markdown Syntax Guide"
date: 2020-06-05
slug: "markdown-syntax-guide"
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements"
keywords: ["gohugo", "hugo", "go", "blog"]
draft: false
tags: ["markdown", "css", "html", "themes"]
math: false
toc: false
---
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.
<!--more-->
## Headings
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` 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
> Simplicity is the ultimate sophistication.
> <cite>Leonardo da Vinci[^1]</cite>
[^1]: The above quote is often attributed to Leonardo da Vinci but there is no concrete evidence to support this.
## 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
<div style="overflow-x: auto">
| Inline&nbsp;&nbsp;&nbsp; | Markdown&nbsp;&nbsp;&nbsp; | In&nbsp;&nbsp;&nbsp; | Table |
| ---------- | --------- | ----------------- | ---------- |
| *italics* | **bold** | ~~strikethrough~~&nbsp;&nbsp;&nbsp; | `code` |
</div>
## Code Blocks
#### Code block with backticks
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```
#### Code block indented with four spaces
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
#### Code block with Hugo's internal highlight shortcode
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```
#### Wide code block
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</body>
</html>
```
## 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
## Other Elements — abbr, sub, sup, kbd, mark
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.

View File

@ -0,0 +1,48 @@
---
title: "Math Typesetting"
date: 2020-06-05
slug: "math-typesetting"
description: "A brief guide to setup KaTeX"
keywords: ["gohugo", "hugo", "go", "blog"]
draft: false
tags: ["math"]
math: true
toc: false
---
Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
<!--more-->
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 }}
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}
{{</ math.inline >}}
### Examples
Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
Block math:
$$
\sigma(t) = \cfrac{1}{1 + e^{-t}}
$$

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
<meta charset="UTF-8">
<meta name="language" content="en">
<meta name="description" content="{{ if .IsHome}}{{ .Site.Params.Description }}{{ else }}{{.Page.Params.Description}}{{ end }}">
<meta name="keywords" content="{{ delimit .Keywords " , " }}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Twitter -->
{{ if isset .Site.Params "twitter" }}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"/>
<meta name="twitter:site" content="{{ .Site.Params.twitterSite | default .Site.Params.twitter }}" />
<meta name="twitter:creator" content="{{ .Site.Params.twitterCreator | default .Site.Params.twitter }}" />
{{ end }}
{{ partial "favicon.html" }}
<!-- Styles -->
{{ block "styles" . }} {{ end }} <!-- Get "style_opts" variable from "styles" block -->
{{ $base_styles_opts := .Scratch.Get "style_opts" | default (dict "src" "scss/pages/about.scss" "dest" "css/about.css") }}
{{ $custom_styles_opts := (dict "src" "scss/custom.scss" "dest" "css/custom.css") }}
{{ $current_page := . }}
{{ range (slice $base_styles_opts $custom_styles_opts) }}
{{ $style := resources.Get .src | resources.ExecuteAsTemplate .dest $current_page | toCSS | minify | fingerprint }}
<link type="text/css" rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}"/>
{{ end }}
{{ range .AlternativeOutputFormats }}
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.FirstSuffix.Suffix .Permalink $.Site.Title | safeHTML }}
{{ end }}
{{ block "links" . }} {{ end }}
{{ partial "seo-schema.html" .}}
{{- if not .Site.IsServer -}}
{{ template "_internal/google_analytics_async.html" . }}
{{- end -}}
</head>
<body>
{{ partial "burger.html" .}}
{{ partial "nav.html" .}}
<main>
{{ block "main" . }} {{ end }}
</main>
{{ block "footer" . }} {{ end }}
{{ $script := resources.Get "js/index.js" | minify | fingerprint }}
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity | safeHTMLAttr }}" crossorigin="anonymous"></script>
{{ block "scripts" . }} {{ end }}
</body>
</html>