forked from drowl87/hextra_mirror
feat: implement navbar, update styles and docs
chore: add styles to html and body chore: update theme for tailwind config chore: update colors chore: add list layout override for docs chore: update default layouts chore: update contents
This commit is contained in:
parent
3ec2e18870
commit
e0bfaf0467
@ -1,3 +1,22 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
|
||||
html {
|
||||
@apply text-base antialiased;
|
||||
font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-white text-gray-900;
|
||||
}
|
||||
|
||||
:root {
|
||||
--primary-hue: 212deg;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--primary-hue: 204deg;
|
||||
}
|
||||
|
@ -1,134 +1,3 @@
|
||||
---
|
||||
title: Markdown Syntax Guide
|
||||
title: Hextra Theme
|
||||
---
|
||||
|
||||
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
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^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 them out-of-the-box.
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
Bob | 27
|
||||
Alice | 23
|
||||
|
||||
#### Inline Markdown within tables
|
||||
|
||||
| Italics | Bold | Code |
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
|
||||
## 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
|
||||
{{< highlight html >}}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
{{< /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
|
||||
|
||||
* Fruit
|
||||
* Apple
|
||||
* Orange
|
||||
* Banana
|
||||
* Dairy
|
||||
* Milk
|
||||
* Cheese
|
||||
|
||||
## 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.
|
||||
|
3
content/about/index.md
Normal file
3
content/about/index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: About
|
||||
---
|
3
content/docs/_index.md
Normal file
3
content/docs/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: Documentation
|
||||
---
|
6
content/docs/guide/_index.md
Normal file
6
content/docs/guide/_index.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Guide
|
||||
weight: 2
|
||||
---
|
||||
|
||||
Guide to the project.
|
5
content/docs/guide/advanced/_index.md
Normal file
5
content/docs/guide/advanced/_index.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Advanced
|
||||
---
|
||||
|
||||
Advanced topics.
|
134
content/docs/guide/markdown.md
Normal file
134
content/docs/guide/markdown.md
Normal file
@ -0,0 +1,134 @@
|
||||
---
|
||||
title: Markdown
|
||||
---
|
||||
|
||||
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
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^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 them out-of-the-box.
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
Bob | 27
|
||||
Alice | 23
|
||||
|
||||
#### Inline Markdown within tables
|
||||
|
||||
| Italics | Bold | Code |
|
||||
| -------- | -------- | ------ |
|
||||
| *italics* | **bold** | `code` |
|
||||
|
||||
## 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
|
||||
{{< highlight html >}}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
{{< /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
|
||||
|
||||
* Fruit
|
||||
* Apple
|
||||
* Orange
|
||||
* Banana
|
||||
* Dairy
|
||||
* Milk
|
||||
* Cheese
|
||||
|
||||
## 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.
|
5
content/docs/guide/organize-files.md
Normal file
5
content/docs/guide/organize-files.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Organize Files
|
||||
---
|
||||
|
||||
Organize files in the project.
|
6
content/docs/introduction.md
Normal file
6
content/docs/introduction.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Introduction
|
||||
weight: 1
|
||||
---
|
||||
|
||||
Introduction to the project.
|
3
content/showcase/index.md
Normal file
3
content/showcase/index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: Showcase
|
||||
---
|
@ -45,3 +45,8 @@ disableKinds = ["taxonomy", "term"]
|
||||
name = 'About'
|
||||
pageRef = '/about'
|
||||
weight = 30
|
||||
[[menu.main]]
|
||||
name = 'GitHub'
|
||||
url = 'https://github.com'
|
||||
weight = 40
|
||||
params = { icon = 'github' }
|
||||
|
@ -1,11 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<div id="content">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
{{- partial "head.html" . -}}
|
||||
<body dir="ltr">
|
||||
{{- partial "navbar.html" . -}}
|
||||
{{- block "main" . }}{{ end -}}
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
<div class="mx-auto flex max-w-[90rem]">
|
||||
<p class="p-4">Unimplemented</p>
|
||||
</div>
|
||||
{{ end }}
|
@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
<div class="mx-auto flex max-w-[90rem]">
|
||||
<p class="p-4">Unimplemented</p>
|
||||
</div>
|
||||
{{ end }}
|
5
layouts/docs/list.html
Normal file
5
layouts/docs/list.html
Normal file
@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
<div class="mx-auto flex max-w-[90rem]">
|
||||
{{ partial "sidebar.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
26
layouts/partials/navbar.html
Normal file
26
layouts/partials/navbar.html
Normal file
@ -0,0 +1,26 @@
|
||||
<div class="sticky top-0 z-20 w-full bg-transparent print:hidden">
|
||||
<div class="pointer-events-none absolute z-[-1] h-full w-full bg-white shadow-[0_2px_4px_rgba(0,0,0,.02),0_1px_0_rgba(0,0,0,.06)] contrast-more:shadow-[0_0_0_1px_#000] dark:bg-dark dark:shadow-[0_-1px_0_rgba(255,255,255,.1)_inset] contrast-more:dark:shadow-[0_0_0_1px_#fff]"></div>
|
||||
|
||||
<nav class="mx-auto flex items-center justify-end gap-2 h-16 px-6 max-w-[90rem]">
|
||||
<a class="flex items-center hover:opacity-75 ltr:mr-auto rtl:ml-auto" href="{{ .Site.BaseURL }}">
|
||||
{{ partial "utils/icon.html" (dict "context" . "name" "hugo" "attributes" "height=20") }}
|
||||
<span class="mx-2 font-extrabold hidden md:inline select-none" title="{{ .Site.Title }}">
|
||||
{{ .Site.Title }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .Params.icon }}
|
||||
<a class="p-2 text-current" target="_blank" rel="noreferer" href="{{ .URL }}">
|
||||
{{ partial "utils/icon.html" (dict "context" $currentPage "name" .Params.icon "attributes" "height=24") }}
|
||||
<span class="sr-only">{{ .Name }}</span>
|
||||
</a>
|
||||
{{ else }}
|
||||
<a class="text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100 relative -ml-2 hidden whitespace-nowrap p-2 md:inline-block text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200" href="{{ .URL }}">
|
||||
<span class="text-center">{{ .Name }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</nav>
|
||||
</div>
|
@ -1,6 +1,70 @@
|
||||
const typography = require('@tailwindcss/typography');
|
||||
const colors = require('tailwindcss/colors')
|
||||
|
||||
const makePrimaryColor =
|
||||
l =>
|
||||
({ opacityValue }) => {
|
||||
if (opacityValue === undefined) {
|
||||
return `hsl(var(--primary-hue) 100% ${l}%)`
|
||||
}
|
||||
return `hsl(var(--primary-hue) 100% ${l}% / ${opacityValue})`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
content: ['./hugo_stats.json'],
|
||||
plugins: [typography],
|
||||
theme: {
|
||||
screens: {
|
||||
sm: '640px',
|
||||
md: '768px',
|
||||
lg: '1024px',
|
||||
xl: '1280px',
|
||||
'2xl': '1536px'
|
||||
},
|
||||
fontSize: {
|
||||
xs: '.75rem',
|
||||
sm: '.875rem',
|
||||
base: '1rem',
|
||||
lg: '1.125rem',
|
||||
xl: '1.25rem',
|
||||
'2xl': '1.5rem',
|
||||
'3xl': '1.875rem',
|
||||
'4xl': '2.25rem',
|
||||
'5xl': '3rem',
|
||||
'6xl': '4rem'
|
||||
},
|
||||
letterSpacing: {
|
||||
tight: '-0.015em'
|
||||
},
|
||||
colors: {
|
||||
transparent: 'transparent',
|
||||
current: 'currentColor',
|
||||
black: '#000',
|
||||
white: '#fff',
|
||||
gray: colors.gray,
|
||||
slate: colors.slate,
|
||||
neutral: colors.neutral,
|
||||
red: colors.red,
|
||||
orange: colors.orange,
|
||||
blue: colors.blue,
|
||||
yellow: colors.yellow,
|
||||
primary: {
|
||||
50: makePrimaryColor(97),
|
||||
100: makePrimaryColor(94),
|
||||
200: makePrimaryColor(86),
|
||||
300: makePrimaryColor(77),
|
||||
400: makePrimaryColor(66),
|
||||
500: makePrimaryColor(50),
|
||||
600: makePrimaryColor(45),
|
||||
700: makePrimaryColor(39),
|
||||
750: makePrimaryColor(35),
|
||||
800: makePrimaryColor(32),
|
||||
900: makePrimaryColor(24)
|
||||
}
|
||||
},
|
||||
extend: {
|
||||
colors: {
|
||||
dark: '#111'
|
||||
}
|
||||
}
|
||||
},
|
||||
darkMode: ['class', 'html[class~="dark"]']
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user