Compare commits
297 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
34ce1500ec | ||
![]() |
d9d893ff0e | ||
![]() |
2ecdda62ef | ||
![]() |
fa808517f2 | ||
![]() |
df780f1256 | ||
![]() |
7f39a46444 | ||
![]() |
8e5ef7b6d0 | ||
![]() |
16775f2fb5 | ||
![]() |
011734fc83 | ||
![]() |
dccdef9d77 | ||
![]() |
5adf3db0f1 | ||
![]() |
14da438553 | ||
![]() |
0e757204b0 | ||
![]() |
6e9829feeb | ||
![]() |
e8b9b478ed | ||
![]() |
ef78736003 | ||
![]() |
6fece0ab15 | ||
![]() |
803d667fcd | ||
![]() |
e6504a8bd7 | ||
![]() |
074b49d296 | ||
![]() |
4988517bcd | ||
![]() |
e0e014eaff | ||
![]() |
4e534dd5a1 | ||
![]() |
98ec613bd8 | ||
![]() |
e6685730d3 | ||
![]() |
b5cff7a503 | ||
![]() |
15b173ead8 | ||
![]() |
de5d80ad37 | ||
![]() |
c5b71eddba | ||
![]() |
b5b8d2931a | ||
![]() |
a76c819912 | ||
![]() |
c833622a64 | ||
![]() |
9642203bea | ||
![]() |
c7bf511567 | ||
![]() |
84bd33a038 | ||
![]() |
a9a3e1a8f4 | ||
![]() |
3e62106bc9 | ||
![]() |
5d778ddcfc | ||
![]() |
c8dcbbf027 | ||
![]() |
a91bfdc1a5 | ||
![]() |
4db9c50f41 | ||
![]() |
2861dc8fb3 | ||
![]() |
89fb283d4c | ||
![]() |
1c66842e67 | ||
![]() |
249a41befd | ||
![]() |
432303d6df | ||
![]() |
2357702601 | ||
![]() |
c04fdb34e0 | ||
![]() |
1b4905cc03 | ||
![]() |
60109622e9 | ||
![]() |
d863b57792 | ||
![]() |
44c977c9fa | ||
![]() |
8c2303431d | ||
![]() |
ccbc6e1aa2 | ||
![]() |
a5782cca4e | ||
![]() |
5fa8e2fb05 | ||
![]() |
48d9246368 | ||
![]() |
6f42c9ba30 | ||
![]() |
02105f748b | ||
![]() |
ec7bdec6ac | ||
![]() |
8741141c9f | ||
![]() |
2c2588d1c6 | ||
![]() |
8540a1ee0e | ||
![]() |
881c972d56 | ||
![]() |
5fbdfbc9bf | ||
![]() |
f2190ca758 | ||
![]() |
d82855b227 | ||
![]() |
3c32c8648a | ||
![]() |
7ce166690f | ||
![]() |
c9cc01c603 | ||
![]() |
83c6d7a5e6 | ||
![]() |
785e09c45d | ||
![]() |
2e9d54fb77 | ||
![]() |
4c9276c71d | ||
![]() |
c9e482ffe3 | ||
![]() |
a121f15d9b | ||
![]() |
ea9fa9c43d | ||
![]() |
f566a7b101 | ||
![]() |
ca2c51710a | ||
![]() |
de73b74c4b | ||
![]() |
cab65cfcf3 | ||
![]() |
2382c7531b | ||
![]() |
46a294805b | ||
![]() |
2a2122f81c | ||
![]() |
246ec48738 | ||
![]() |
124f3464ac | ||
![]() |
75f212bf2d | ||
![]() |
12cdcc58ad | ||
![]() |
0be313316f | ||
![]() |
71fe8a8c39 | ||
![]() |
005e78d86c | ||
![]() |
9c13d2a216 | ||
![]() |
0ec84e0005 | ||
![]() |
e79acb96e0 | ||
![]() |
e58ccef1f2 | ||
![]() |
fe75305436 | ||
![]() |
68cabcbb44 | ||
![]() |
69b41ab230 | ||
![]() |
89662e440d | ||
![]() |
efb93ebda6 | ||
![]() |
a25b208daa | ||
![]() |
4c4eb24f15 | ||
![]() |
961b323fec | ||
![]() |
ced6be1505 | ||
![]() |
c08fe10125 | ||
![]() |
d4d477e3b6 | ||
![]() |
e34720eb12 | ||
![]() |
149fb37220 | ||
![]() |
409741f42c | ||
![]() |
d5b7eefa20 | ||
![]() |
1524ba90ff | ||
![]() |
0d80e241f7 | ||
![]() |
125d85cfbb | ||
![]() |
746a015088 | ||
![]() |
b8e2f47429 | ||
![]() |
8f7ced3470 | ||
![]() |
670dc85b07 | ||
![]() |
d72593b1b1 | ||
![]() |
ee2a55ad0b | ||
![]() |
6c1dc81be4 | ||
![]() |
479935e602 | ||
![]() |
ecf77d7031 | ||
![]() |
0aad509a70 | ||
![]() |
b1305f42fa | ||
![]() |
005e9fca71 | ||
![]() |
5fa9d1589f | ||
![]() |
4083e16784 | ||
![]() |
8b08502c29 | ||
![]() |
c046067538 | ||
![]() |
6ce7aed131 | ||
![]() |
f7e0d53340 | ||
![]() |
82db432dbc | ||
![]() |
f35a6c88a1 | ||
![]() |
b4504b35b2 | ||
![]() |
2be3c241d5 | ||
![]() |
c964eb8ea7 | ||
![]() |
05c034a966 | ||
![]() |
043852e387 | ||
![]() |
f62c476876 | ||
![]() |
9cce3e783e | ||
![]() |
2583a1c4bf | ||
![]() |
b52428a2cf | ||
![]() |
cf5e597491 | ||
![]() |
f45b762566 | ||
![]() |
5cf4ca6c2d | ||
![]() |
251e3c8eda | ||
![]() |
4086baba28 | ||
![]() |
dab37f7e53 | ||
![]() |
f9e72c9d4c | ||
![]() |
fa979be419 | ||
![]() |
4be09e7180 | ||
![]() |
9b5783aa11 | ||
![]() |
1717d887b6 | ||
![]() |
9598012a77 | ||
![]() |
184a74ceb2 | ||
![]() |
b61855c3e8 | ||
![]() |
b7a187917b | ||
![]() |
7a69ffcdf8 | ||
![]() |
853c16dac3 | ||
![]() |
a50ce744bd | ||
![]() |
9ace883447 | ||
![]() |
ca1dde6a92 | ||
![]() |
6029625356 | ||
![]() |
51d17bbce6 | ||
![]() |
4c0832e2df | ||
![]() |
42fc5564ca | ||
![]() |
9cea1423cf | ||
![]() |
5b4c773554 | ||
![]() |
28b6f11618 | ||
![]() |
d9ade4410a | ||
![]() |
91ca408bdd | ||
![]() |
95906d6405 | ||
![]() |
b3f87e60ce | ||
![]() |
ef213c620d | ||
![]() |
285e9e879a | ||
![]() |
779d78a810 | ||
![]() |
4fce64d2b5 | ||
![]() |
211e002ab6 | ||
![]() |
3b9ad17e22 | ||
![]() |
3b3903afd3 | ||
![]() |
59634fd0d3 | ||
![]() |
b56e0d5640 | ||
![]() |
cbbacd5b5e | ||
![]() |
0a4824c145 | ||
![]() |
559766c143 | ||
![]() |
c19a664063 | ||
![]() |
723aed210d | ||
![]() |
4cfe93ec29 | ||
![]() |
dfbb8dab18 | ||
![]() |
348fcf849c | ||
![]() |
fb3a5f08db | ||
![]() |
73b4c48dcc | ||
![]() |
d12d24411e | ||
![]() |
1dd80e76b5 | ||
![]() |
45740f99c1 | ||
![]() |
a8037bfbe8 | ||
![]() |
8759dd6b38 | ||
![]() |
0713ca3910 | ||
![]() |
ca2e314c6e | ||
![]() |
19482cc3d9 | ||
![]() |
edf40ac5db | ||
![]() |
e5ff39d0de | ||
![]() |
b03f844e1c | ||
![]() |
588036687e | ||
![]() |
654bee2f24 | ||
![]() |
96f355cb9a | ||
![]() |
6924c1ce4a | ||
![]() |
0c75155aac | ||
![]() |
945ff66e80 | ||
![]() |
03d4390fa9 | ||
![]() |
d85cdb04b3 | ||
![]() |
55b907163d | ||
![]() |
bc27213999 | ||
![]() |
47cf967ba8 | ||
![]() |
40b5b2b887 | ||
![]() |
819b0dc373 | ||
![]() |
7427cfa3b4 | ||
![]() |
840dbe0dc4 | ||
![]() |
715c7e5c5a | ||
![]() |
fa853b1c68 | ||
![]() |
e23decb32a | ||
![]() |
221bd8cc96 | ||
![]() |
88b0b179a0 | ||
![]() |
5c33ea94d9 | ||
![]() |
e96a627082 | ||
![]() |
6dd879a781 | ||
![]() |
d633533752 | ||
![]() |
286af113f0 | ||
![]() |
f0064cbc70 | ||
![]() |
f83581dfb9 | ||
![]() |
5f61f576b9 | ||
![]() |
a42348d2cf | ||
![]() |
3ce5930fb0 | ||
![]() |
8c9ecd8268 | ||
![]() |
d199520f88 | ||
![]() |
23233fd39b | ||
![]() |
025069ab90 | ||
![]() |
2f1f2d3f23 | ||
![]() |
f8f2c3492b | ||
![]() |
864ec100d5 | ||
![]() |
7950dc9c4a | ||
![]() |
8af25b8493 | ||
![]() |
a6910271e6 | ||
![]() |
4a1b70019b | ||
![]() |
3eb56a3ce0 | ||
![]() |
37fa3de4e3 | ||
![]() |
82073aa51b | ||
![]() |
6378c52822 | ||
![]() |
df46099968 | ||
![]() |
aec82d2a96 | ||
![]() |
e689746014 | ||
![]() |
da04d638f9 | ||
![]() |
23249f1d6d | ||
![]() |
c46c903fd1 | ||
![]() |
0e3ddeee54 | ||
![]() |
1590dac974 | ||
![]() |
7d0c88abd5 | ||
![]() |
9940c34fba | ||
![]() |
e0c1777296 | ||
![]() |
b25bff002f | ||
![]() |
bad287c4be | ||
![]() |
e6e72ae4a9 | ||
![]() |
b0de125a1a | ||
![]() |
b1ad8e92ea | ||
![]() |
2eed6cf192 | ||
![]() |
71907ce12d | ||
![]() |
73cae8888e | ||
![]() |
5a7c7bf0a3 | ||
![]() |
a9bdc4def1 | ||
![]() |
fa532c6bfb | ||
![]() |
1306fcbcaf | ||
![]() |
017f61b323 | ||
![]() |
d38b1d9e97 | ||
![]() |
c8c495d003 | ||
![]() |
af6f549dd9 | ||
![]() |
e03d210eb9 | ||
![]() |
915a0acadf | ||
![]() |
e9aae285a6 | ||
![]() |
7bf862d9d3 | ||
![]() |
eefc6368dc | ||
![]() |
608fe3bbe9 | ||
![]() |
fdd6736e1d | ||
![]() |
0c812c9fa1 | ||
![]() |
2acd964d45 | ||
![]() |
1cfec04653 | ||
![]() |
ab1714b799 | ||
![]() |
d7b27c55c2 | ||
![]() |
740dfa22ab | ||
![]() |
be730d5c28 | ||
![]() |
f7e16f680f | ||
![]() |
ca807c2ad6 | ||
![]() |
f234269325 | ||
![]() |
ace5be049f | ||
![]() |
32ea5dc5cf | ||
![]() |
7d484b27a2 | ||
![]() |
abdf01a5c9 | ||
![]() |
e1b01b9b24 |
102 changed files with 5266 additions and 15394 deletions
|
@ -44,12 +44,6 @@ rules:
|
|||
no-unused-vars:
|
||||
- 2
|
||||
- argsIgnorePattern: "^_"
|
||||
# jsx a11y
|
||||
jsx-a11y/no-static-element-interactions: 0
|
||||
jsx-a11y/anchor-is-valid:
|
||||
- 2
|
||||
- specialLink:
|
||||
- to
|
||||
|
||||
globals:
|
||||
document: true
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
node_modules
|
||||
public
|
||||
|
|
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
_
|
4
.husky/pre-push
Executable file
4
.husky/pre-push
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn build && git add . && git commit --amend --no-edit
|
10
.prettierrc
10
.prettierrc
|
@ -1,5 +1,11 @@
|
|||
{
|
||||
"parser": "babylon",
|
||||
"parser": "babel",
|
||||
"printWidth": 100,
|
||||
"trailingComma": "all"
|
||||
"trailingComma": "all",
|
||||
"overrides": [{
|
||||
"files": ["*.html"],
|
||||
"options": {
|
||||
"parser": "go-template"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
|
17
COMMUNITY-FEATURES.md
Normal file
17
COMMUNITY-FEATURES.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Community features
|
||||
|
||||
<!--
|
||||
Did a cool thing with the theme and want to share it with rest of the Hello Friend theme users? Jump in!
|
||||
|
||||
Please follow the template:
|
||||
|
||||
- **NAME_OF_THE_FEATURE** (LINK TO YOUR FORK)
|
||||
- SHORT DESCRIPTION
|
||||
- SOMETHING ABOUT YOU (name and who you are / what you do / etc.)
|
||||
|
||||
eg:
|
||||
|
||||
- **Social media icons** (https://github.com/...)
|
||||
- This was a big missing feature of the theme. It will help your audience reach you over the internet.
|
||||
- John, a javascript developer.
|
||||
-->
|
213
README.md
213
README.md
|
@ -2,11 +2,31 @@
|
|||
|
||||

|
||||
|
||||
This theme was made to help you present your ideas easier. We all know how hard is to start something on the web, especially these days. You need to prepare a bunch of stuff, configure them and when that’s done — create the content.
|
||||
### DEMO - https://hugo-hello-friend.now.sh/ <a id="demo" />
|
||||
|
||||
This theme is pretty basic and covers all of the essentials. All you have to do is start typing!
|
||||
<a href="https://www.buymeacoffee.com/panr" target="_blank"><img src="https://res.cloudinary.com/panr/image/upload/v1579374705/buymeacoffee_y6yvov.svg" alt="Buy Me A Coffee" ></a>
|
||||
|
||||
### DEMO - https://hugo-hello-friend.now.sh/
|
||||
---
|
||||
|
||||
- [Hello Friend](#hello-friend)
|
||||
- [DEMO - https://hugo-hello-friend.now.sh/](#demo)
|
||||
- [Features](#features)
|
||||
- [Built-in shortcodes](#built-in-shortcodes)
|
||||
- [Code highlighting](#code-highlighting)
|
||||
- [Improved RSS Feed](#improved-rss-feed)
|
||||
- [How to start](#how-to-start)
|
||||
- [How to run your site](#how-to-run-your-site)
|
||||
- [How to configure](#how-to-configure)
|
||||
- [How to add a cover image to your posts](#how-to-add-a-cover-image-to-your-posts)
|
||||
- [How to display the Last Modified Date in your posts](#how-to-display-the-last-modified-date-in-your-posts)
|
||||
- [How to hide "Read more" button](#how-to-hide-read-more-button)
|
||||
- [Add-ons](#add-ons)
|
||||
- [How to (safely) edit the theme](#how-to-edit)
|
||||
- [Found a bug?](#bug)
|
||||
- [New cool idea or feature](#feature)
|
||||
- [`Hello Friend` theme user?](#hello-friend-theme-user)
|
||||
- [Sponsoring](#sponsoring)
|
||||
- [License](#license)
|
||||
|
||||
## Features
|
||||
|
||||
|
@ -21,6 +41,34 @@ This theme is pretty basic and covers all of the essentials. All you have to do
|
|||
- eg: `{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}`
|
||||
- **`figure`** (same as `image`, plus few optional props: **`caption`**, **`captionPosition`** (left | **center** is default | right), **`captionStyle`**
|
||||
- eg: `{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}`
|
||||
- **`imgproc`** Hugo shortcode for image processing, plus additional **`position`** param [ left | center | right ] (optional).
|
||||
- eg: `{{< imgproc "img/hello.png" Resize "250x" center />}}`
|
||||
- More detailed info on processing commands at [https://gohugo.io/content-management/image-processing/](https://gohugo.io/content-management/image-processing/)
|
||||
- **`code`** (prop required: **`language`**; props optional: **`title`**, **`id`**, **`expand`** (default "△"), **`collapse`** (default "▽"), **`isCollapsed`**)
|
||||
- eg:
|
||||
```go
|
||||
{{< code language="css" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}}
|
||||
pre {
|
||||
background: #1a1a1d;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
overflow: auto;
|
||||
|
||||
@media (--phone) {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
code {
|
||||
background: none !important;
|
||||
color: #ccc;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
}
|
||||
}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
#### Code highlighting
|
||||
|
||||
|
@ -34,40 +82,76 @@ By default the theme is using PrismJS to color your code syntax. All you need to
|
|||
|
||||
**Supported languages**: bash/shell, css, clike, javascript, apacheconf, actionscript, applescript, c, csharp, cpp, coffeescript, ruby, csp, css-extras, diff, django, docker, elixir, elm, markup-templating, erlang, fsharp, flow, git, go, graphql, less, handlebars, haskell, http, java, json, kotlin, latex, markdown, makefile, objectivec, ocaml, perl, php, php-extras, r, sql, processing, scss, python, jsx, typescript, toml, reason, textile, rust, sass, stylus, scheme, pug, swift, yaml, haml, twig, tsx, vim, visual-basic, wasm.
|
||||
|
||||
#### Improved RSS Feed
|
||||
|
||||
Some enhancements have been made to Hugo's [internal RSS](https://github.com/gohugoio/hugo/blob/25a6b33693992e8c6d9c35bc1e781ce3e2bca4be/tpl/tplimpl/embedded/templates/_default/rss.xml) generation code.
|
||||
|
||||
**A page's cover image now appears at the top of its feed display**. This image is set manually using [the cover params](#how-to-add-a-cover-image-to-your-posts). If unset, the RSS generator searches for the first image file in the page bundle whose name includes 'featured', 'cover', or 'thumbnail'.
|
||||
|
||||
**You can optionally display the full page content in your RSS feed** (default is Description or Summary data from Front Matter). Set `rssFullText = true` in your `config.toml` file to enable this option.
|
||||
|
||||
**You can choose a site image to be displayed when searching for your RSS feed.** Set `rssImage = "image/url/here"` in your `config.toml` file to enable this option.
|
||||
|
||||
## How to start
|
||||
|
||||
You can download the theme manually by going to [https://github.com/panr/hugo-theme-hello-friend.git](https://github.com/panr/hugo-theme-hello-friend.git) and pasting it to `themes/hello-friend` in your root directory.
|
||||
|
||||
You can also clone it directly to your Hugo folder:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
|
||||
```bash
|
||||
git clone https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
|
||||
```
|
||||
|
||||
If you don't want to make any radical changes, it's the best option, because you can get new updates when they are available. To do so, include it as a git submodule:
|
||||
|
||||
```bash
|
||||
git submodule add -f https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
|
||||
```
|
||||
$ git submodule add https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
|
||||
|
||||
⚠️ **The theme needs at least Hugo version 0.74.x**.
|
||||
|
||||
## How to run your site
|
||||
|
||||
From your Hugo root directory run:
|
||||
|
||||
```
|
||||
hugo server -t hello-friend
|
||||
```
|
||||
|
||||
and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time.
|
||||
|
||||
## How to configure
|
||||
|
||||
The theme doesn't require any advanced configuration. Just copy:
|
||||
|
||||
```
|
||||
```toml
|
||||
baseurl = "/"
|
||||
languageCode = "en-us"
|
||||
theme = "hello-friend"
|
||||
paginate = 5
|
||||
|
||||
[params]
|
||||
# dir name of your blog content (default is `content/posts`)
|
||||
# dir name of your blog content (default is `content/posts`).
|
||||
# the list of set content will show up on your index page (baseurl).
|
||||
contentTypeName = "posts"
|
||||
|
||||
# "light" or "dark"
|
||||
defaultTheme = "dark"
|
||||
|
||||
# if you set this to 0, only submenu trigger will be visible
|
||||
showMenuItems = 2
|
||||
|
||||
# Show reading time in minutes for posts
|
||||
showReadingTime = false
|
||||
|
||||
# Show table of contents at the top of your posts (defaults to false)
|
||||
# Alternatively, add this param to post front matter for specific posts
|
||||
# toc = true
|
||||
|
||||
# Show full page content in RSS feed items
|
||||
#(default is Description or Summary metadata in the front matter)
|
||||
# rssFullText = true
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
title = "Hello Friend"
|
||||
|
@ -80,6 +164,11 @@ paginate = 5
|
|||
readOtherPosts = "Read other posts"
|
||||
newerPosts = "Newer posts"
|
||||
olderPosts = "Older posts"
|
||||
minuteReadingTime = "min read"
|
||||
dateFormatSingle = "2006-01-02"
|
||||
dateFormatList = "2006-01-02"
|
||||
# leave empty to disable, enter display text to enable
|
||||
# lastModDisplay = ""
|
||||
|
||||
[languages.en.params.logo]
|
||||
logoText = "hello friend"
|
||||
|
@ -104,40 +193,104 @@ to `config.toml` file in your Hugo root directory and change params fields. In c
|
|||
|
||||
**NOTE:** Please keep in mind that currently main menu doesn't support nesting.
|
||||
|
||||
## How to run your site
|
||||
## How to add a cover image to your posts
|
||||
|
||||
From your Hugo root directory run:
|
||||
Adding a cover image to your post is simple and there are two options when you edit your `index.md` file in `content/posts/blog-entry-xy/index.md`:
|
||||
|
||||
```
|
||||
$ hugo server -t hello-friend
|
||||
* Use `cover = "/path/to/absolute/img.jpg"` to link an absolute image
|
||||
* Resulting in `https://www.yourpage.com/path/to/absolute/img.jpg`
|
||||
* Use `cover = "img.jpg"` and `useRelativeCover = true` to link the image relative to the blog post folder
|
||||
* Resulting in `https://www.yourpage.com/posts/blog-entry-xy/img.jpg`
|
||||
* Use `coverAlt = "description of image"` to add custom alt text to the cover image (defaults to post or page title as alt text)
|
||||
* Use `coverCaption = "Image Credit to [Barry Bluejeans](https://unsplash.com/)"` to add a caption for the cover image.
|
||||
|
||||
## How to display the Last Modified Date in your posts
|
||||
|
||||
Add `lastModDisplay = "[your display text]"` to `config.toml` to enable last modified date on your posts. Note - an empty string value `""` does not display anything.
|
||||
|
||||
Example: `lastModDisplay = "Modified:"` --> "Modified: Jan 01, 0001"
|
||||
|
||||
:octocat: Hugo's `enableGitInfo` option is a nice complement to this feature.
|
||||
|
||||
## How to hide "Read more" button
|
||||
|
||||
In a post's front matter you have to add `hideReadMore` param set to `true`. This will result in that the post won't have "Read more" button in the list view.
|
||||
|
||||
## Add-ons
|
||||
|
||||
- **Archive** — Theme has built-in `archive` page for main content (see `contentTypeName` variable in config). If you need archive on your blog just copy https://github.com/panr/hugo-theme-hello-friend/blob/master/exampleSite/content/archive.md to your `content` dir. If you need multilangual archives, duplicate `content/archive.md` and add `.Lang` variable, eg: `content/archive.pl.md` (remember to change `url` in duplicated file).
|
||||
- **Comments** — for adding comments to your blog posts please take a look at `layouts/partials/comments.html` https://github.com/panr/hugo-theme-terminal/blob/master/layouts/partials/comments.html.
|
||||
- **Prepended `<head>`** — if you need to add something inside `<head>` element, and before any of the theme's `<script>` and `<link>` tags are declared, please take a look at `layouts/partial/prepended_head.html` https://github.com/panr/hugo-theme-hello-friend/blob/master/layouts/partials/prepended_head.html
|
||||
- **Extended `<head>`** — if you need to add something inside `<head>` element, after all of all of the theme's `<script>` and `<link>` tags are declared, please take a look at `layouts/partial/extended_head.html` https://github.com/panr/hugo-theme-hello-friend/blob/master/layouts/partials/extended_head.html
|
||||
- **Extended `<footer>`** — if you need to add something before end of `<body>` element, please take a look at `layouts/partial/extended_footer.html` https://github.com/panr/hugo-theme-hello-friend/blob/master/layouts/partials/extended_footer.html
|
||||
|
||||
## How to (safely) edit the theme <a id="how-to-edit" />
|
||||
|
||||
If you have to override only some of the styles, you can do this easily by adding `static/style.css` in your root directory and point things you want to change.
|
||||
|
||||
To change something directly in the theme, you have to go to `themes/hello-friend` and modify the files.
|
||||
|
||||
First, you need to install Node dependencies. To do so, go to the theme directory (from your Hugo root directory):
|
||||
|
||||
```bash
|
||||
cd themes/hello-friend
|
||||
```
|
||||
|
||||
and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time.
|
||||
then run:
|
||||
|
||||
## How to edit the theme
|
||||
|
||||
If you have to override some of the styles, you can do this easily by adding `static/styles.css` in your root directory and point things you want to change.
|
||||
|
||||
Otherwise, if you really want to edit the theme, you need to install Node dependencies. To do so, go to the theme directory (from your Hugo root directory):
|
||||
|
||||
```
|
||||
$ cd themes/hello-friend
|
||||
```bash
|
||||
npm install
|
||||
npm i yarn
|
||||
yarn
|
||||
```
|
||||
|
||||
and then run:
|
||||
After you modified the files you can run webpack in watch mode:
|
||||
|
||||
```
|
||||
$ npm install
|
||||
$ npm i yarn
|
||||
$ yarn
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## How to contribute
|
||||
or rebuild theme
|
||||
|
||||
If you spot any bugs, please use [Issue Tracker](https://github.com/panr/hugo-theme-hello-friend/issues) or if you want to add a new feature directly please create a new [Pull Request](https://github.com/panr/hugo-theme-hello-friend/pulls).
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
## Licence
|
||||
To see the changes (remember to restart `hugo server`).
|
||||
|
||||
Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
||||
## Found a bug? <a id="bug" />
|
||||
|
||||
If you spot any bugs, please use [Issue Tracker](https://github.com/panr/hugo-theme-hello-friend/issues) or create a new [Pull Request](https://github.com/panr/hugo-theme-hello-friend/pulls) to fix the issue.
|
||||
|
||||
## New cool idea or feature? <a id="feature" />
|
||||
|
||||
The theme is in constant development since 2019 and has got many cool features that helped many of you and made the theme better. But there were also many features that I wasn't sure about because I want to keep the theme as simple as possible.
|
||||
|
||||
So, let's say you have an idea of how to extend the theme. That's cool and you're welcome to do that, just follow these steps:
|
||||
|
||||
- fork the theme
|
||||
- implement the feature
|
||||
- write an instruction how to use the feature
|
||||
- give a working example of the implementation for other users
|
||||
- add info about your work to `COMMUNITY-FEATURES.md`
|
||||
- make a PR with edited `COMMUNITY-FEATURES.md`
|
||||
|
||||
This will help keeping the theme close to its roots, and also allow anyone who wishes to improve it and match their needs, to do whatever they want.
|
||||
|
||||
Sounds OK? Cool, let's rock! 🤘
|
||||
|
||||
## `Hello Friend` theme user?
|
||||
|
||||
I'd be happy to know more about you and what you are doing. If you want to share it, please make a contribution and [add your site to the list](https://github.com/panr/hugo-theme-hello-friend/blob/master/USERS.md)! 🤗
|
||||
|
||||
## Sponsoring
|
||||
|
||||
If you like my work and want to support the development of the project, now you can! Just:
|
||||
|
||||
<a href="https://www.buymeacoffee.com/panr" target="_blank"><img src="https://res.cloudinary.com/panr/image/upload/v1579374705/buymeacoffee_y6yvov.svg" alt="Buy Me A Coffee" ></a>
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2019-2020 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
||||
|
||||
The theme is released under the MIT License. Check the [original theme license](https://github.com/panr/hugo-theme-hello-friend/blob/master/LICENSE.md) for additional licensing information.
|
||||
|
|
44
USERS.md
Normal file
44
USERS.md
Normal file
|
@ -0,0 +1,44 @@
|
|||
# Meet the users of Hello Friend theme!
|
||||
|
||||
<!--
|
||||
TEMPLATE:
|
||||
|
||||
- https://radoslawkoziel.pl — **Radek Kozieł** (Software designer and developer)
|
||||
|
||||
-->
|
||||
|
||||
- https://0x44.pw — **Ian Pringle** (System Admin and developer)
|
||||
- https://adamormsby.com - **Adam Ormsby** (Generalist Programmer - Web, Mobile, Games)
|
||||
- https://arubacao.com **Christopher Lass** (Software Engineer and DevOps)
|
||||
- https://blog.agate.pw/ - **Marco Agate** (System Engineer, DevOps)
|
||||
- https://blog.agung.io - **Agung Pratama** (Software Engineer and DevOps)
|
||||
- https://blog.jyny.dev/ - **Jyny Chen** (Software Engineer)
|
||||
- https://blog.lepape.me/ - **François Le Pape** (Student & developer freelance)
|
||||
- https://blog.toluwalemi.com/ - **Toluwalemi Oluwadare** (Software Engineer and Content Writer)
|
||||
- https://cobalto.net/ - **Daniel Pessoa** (Sofware Developer and BI Analyst)
|
||||
- https://eallion.com/ - **大大的小蜗牛** (E-commerce operator)
|
||||
- https://etra0.github.io/ - **Sebastián Aedo** (Computer Science student, interested in Game Hacking)
|
||||
- https://fazi1058.github.io **Faezeh Roeinfard** (Student)
|
||||
- https://felixleger.com/ - **Félix Léger** (Sofware Developer and DevOps)
|
||||
- https://gabrielacaesar.com/ - **Gabriela Caesar** (Data journalist)
|
||||
- https://guilhermesteves.dev/ - **Guilherme Esteves** (Software Engineer, Writer, Speaker)
|
||||
- https://hesec.de - **Patrick Hener** (Security Researcher, Pentester and Coder)
|
||||
- https://ilya-lesikov.com - **Ilya Lesikov** (DevOps, SRE)
|
||||
- https://imgalone.com/ - **Iancu makes games alone** (Indie Game Dev)
|
||||
- https://jonathan.rico.live/ - **Jonathan Rico** (Electronics Engineer)
|
||||
- https://kartiniteknologi.id/ - **Kartini Teknologi team** (Tech podcast)
|
||||
- https://mfaishal.com **Faishal Irawan** (Student)
|
||||
- https://mritd.com/ - **漠然** (Software Engineer and DevOps)
|
||||
- https://musq.github.io — **Ashish Ranjan** (Software Engineer)
|
||||
- https://protocod.gitlab.io/blog/ **protocod** (Web Developer)
|
||||
- https://shinytoyrobots.com - **shinytoyrobots** (Eclectic journaling and essays)
|
||||
- https://simeononsecurity.ch/ - **SimeonOnSecurity** (Security and Automation Blog)
|
||||
- https://verso.re/ - **Joan Calabrés** (Security Engineer)
|
||||
- https://atticuslab.com/ - **Atticus** (Game Server Engineer)
|
||||
- https://gregbair.dev/ - **Greg Bair** (Developer and App Architect)
|
||||
- https://www.miroslavbucek.cz - **Miroslav Buček** (Product Manager, Smart Home company owner)
|
||||
- https://farhamdani.com/ - **Farhamdani** (Freelancer & Nganggur Productive)
|
||||
- https://fmg3d.com/ - **Finn M Glas** (Aspiring Physicist, Software Developer)
|
||||
- https://nali.org/ - **Nick Ali** (Marketer)
|
||||
- https://abhinav031.github.io - **Abhinav Sriram** (Digital Artist, Hobbyist)
|
||||
- https://schnerring.net/ - **Michael Schnerring** (Software Engineer)
|
72
assets/css/archive.css
Normal file
72
assets/css/archive.css
Normal file
|
@ -0,0 +1,72 @@
|
|||
.archive {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
|
||||
&__group {
|
||||
&-month {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 10px 0;
|
||||
|
||||
@media (--phone) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
}
|
||||
|
||||
&-year {
|
||||
margin-top: 40px;
|
||||
|
||||
@media (--phone) {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
&-header {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-month {
|
||||
&-header {
|
||||
margin: 25px 0;
|
||||
width: 200px;
|
||||
opacity: .5;
|
||||
|
||||
@media (--phone) {
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-posts {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&__post {
|
||||
padding: 20px 0;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
&-title {
|
||||
margin: 5px 0;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ a.button {
|
|||
justify-content: center;
|
||||
padding: 8px 18px;
|
||||
margin-bottom: 5px;
|
||||
background: var(--light-background-secondary);
|
||||
background: var(--background-secondary);
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
|
@ -23,24 +23,14 @@ a.button {
|
|||
cursor: pointer;
|
||||
outline: none;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/* variants */
|
||||
|
||||
&.outline {
|
||||
background: transparent;
|
||||
border-color: var(--light-background-secondary);
|
||||
border-color: var(--background-secondary);
|
||||
box-shadow: none;
|
||||
padding: 8px 18px;
|
||||
|
||||
.dark-theme & {
|
||||
border-color: var(--dark-background-secondary);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
:hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
|
@ -82,10 +72,6 @@ a.read-more:active {
|
|||
padding: 0;
|
||||
margin: 20px 0;
|
||||
font-weight: bold;
|
||||
|
||||
.dark-theme & {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
|
||||
.code-toolbar {
|
||||
|
@ -98,7 +84,7 @@ a.read-more:active {
|
|||
justify-content: center;
|
||||
padding: 3px 8px;
|
||||
margin-bottom: 5px;
|
||||
background: var(--light-background-secondary);
|
||||
background: var(--background-secondary);
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
|
@ -108,10 +94,5 @@ a.read-more:active {
|
|||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
}
|
96
assets/css/code.css
Normal file
96
assets/css/code.css
Normal file
|
@ -0,0 +1,96 @@
|
|||
.collapsable-code {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin: 40px 0;
|
||||
|
||||
input[type="checkbox"] {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked {
|
||||
~ pre,
|
||||
~ .code-toolbar pre {
|
||||
height: 0;
|
||||
padding: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
~ .code-toolbar {
|
||||
padding: 0;
|
||||
border-top: none;
|
||||
|
||||
.toolbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
~ label {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
~ label .collapsable-code__toggle:after {
|
||||
content: attr(data-label-expand);
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: var(--background-secondary);
|
||||
padding: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
min-width: 30px;
|
||||
min-height: 30px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&__title {
|
||||
flex: 1;
|
||||
color: var(--color);
|
||||
padding: 3px 10px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&__language {
|
||||
background: var(--background);
|
||||
color: var(--color);
|
||||
border-radius: 10px;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
&__toggle {
|
||||
color: var(--color);
|
||||
font-size: 16px;
|
||||
padding: 3px 10px;
|
||||
|
||||
&:after {
|
||||
content: attr(data-label-collapse);
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
|
||||
&::first-line {
|
||||
line-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
code {
|
||||
&::first-line {
|
||||
line-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.code-toolbar {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
50
assets/css/fonts.css
Normal file
50
assets/css/fonts.css
Normal file
|
@ -0,0 +1,50 @@
|
|||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-Regular.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-Italic.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-Medium.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-MediumItalic.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-Bold.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 800;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
src: url("../fonts/Inter-BoldItalic.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
.footer {
|
||||
padding: 40px 20px;
|
||||
flex-grow: 0;
|
||||
color: var(--light-color-secondary);
|
||||
color: var(--color-secondary);
|
||||
|
||||
&__inner {
|
||||
display: flex;
|
||||
|
@ -25,7 +25,6 @@
|
|||
flex-direction: row;
|
||||
align-items: center;
|
||||
font-size: 1rem;
|
||||
color: var(--light-color-secondary);
|
||||
|
||||
&--user {
|
||||
margin: auto;
|
||||
|
@ -50,4 +49,3 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
.header {
|
||||
background: #fafafa;
|
||||
background: var(--header);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 20px;
|
||||
|
||||
.dark-theme & {
|
||||
background: #252627;
|
||||
}
|
||||
|
||||
&__right {
|
||||
display: flex;
|
||||
flex-direction: row;
|
|
@ -13,29 +13,22 @@ body {
|
|||
padding: 0;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
line-height: 1.54;
|
||||
background-color: var(--light-background);
|
||||
color: var(--light-color);
|
||||
background-color: var(--background);
|
||||
color: var(--color);
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
|
||||
-webkit-overflow-scrolling: touch;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
|
||||
@media (--phone) {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&.dark-theme {
|
||||
background-color: var(--dark-background);
|
||||
color: var(--dark-color);
|
||||
}
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
|
@ -132,22 +125,25 @@ figure {
|
|||
}
|
||||
}
|
||||
|
||||
code {
|
||||
code, kbd {
|
||||
font-family: Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;
|
||||
font-feature-settings: normal;
|
||||
background: var(--light-background-secondary);
|
||||
background: var(--background-secondary);
|
||||
padding: 1px 6px;
|
||||
margin: 0 2px;
|
||||
border-radius: 5px;
|
||||
font-size: .9rem;
|
||||
font-weight: normal;
|
||||
font-feature-settings: normal;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
code, kbd {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
font-feature-settings: normal;
|
||||
background: #212020;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
|
@ -160,15 +156,12 @@ pre {
|
|||
}
|
||||
|
||||
code {
|
||||
font-feature-settings: normal;
|
||||
background: none !important;
|
||||
color: #ccc;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: .9rem;
|
||||
|
||||
.dark-theme & {
|
||||
color: inherit;
|
||||
}
|
||||
font-size: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +193,8 @@ blockquote {
|
|||
}
|
||||
}
|
||||
|
||||
table {
|
||||
/* Fix for gist integration */
|
||||
table:not(.js-file-line-container) {
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
|
@ -208,17 +202,14 @@ table {
|
|||
border-radius: 5px;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
/* Fix for gist integration */
|
||||
table, th, td:not(.js-line-number) {
|
||||
border: 1px solid;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
th {
|
||||
background: var(--light-background-secondary);
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
}
|
||||
background: var(--background-secondary);
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
|
@ -257,14 +248,27 @@ ol ol {
|
|||
hr {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: var(--light-border-color);
|
||||
background: var(--border-color);
|
||||
height: 1px;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.framed {
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--border-color);
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet {
|
||||
background: hsl(206deg 62% 45% / 10%);
|
||||
border: none;
|
||||
padding: 30px;
|
||||
color: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
border-radius: 8px;
|
||||
}
|
|
@ -1,26 +1,22 @@
|
|||
@define-mixin menu {
|
||||
position: absolute;
|
||||
background: #fafafa;
|
||||
background: var(--header);
|
||||
box-shadow: var(--shadow);
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
list-style: none;
|
||||
border-radius: 5px;
|
||||
z-index: 99;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.menu {
|
||||
--shadow-color: rgba(0, 0, 0, .12);
|
||||
--shadow: 0 8px 20px var(--shadow-color);
|
||||
--color: rgba(0, 0, 0, .12);
|
||||
--shadow: 0 8px 20px var(--color);
|
||||
|
||||
border-right: 1px solid;
|
||||
margin-right: 18px;
|
||||
padding-right: 24px;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
|
||||
@media (--phone) {
|
||||
@mixin menu;
|
||||
|
@ -112,19 +108,20 @@
|
|||
li {
|
||||
.menu__inner & {
|
||||
margin-left: 0;
|
||||
padding: 10px;
|
||||
white-space: nowrap;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dark-theme & {
|
||||
background: rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
}
|
||||
li a {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,18 +11,13 @@
|
|||
text-align: center;
|
||||
margin: 0 auto;
|
||||
padding: 5px 10px;
|
||||
background: var(--light-background);
|
||||
color: var(--light-color-secondary);
|
||||
background: var(--background);
|
||||
color: var(--color-secondary);
|
||||
font-size: .8rem;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
letter-spacing: .1em;
|
||||
z-index: 1;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background);
|
||||
color: var(--dark-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
hr {
|
||||
|
@ -52,19 +47,15 @@
|
|||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--light-background-secondary);
|
||||
background: var(--background-secondary);
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
border-radius: 8px;
|
||||
max-width: 40%;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
}
|
||||
|
||||
+ .button {
|
||||
margin-left: 10px;
|
||||
}
|
|
@ -10,11 +10,7 @@
|
|||
}
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px solid var(--light-border-color);
|
||||
|
||||
.dark-theme & {
|
||||
border-color: var(--dark-border-color);
|
||||
}
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
&-meta {
|
||||
|
@ -55,11 +51,15 @@
|
|||
}
|
||||
|
||||
&-cover {
|
||||
border-radius: 8px;
|
||||
margin: 40px -50px;
|
||||
width: 860px;
|
||||
max-width: 860px;
|
||||
|
||||
img {
|
||||
margin: 0 auto;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
@media (--tablet) {
|
||||
margin: 20px 0;
|
|
@ -15,7 +15,7 @@ pre[class*="language-"] {
|
|||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
/* line-height: 1.5; */
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
18
assets/css/style.css
Normal file
18
assets/css/style.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
@import 'variables.css';
|
||||
|
||||
@import 'fonts.css';
|
||||
@import 'buttons.css';
|
||||
|
||||
@import 'header.css';
|
||||
@import 'logo.css';
|
||||
@import 'menu.css';
|
||||
@import 'main.css';
|
||||
@import 'post.css';
|
||||
@import 'pagination.css';
|
||||
@import 'footer.css';
|
||||
|
||||
@import 'terms.css';
|
||||
@import 'archive.css';
|
||||
|
||||
@import 'prism.css';
|
||||
@import 'code.css';
|
30
assets/css/terms.css
Normal file
30
assets/css/terms.css
Normal file
|
@ -0,0 +1,30 @@
|
|||
.terms {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
|
||||
&__list {
|
||||
padding: 0;
|
||||
padding-left: 20px;
|
||||
margin: 0;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__term {
|
||||
margin-bottom: 15px;
|
||||
|
||||
&-count {
|
||||
background: var(--background-secondary);
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
padding: 2px 10px;
|
||||
border-radius: 5px;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +1,27 @@
|
|||
:root {
|
||||
/* light theme color */
|
||||
--light-background: #fff;
|
||||
--light-background-secondary: #eaeaea;
|
||||
--light-color: #222;
|
||||
--light-color-secondary: #999;
|
||||
--light-border-color: #dcdcdc;
|
||||
|
||||
/* dark theme colors */
|
||||
--dark-background: #292a2d;
|
||||
--dark-background-secondary: #3b3d42;
|
||||
--dark-color: #a9a9b3;
|
||||
--dark-color-secondary: #73747b;
|
||||
--dark-border-color: #4a4b50;
|
||||
--background: #fff;
|
||||
--background-secondary: #eaeaea;
|
||||
--header: #fafafa;
|
||||
--color: #222;
|
||||
--color-secondary: #999;
|
||||
--border-color: #dcdcdc;
|
||||
|
||||
/* variables for js, must be the same as these in @custom-media queries */
|
||||
--phoneWidth: (max-width: 684px);
|
||||
--tabletWidth: (max-width: 900px);
|
||||
}
|
||||
|
||||
body.dark-theme {
|
||||
/* dark theme colors */
|
||||
--background: #292a2d;
|
||||
--background-secondary: #3b3d42;
|
||||
--header: #252627;
|
||||
--color: #a9a9b3;
|
||||
--color-secondary: #73747b;
|
||||
--border-color: #4a4b50;
|
||||
}
|
||||
|
||||
@custom-media --phone (width < 684px);
|
||||
@custom-media --tablet (width < 900px);
|
||||
|
||||
|
@ -26,7 +30,7 @@
|
|||
width: $width;
|
||||
height: $height;
|
||||
|
||||
polyline {
|
||||
path {
|
||||
stroke: currentColor;
|
||||
stroke-width: $stroke-width;
|
||||
}
|
BIN
assets/fonts/Inter-Bold.woff2
Normal file
BIN
assets/fonts/Inter-Bold.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/Inter-BoldItalic.woff2
Normal file
BIN
assets/fonts/Inter-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/Inter-Italic.woff2
Normal file
BIN
assets/fonts/Inter-Italic.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/Inter-Medium.woff2
Normal file
BIN
assets/fonts/Inter-Medium.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/Inter-MediumItalic.woff2
Normal file
BIN
assets/fonts/Inter-MediumItalic.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/Inter-Regular.woff2
Normal file
BIN
assets/fonts/Inter-Regular.woff2
Normal file
Binary file not shown.
|
@ -20,7 +20,7 @@ menuMore && menuMore.addEventListener("click", e => e.stopPropagation());
|
|||
isMobileMenu();
|
||||
|
||||
document.body.addEventListener("click", () => {
|
||||
if (!isMobile() && !menuMore.classList.contains("hidden")) {
|
||||
if (!isMobile() && menuMore && !menuMore.classList.contains("hidden")) {
|
||||
menuMore.classList.add("hidden");
|
||||
} else if (isMobile() && !menu.classList.contains("hidden")) {
|
||||
menu.classList.add("hidden");
|
||||
|
@ -44,7 +44,10 @@ desktopMenuTrigger &&
|
|||
e.stopPropagation();
|
||||
menuMore && menuMore.classList.toggle("hidden");
|
||||
|
||||
if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {
|
||||
if (
|
||||
menuMore &&
|
||||
menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right
|
||||
) {
|
||||
menuMore.style.left = "auto";
|
||||
menuMore.style.right = 0;
|
||||
}
|
18
babel.config.js
Normal file
18
babel.config.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
module.exports = function(api) {
|
||||
api.cache(true);
|
||||
|
||||
const presets = [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
targets: "last 2 versions, >1%, not dead",
|
||||
},
|
||||
],
|
||||
];
|
||||
const plugins = [];
|
||||
|
||||
return {
|
||||
presets,
|
||||
plugins,
|
||||
};
|
||||
};
|
|
@ -8,7 +8,10 @@ paginate = 5
|
|||
contentTypeName = "post"
|
||||
# "light" or "dark"
|
||||
defaultTheme = "dark"
|
||||
# if you set this to 0, only submenu trigger will be visible
|
||||
showMenuItems = 2
|
||||
# Enable to show reading time in minutes for posts
|
||||
showReadingTime = false
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
|
@ -22,6 +25,9 @@ paginate = 5
|
|||
readOtherPosts = "Read other posts"
|
||||
newerPosts = "Newer posts"
|
||||
olderPosts = "Older posts"
|
||||
minuteReadingTime = "min read"
|
||||
dateFormatSingle = "2006-01-02"
|
||||
dateFormatList = "2006-01-02"
|
||||
|
||||
[languages.en.params.logo]
|
||||
logoText = "hello friend"
|
||||
|
|
6
exampleSite/content/archive.md
Normal file
6
exampleSite/content/archive.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
title = "Archive"
|
||||
layout = "list"
|
||||
url = "/archive"
|
||||
type = "archive"
|
||||
+++
|
|
@ -2,7 +2,7 @@
|
|||
title = "Hello Friend"
|
||||
date = "1986-09-17"
|
||||
author = "Elliot"
|
||||
cover = "hello.jpg"
|
||||
cover = "img/hello.jpg"
|
||||
description = "\"Hello, friend?\" That's lame. Maybe I should give you a name?"
|
||||
+++
|
||||
|
||||
|
|
29
layouts/404.html
Normal file
29
layouts/404.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{ define "main" }}
|
||||
<div class="post">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-content">
|
||||
<p>
|
||||
{{ "Hmm... Sorry, this page seems to be missing." | markdownify }}
|
||||
</p>
|
||||
|
||||
{{ if .Site.Taxonomies.tags }}
|
||||
<p>
|
||||
{{ "Maybe these tags will help you find what you're looking for. :smile:" | markdownify | emojify }}
|
||||
</p>
|
||||
<h2>Tags</h2>
|
||||
<div class="terms">
|
||||
<ul class="terms__list">
|
||||
{{ range .Site.Taxonomies.tags }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a
|
||||
><span class="terms__term-count">{{ .Count }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
|
@ -2,7 +2,11 @@
|
|||
<html lang="{{ $.Site.Language }}">
|
||||
<head>
|
||||
{{ block "title" . }}
|
||||
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ end }}</title>
|
||||
<title>
|
||||
{{ if .IsHome }}{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} —
|
||||
{{ . }}{{ end }}{{ else }}{{ .Title }} ::
|
||||
{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ end }}
|
||||
</title>
|
||||
{{ end }}
|
||||
{{ partial "head.html" . }}
|
||||
</head>
|
||||
|
@ -11,8 +15,7 @@
|
|||
{{ partial "header.html" . }}
|
||||
|
||||
<div class="content">
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
{{ block "main" . }} {{ end }}
|
||||
</div>
|
||||
|
||||
{{ block "footer" . }}
|
||||
|
@ -20,5 +23,8 @@
|
|||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if $.Site.GoogleAnalytics }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
69
layouts/_default/index.html
Normal file
69
layouts/_default/index.html
Normal file
|
@ -0,0 +1,69 @@
|
|||
{{ define "main" }}
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
|
||||
{{ $PageContext := . }}
|
||||
{{ if .IsHome }}
|
||||
{{ $PageContext = .Site }}
|
||||
{{ end }}
|
||||
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
|
||||
|
||||
{{ if .Content }}
|
||||
<div class="index-content {{ if .Params.framed -}}framed{{- end -}}">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="posts">
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post-meta">
|
||||
{{ if .Date }}
|
||||
<span class="post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
|
||||
{{ if $.Site.Params.LastModDisplay }}
|
||||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
<a href="{{ (urlize (printf "tags/%s" . )) | absLangURL }}/">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ with .Description }}
|
||||
{{ . | markdownify }}
|
||||
{{ else }}
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if not .Params.hideReadMore }}
|
||||
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore | default "Read more" }} →</a></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
|
@ -1,29 +1,41 @@
|
|||
{{ define "main" }}
|
||||
<div class="posts">
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
{{ $paginator := .Paginate (where .Data.Pages "Type" $contentTypeName) }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
{{ range .Pages }}
|
||||
<div class="post on-list">
|
||||
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
||||
<div class="post-meta">
|
||||
{{ if .Date }}
|
||||
<span class="post-date">
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
|
||||
{{ if $.Site.Params.LastModDisplay }}
|
||||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author"
|
||||
>— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span
|
||||
>{{ end }}
|
||||
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time"
|
||||
>— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}">{{ . }}</a>
|
||||
<a href="{{ (urlize (printf "tags/%s" . )) | absLangURL }}/">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Cover }}
|
||||
<img src="{{ . | absURL }}" class="post-cover" />
|
||||
{{ if .Params.Cover }}
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
|
@ -31,11 +43,17 @@
|
|||
{{ . | markdownify }}
|
||||
{{ else }}
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary | markdownify }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div><a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore | default "Read more" }} →</a></div>
|
||||
{{ if not .Params.hideReadMore }}
|
||||
<div>
|
||||
<a class="read-more button" href="{{ .RelPermalink }}"
|
||||
>{{ $.Site.Params.ReadMore | default "Read more" }} →</a
|
||||
>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "pagination.html" . }}
|
||||
|
|
64
layouts/_default/rss.xml
Normal file
64
layouts/_default/rss.xml
Normal file
|
@ -0,0 +1,64 @@
|
|||
{{- $pctx := . -}}
|
||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- if or $.IsHome $.IsSection -}}
|
||||
{{- $pages = $pctx.RegularPages -}}
|
||||
{{- else -}}
|
||||
{{- $pages = $pctx.Pages -}}
|
||||
{{- end -}}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ if .Site.Params.RssImage }}<image>
|
||||
<url>{{ printf "%s%s" .Permalink .Site.Params.RssImage }}</url>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
</image>
|
||||
{{ end }}
|
||||
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>
|
||||
{{ if .Params.Cover }}
|
||||
{{ if .Params.UseRelativeCover }}{{ printf "<img src=\"%s%s\"/>" .Permalink .Params.Cover }}
|
||||
{{ else }}{{ printf "<img src=\"%s\"/>" (.Params.Cover | absURL) }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $images := .Resources.ByType "image" }}
|
||||
{{ $featured := $images.GetMatch "{*featured*,*cover*,*thumbnail*}" }}
|
||||
{{ with $featured }}{{ printf "<img src=\"%s\"/>" $featured.Permalink }}{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.RssFullText }}{{ .Content | html }}
|
||||
{{ else }}
|
||||
{{ with .Description }}{{ . | html }}
|
||||
{{ else }}{{ .Summary | html }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
|
@ -1,34 +1,63 @@
|
|||
{{ define "main" }}
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
|
||||
<div class="post">
|
||||
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<h1 class="post-title">{{ .Title | markdownify }}</h1>
|
||||
<div class="post-meta">
|
||||
{{ with .Date | default nil }}
|
||||
{{ if .Date | default nil }}
|
||||
<span class="post-date">
|
||||
{{ .Format "2006-01-02" }}
|
||||
{{ .Date.Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
|
||||
</span>
|
||||
|
||||
{{ if eq .Type $contentTypeName }}
|
||||
{{ if $.Site.Params.LastModDisplay }}
|
||||
{{ partial "lastmod.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author"
|
||||
>— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span
|
||||
>{{ end }}
|
||||
|
||||
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time"
|
||||
>— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s" . )) | absURL }}">{{ . }}</a>
|
||||
<a href="{{ (urlize (printf "tags/%s" . )) | absLangURL }}/">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Cover }}
|
||||
<img src="{{ . | absURL }}" class="post-cover" />
|
||||
{{ if .Params.Cover }}
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if or .Params.Toc $.Site.Params.Toc }}
|
||||
{{ if ne .Params.Toc false }}
|
||||
<h2>Table of Contents</h2>
|
||||
<aside class="table-of-contents">{{ .TableOfContents }}</aside>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ if eq .Type $.Site.Params.contentTypeName }}
|
||||
{{ if or .NextInSection .PrevInSection }}
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span>
|
||||
<span class="pagination__title-h"
|
||||
>{{ $.Site.Params.ReadOtherPosts | default "Read other posts" }}</span
|
||||
>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
|
@ -51,7 +80,12 @@
|
|||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not (eq .Params.Comments "false") }}
|
||||
{{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
19
layouts/_default/terms.html
Normal file
19
layouts/_default/terms.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{{ define "main" }}
|
||||
<div class="terms">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul class="terms__list">
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Permalink }}"
|
||||
>#{{ .Name }} <span class="terms__term-count">{{ $count }}</span></a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
49
layouts/archive/list.html
Normal file
49
layouts/archive/list.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
{{ define "main" }}
|
||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
||||
|
||||
<div class="archive">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ range .Site.RegularPages.GroupByPublishDate "2006" }}
|
||||
{{ if ne .Key "0001" }}
|
||||
<div class="archive__group-year">
|
||||
<h2 class="archive__group-year-header">{{ replace .Key "0001" "" }}</h2>
|
||||
{{ range .Pages.GroupByDate "January" }}
|
||||
<div class="archive__group-month">
|
||||
<h3 class="archive__group-month-header">{{ .Key }}</h3>
|
||||
<div class="archive__group-posts">
|
||||
{{ range where .Pages "Type" $contentTypeName }}
|
||||
{{ if eq .Kind "page" }}
|
||||
<div class="archive__post">
|
||||
<h3 class="archive__post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h3>
|
||||
<div class="archive__post-meta">
|
||||
<span class="archive__post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ with .Params.Author }}
|
||||
<span class="archive__post-author"
|
||||
>—
|
||||
{{ $.Site.Params.WrittenBy | default "Written by" }}
|
||||
{{ . }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="archive__post-read-time"
|
||||
>— {{ .ReadingTime }}
|
||||
{{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
|
@ -1,8 +1,7 @@
|
|||
<!--
|
||||
To add comments section, please create `layouts/partial/comments.html` in your
|
||||
To add comments section, please create `layouts/partials/comments.html` in your
|
||||
Hugo directory and insert:
|
||||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
|
||||
or whatever comment engine you want -> https://gohugo.io/content-management/comments/#readout
|
||||
-->
|
||||
or whatever comment engine you want -> https://gohugo.io/content-management/comments/#readout -->
|
||||
|
|
4
layouts/partials/extended_footer.html
Normal file
4
layouts/partials/extended_footer.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<!--
|
||||
If you want to include any custom html just before </body>, put it in /layouts/partials/extended_footer.html
|
||||
Do not put anything in this file - it's only here so that hugo won't throw an error if /layouts/partials/extended_footer.html doesn't exist.
|
||||
-->
|
4
layouts/partials/extended_head.html
Normal file
4
layouts/partials/extended_head.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<!--
|
||||
If you want to include any custom html just before </head>, put it in /layouts/partials/extended_head.html
|
||||
Do not put anything in this file - it's only here so that hugo won't throw an error if /layouts/partials/extended_head.html doesn't exist.
|
||||
-->
|
|
@ -5,8 +5,14 @@
|
|||
{{ else }}
|
||||
{{ partial "logo.html" . }}
|
||||
<div class="copyright">
|
||||
<span>© {{ now.Year }} Powered by <a href="http://gohugo.io">Hugo</a></span>
|
||||
<span>Theme created by <a href="https://twitter.com/panr">panr</a></span>
|
||||
<span
|
||||
>© {{ now.Year }} Powered by
|
||||
<a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a></span
|
||||
>
|
||||
<span
|
||||
>Theme created by
|
||||
<a href="https://twitter.com/panr" target="_blank" rel="noopener">panr</a></span
|
||||
>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -14,3 +20,5 @@
|
|||
|
||||
<script src="{{ "assets/main.js" | absURL }}"></script>
|
||||
<script src="{{ "assets/prism.js" | absURL }}"></script>
|
||||
|
||||
{{- partial "extended_footer.html" . }}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" class="greater-icon" width="44" height="44" viewBox="0 0 44 44">
|
||||
<polyline fill="none" stroke="#000" stroke-width="2" points="15 8 29.729 22.382 15 35.367"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="greater-icon" viewBox="0 0 44 44">
|
||||
<path fill="none" d="M15 8l14.729 14.382L15 35.367" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 146 B |
|
@ -1,47 +1,50 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"/>
|
||||
<meta name="keywords" content="{{ $.Site.Params.keywords }}"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"
|
||||
/>
|
||||
<meta
|
||||
name="keywords"
|
||||
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"
|
||||
/>
|
||||
<meta name="robots" content="noodp" />
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
<!-- Theme CSS -->
|
||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
|
||||
<!-- head custom -->
|
||||
{{- partial "prepended_head.html" . }}
|
||||
|
||||
<!-- Theme CSS -->
|
||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}" />
|
||||
<!-- Custom CSS to override theme properties (/static/style.css) -->
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}">
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}" />
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}">
|
||||
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}">
|
||||
<link
|
||||
rel="apple-touch-icon-precomposed"
|
||||
sizes="144x144"
|
||||
href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}"
|
||||
/>
|
||||
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link href="{{ "assets/fonts/Inter-Italic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/fonts/Inter-Regular.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/fonts/Inter-Medium.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/fonts/Inter-MediumItalic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/fonts/Inter-Bold.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
<link href="{{ "assets/fonts/Inter-BoldItalic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
|
||||
|
||||
<!-- Twitter Card -->
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ if .IsHome }}{{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ end }}" />
|
||||
<meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta name="twitter:site" content="{{ $.Site.BaseURL }}" />
|
||||
<meta name="twitter:creator" content="{{ .Params.Author }}" />
|
||||
<meta name="twitter:image" content="{{ with .Params.Cover }}{{ printf "img/%s" . | absURL }}{{ end }}">
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
||||
<!-- OG data -->
|
||||
<meta property="og:locale" content="{{ $.Site.Language.Lang }}" />
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:title" content="{{ if .IsHome }}{{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ end }}">
|
||||
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:site_name" content="{{ .Title }}" />
|
||||
<meta property="og:image" content="{{ with .Params.Cover }}{{ printf "img/%s" . | absURL }}{{ end }}">
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
{{ range .Params.categories }}<meta property="article:section" content="{{ . }}" />{{ end }}
|
||||
{{ if isset .Params "date" }}<meta property="article:published_time" content="{{ time .Date }}" />{{ end }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
|
||||
<!-- RSS -->
|
||||
{{ if .RSSLink }}
|
||||
<link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
|
||||
{{ end }}
|
||||
<!-- RSS | JSON -->
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- JSON Feed -->
|
||||
{{ if .OutputFormats.Get "json" }}
|
||||
<link href="{{ if .OutputFormats.Get "json" }}{{ "feed.json" | absURL }}{{ end }}" rel="alternate" type="application/json" title="{{ .Site.Title }}" />
|
||||
{{ end }}
|
||||
<!-- head custom -->
|
||||
{{- partial "extended_head.html" . }}
|
||||
|
|
10
layouts/partials/lastmod.html
Normal file
10
layouts/partials/lastmod.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{{ $hourInSec := 3600 }}
|
||||
|
||||
{{ if gt .Lastmod (add (time .Date).Unix $hourInSec) }}
|
||||
{{ with .Lastmod }}
|
||||
<span class="post-moddate">
|
||||
({{ $.Site.Params.LastModDisplay }}
|
||||
{{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }})
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,9 +1,15 @@
|
|||
<a href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{else}}{{ $.Site.BaseURL }}{{ end }}" class="logo" style="text-decoration: none;">
|
||||
<a
|
||||
href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{ else }}{{ $.Site.BaseURL }}{{ end }}"
|
||||
class="logo"
|
||||
style="text-decoration: none;"
|
||||
>
|
||||
{{ if $.Site.Params.Logo.path }}
|
||||
<img src="{{ $.Site.Params.Logo.path }}" alt="{{ $.Site.Params.Logo.alt }}" />
|
||||
{{ else }}
|
||||
<span class="logo__mark">{{ partial "greater-icon.html" . }}</span>
|
||||
<span class="logo__text">{{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}hello friend{{ end }}</span>
|
||||
<span class="logo__text"
|
||||
>{{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}hello friend{{ end }}</span
|
||||
>
|
||||
<span class="logo__cursor"></span>
|
||||
{{ end }}
|
||||
</a>
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
<ul class="menu__sub-inner">
|
||||
<li class="menu__sub-inner-more-trigger">
|
||||
{{ $.Site.Params.MenuMore | default "Show more" }}
|
||||
<span class="menu__sub-inner-more-trigger-icon">{{ partial "greater-icon.html" . }}</span>
|
||||
<span class="menu__sub-inner-more-trigger-icon"
|
||||
>{{ partial "greater-icon.html" . }}</span
|
||||
>
|
||||
</li>
|
||||
|
||||
<ul class="menu__sub-inner-more hidden">
|
||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
|
|
11
layouts/partials/postcover.html
Normal file
11
layouts/partials/postcover.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<figure class="post-cover">
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
||||
{{ else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.CoverCaption }}
|
||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
4
layouts/partials/prepended_head.html
Normal file
4
layouts/partials/prepended_head.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<!--
|
||||
If you want to include any custom html at the beginning of </head> before scripts or links are declared,
|
||||
put it in /layouts/partials/prepended_head.html. Do not put anything in this file - it's only here so that hugo won't throw an error if /layouts/partials/prepended_head.html doesn't exist.
|
||||
-->
|
|
@ -1,5 +1,14 @@
|
|||
<svg class="theme-toggler" width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
|
||||
<svg
|
||||
class="theme-toggler"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 48 48"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
|
||||
3C11.5066 3 3 11.5066 3 22C3 32.4934 11.5066 41 22 41ZM7 22C7
|
||||
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"/>
|
||||
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"
|
||||
/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 337 B |
15
layouts/shortcodes/code.html
Normal file
15
layouts/shortcodes/code.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ $id := delimit (shuffle (seq 1 9)) "" }}
|
||||
|
||||
{{ if .Get "language" }}
|
||||
<div class="collapsable-code">
|
||||
<input id="{{ .Get "id" | default $id }}" type="checkbox" {{ if ( eq ( .Get "isCollapsed" ) "true" ) -}} checked {{- end }} />
|
||||
<label for="{{ .Get "id" | default $id }}">
|
||||
<span class="collapsable-code__language">{{ .Get "language" }}</span>
|
||||
{{ if .Get "title" }}<span class="collapsable-code__title">{{ .Get "title" | markdownify }}</span>{{ end }}
|
||||
<span class="collapsable-code__toggle" data-label-expand="{{ .Get "expand" | default "△" }}" data-label-collapse="{{ .Get "collapse" | default "▽" }}"></span>
|
||||
</label>
|
||||
<pre {{ if .Get "language" }}class="language-{{ .Get "language" }}" {{ end }}><code>{{ .Inner | string }}</code></pre>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }}
|
||||
{{ end }}
|
|
@ -2,7 +2,7 @@
|
|||
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
|
||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
||||
{{ if .Get "caption" }}
|
||||
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" }}</figcaption>
|
||||
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
|
30
layouts/shortcodes/imgproc.html
Normal file
30
layouts/shortcodes/imgproc.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $command := .Get 1 }}
|
||||
{{ $options := .Get 2 }}
|
||||
{{ $position := .Get 3 }}
|
||||
|
||||
{{ if eq $command "Fit" }}
|
||||
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
||||
{{ else if eq $command "Resize" }}
|
||||
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
||||
{{ else if eq $command "Fill" }}
|
||||
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize." }}
|
||||
{{ end }}
|
||||
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
|
||||
<figure class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}">
|
||||
<img
|
||||
style="max-width: 100%; width: auto; height: auto; border-radius: 8px;"
|
||||
src="{{ $image.RelPermalink }}"
|
||||
width="{{ $image.Width }}"
|
||||
height="{{ $image.Height }}"
|
||||
/>
|
||||
{{ with .Inner }}
|
||||
<figcaption>
|
||||
{{ . }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
10251
package-lock.json
generated
10251
package-lock.json
generated
File diff suppressed because it is too large
Load diff
81
package.json
81
package.json
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
"name": "hello-friend",
|
||||
"version": "1.0.0",
|
||||
"version": "2.1.0",
|
||||
"main": "index.js",
|
||||
"author": "Radosław Kozieł <@panr> <radoslaw.koziel@gmail.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "webpack --mode=development --watch",
|
||||
"build": "webpack --mode=production"
|
||||
"build": "webpack --mode=production",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
|
@ -14,40 +15,48 @@
|
|||
"not dead"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.0.0-beta.54",
|
||||
"@babel/core": "^7.0.0-beta.54",
|
||||
"@babel/plugin-transform-runtime": "^7.0.0-beta.54",
|
||||
"@babel/preset-env": "^7.0.0-beta.54",
|
||||
"@babel/preset-stage-2": "^7.0.0-beta.54",
|
||||
"babel-eslint": "8.2.1",
|
||||
"babel-loader": "^8.0.0-beta.0",
|
||||
"@babel/cli": "^7.2.3",
|
||||
"@babel/core": "^7.2.2",
|
||||
"@babel/plugin-transform-runtime": "^7.2.0",
|
||||
"@babel/preset-env": "^7.3.1",
|
||||
"@babel/preset-stage-2": "^7.0.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-loader": "^8.0.5",
|
||||
"browserslist": "^4.0.1",
|
||||
"clean-webpack-plugin": "^0.1.16",
|
||||
"clipboard": "^2.0.1",
|
||||
"css-loader": "^1.0.0",
|
||||
"cssnano": "^4.0.3",
|
||||
"eslint-config-airbnb": "^17.1.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.1",
|
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
||||
"file-loader": "^1.1.11",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-browser-reporter": "^0.5.0",
|
||||
"postcss-cli": "^6.0.0",
|
||||
"postcss-import": "^11.1.0",
|
||||
"postcss-loader": "^2.0.5",
|
||||
"postcss-mixins": "^6.2.1",
|
||||
"postcss-nested": "^3.0.0",
|
||||
"postcss-preset-env": "^5.2.2",
|
||||
"postcss-reporter": "^5.0.0",
|
||||
"postcss-url": "^7.3.2",
|
||||
"prettier-eslint-cli": "^4.7.1",
|
||||
"ramda": "^0.25.0",
|
||||
"style-loader": "^0.21.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
||||
"url-loader": "^1.0.1",
|
||||
"webpack": "^4.16.1",
|
||||
"webpack-cli": "^3.1.0"
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"clipboard": "^2.0.4",
|
||||
"css-loader": "^6.5.1",
|
||||
"cssnano": "^5.0.8",
|
||||
"eslint-config-airbnb": "^18.2.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"file-loader": "^6.1.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"husky": "^7.0.4",
|
||||
"mini-css-extract-plugin": "^2.4.3",
|
||||
"postcss": "^8.2.10",
|
||||
"postcss-browser-reporter": "^0.6.0",
|
||||
"postcss-cli": "^9.0.1",
|
||||
"postcss-color-function": "^4.0.1",
|
||||
"postcss-color-mod-function": "^3.0.3",
|
||||
"postcss-import": "^14.0.0",
|
||||
"postcss-loader": "^6.2.0",
|
||||
"postcss-mixins": "^8.1.0",
|
||||
"postcss-nested": "^5.0.5",
|
||||
"postcss-preset-env": "^6.7.0",
|
||||
"postcss-reporter": "^7.0.2",
|
||||
"postcss-url": "^10.1.3",
|
||||
"prettier-eslint-cli": "^5.0.0",
|
||||
"ramda": "^0.27.1",
|
||||
"style-loader": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.2.4",
|
||||
"url-loader": "^4.1.0",
|
||||
"webpack": "^5.27.1",
|
||||
"webpack-cli": "^4.5.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-push": "yarn build && git add . && git commit --amend --no-edit"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("../fonts/Inter-Regular.woff2") format("woff2"),
|
||||
url("../fonts/Inter-Regular.woff") format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url("../fonts/Inter-Italic.woff2") format("woff2"),
|
||||
url("../fonts/Inter-Italic.woff") format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: url("../fonts/Inter-Medium.woff2") format("woff2"),
|
||||
url("../fonts/Inter-Medium.woff") format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
src: url("../fonts/Inter-MediumItalic.woff2") format("woff2"),
|
||||
url("../fonts/Inter-MediumItalic.woff") format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
src: url("../fonts/Inter-Bold.woff2") format("woff2"),
|
||||
url("../fonts/Inter-Bold.woff") format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 800;
|
||||
src: url("../fonts/Inter-BoldItalic.woff2") format("woff2"),
|
||||
url("../fonts/Inter-BoldItalic.woff") format("woff");
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
@import 'variables';
|
||||
@import 'fonts';
|
||||
@import 'buttons';
|
||||
|
||||
@import 'header';
|
||||
@import 'logo';
|
||||
@import 'menu';
|
||||
@import 'main';
|
||||
@import 'post';
|
||||
@import 'pagination';
|
||||
@import 'footer';
|
||||
|
||||
@import 'prism';
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
// Add your script here
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/assets/fonts/Inter-Bold.woff2
Normal file
BIN
static/assets/fonts/Inter-Bold.woff2
Normal file
Binary file not shown.
BIN
static/assets/fonts/Inter-BoldItalic.woff2
Normal file
BIN
static/assets/fonts/Inter-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
static/assets/fonts/Inter-Italic.woff2
Normal file
BIN
static/assets/fonts/Inter-Italic.woff2
Normal file
Binary file not shown.
BIN
static/assets/fonts/Inter-Medium.woff2
Normal file
BIN
static/assets/fonts/Inter-Medium.woff2
Normal file
Binary file not shown.
BIN
static/assets/fonts/Inter-MediumItalic.woff2
Normal file
BIN
static/assets/fonts/Inter-MediumItalic.woff2
Normal file
Binary file not shown.
BIN
static/assets/fonts/Inter-Regular.woff2
Normal file
BIN
static/assets/fonts/Inter-Regular.woff2
Normal file
Binary file not shown.
|
@ -1,136 +1 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "./source/js/index.js":
|
||||
/*!****************************!*\
|
||||
!*** ./source/js/index.js ***!
|
||||
\****************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
eval("// Add your script here\n\n\n//# sourceURL=webpack:///./source/js/index.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./source/js/menu.js":
|
||||
/*!***************************!*\
|
||||
!*** ./source/js/menu.js ***!
|
||||
\***************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
eval("\n\nvar container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar isMobileMenu = function isMobileMenu() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n menu && menu.classList.toggle(\"hidden\", isMobile());\n menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nisMobileMenu();\ndocument.body.addEventListener(\"click\", function () {\n if (!isMobile() && !menuMore.classList.contains(\"hidden\")) {\n menuMore.classList.add(\"hidden\");\n } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n menu.classList.add(\"hidden\");\n }\n});\nwindow.addEventListener(\"resize\", isMobileMenu); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle(\"hidden\");\n\n if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = \"auto\";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./source/js/theme.js":
|
||||
/*!****************************!*\
|
||||
!*** ./source/js/theme.js ***!
|
||||
\****************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
eval("\n\n// Toggle theme\nvar getTheme = window.localStorage && window.localStorage.getItem(\"theme\");\nvar themeToggle = document.querySelector(\".theme-toggle\");\nvar isDark = getTheme === \"dark\";\n\nif (getTheme !== null) {\n document.body.classList.toggle(\"dark-theme\", isDark);\n}\n\nthemeToggle.addEventListener(\"click\", function () {\n document.body.classList.toggle(\"dark-theme\");\n window.localStorage && window.localStorage.setItem(\"theme\", document.body.classList.contains(\"dark-theme\") ? \"dark\" : \"light\");\n});\n\n//# sourceURL=webpack:///./source/js/theme.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 0:
|
||||
/*!***************************************************************************!*\
|
||||
!*** multi ./source/js/index.js ./source/js/menu.js ./source/js/theme.js ***!
|
||||
\***************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
eval("__webpack_require__(/*! /Users/radek/Documents/Git/Moje/hugoBasicExampleHelloFriend/themes/hello-friend/source/js/index.js */\"./source/js/index.js\");\n__webpack_require__(/*! /Users/radek/Documents/Git/Moje/hugoBasicExampleHelloFriend/themes/hello-friend/source/js/menu.js */\"./source/js/menu.js\");\nmodule.exports = __webpack_require__(/*! /Users/radek/Documents/Git/Moje/hugoBasicExampleHelloFriend/themes/hello-friend/source/js/theme.js */\"./source/js/theme.js\");\n\n\n//# sourceURL=webpack:///multi_./source/js/index.js_./source/js/menu.js_./source/js/theme.js?");
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
!function(){var e,t,n,o,i,d,c,s,r,a,l;e=document.querySelector(".container"),t=document.querySelector(".menu"),n=document.querySelector(".menu-trigger"),document.querySelector(".menu__inner--desktop"),o=document.querySelector(".menu__sub-inner-more-trigger"),i=document.querySelector(".menu__sub-inner-more"),d=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),c=function(){return window.matchMedia(d).matches},s=function(){n&&n.classList.toggle("hidden",!c()),t&&t.classList.toggle("hidden",c()),i&&i.classList.toggle("hidden",!c())},t&&t.addEventListener("click",(function(e){return e.stopPropagation()})),i&&i.addEventListener("click",(function(e){return e.stopPropagation()})),s(),document.body.addEventListener("click",(function(){c()||!i||i.classList.contains("hidden")?c()&&!t.classList.contains("hidden")&&t.classList.add("hidden"):i.classList.add("hidden")})),window.addEventListener("resize",s),n&&n.addEventListener("click",(function(e){e.stopPropagation(),t&&t.classList.toggle("hidden")})),o&&o.addEventListener("click",(function(t){t.stopPropagation(),i&&i.classList.toggle("hidden"),i&&i.getBoundingClientRect().right>e.getBoundingClientRect().right&&(i.style.left="auto",i.style.right=0)})),r=window.localStorage&&window.localStorage.getItem("theme"),a=document.querySelector(".theme-toggle"),l="dark"===r,null!==r&&document.body.classList.toggle("dark-theme",l),a.addEventListener("click",(function(){document.body.classList.toggle("dark-theme"),window.localStorage&&window.localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")}))}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
28
theme.toml
28
theme.toml
|
@ -1,13 +1,27 @@
|
|||
name = "hello-friend"
|
||||
description = "A simple theme for Hugo. That's it."
|
||||
features = ["blog", "shortcode", "syntax Highlighting"]
|
||||
homepage = "https://github.com/panr/hugo-theme-hello-friend/"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/panr/hugo-theme-hello-friend/blob/master/LICENSE.md"
|
||||
description = "A simple theme for Hugo. That's it."
|
||||
homepage = "https://github.com/panr/hugo-theme-hello-friend/"
|
||||
tags = ["blog", "clean", "customizable", "dark", "highlighting", "light", "minimal", "monochromatic", "multilingual", "personal", "responsive", "simple", "technical"]
|
||||
features = ["blog", "shortcode", "syntax Highlighting"]
|
||||
min_version = 0.30
|
||||
min_version = 0.74
|
||||
name = "hello-friend"
|
||||
tags = [
|
||||
"blog",
|
||||
"clean",
|
||||
"customizable",
|
||||
"dark",
|
||||
"highlighting",
|
||||
"light",
|
||||
"minimal",
|
||||
"monochromatic",
|
||||
"multilingual",
|
||||
"personal",
|
||||
"responsive",
|
||||
"simple",
|
||||
"technical",
|
||||
]
|
||||
|
||||
[author]
|
||||
name = "panr"
|
||||
homepage = "https://radoslawkoziel.pl"
|
||||
name = "panr"
|
||||
twitter = "https://twitter.com/panr"
|
||||
|
|
|
@ -1,29 +1,23 @@
|
|||
const Webpack = require("webpack");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const CleanPlugin = require("clean-webpack-plugin");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const join = (...paths) => path.join(__dirname, ...paths);
|
||||
|
||||
module.exports = {
|
||||
module.exports = (env, { mode }) => ({
|
||||
resolve: {
|
||||
extensions: [".js", ".css"],
|
||||
modules: ["source", "node_modules"],
|
||||
modules: ["assets", "node_modules"],
|
||||
},
|
||||
entry: {
|
||||
"main.js": [
|
||||
join("source", "js", "index.js"),
|
||||
join("source", "js", "menu.js"),
|
||||
join("source", "js", "theme.js"),
|
||||
],
|
||||
"prism.js": join("source", "js", "prism.js"),
|
||||
"style.css": join("source", "css", "style.css"),
|
||||
main: [join("assets", "js", "menu.js"), join("assets", "js", "theme.js")],
|
||||
prism: join("assets", "js", "prism.js"),
|
||||
style: join("assets", "css", "style.css"),
|
||||
},
|
||||
output: {
|
||||
filename: "[name]",
|
||||
filename: "[name].js",
|
||||
path: join("static/assets"),
|
||||
publicPath: "",
|
||||
},
|
||||
|
@ -43,40 +37,37 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|woff|woff2|ttf|eot|svg)$/,
|
||||
use: [
|
||||
test: /\.(png|jpe?g|svg)$/,
|
||||
type: "asset/resource",
|
||||
generator: {
|
||||
filename: "images/[name][ext]",
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 8192,
|
||||
test: /\.(woff|woff2|ttf|eot)$/,
|
||||
type: "asset/resource",
|
||||
generator: {
|
||||
filename: "fonts/[name][ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
minimize: true,
|
||||
modules: true,
|
||||
importLoaders: 1,
|
||||
modules: {
|
||||
localIdentName: "[local]",
|
||||
},
|
||||
import: true,
|
||||
importLoaders: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "postcss-loader",
|
||||
options: {
|
||||
config: {
|
||||
path: "postcss.config.js",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -85,11 +76,23 @@ module.exports = {
|
|||
name: "vendor",
|
||||
minChunks: 2,
|
||||
},
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
sourceMap: true,
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
extractComments: false,
|
||||
}),
|
||||
],
|
||||
},
|
||||
plugins: [new CleanPlugin(join("static/assets")), new ExtractTextPlugin("[name]")],
|
||||
};
|
||||
plugins: [
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns: [join("static/assets")],
|
||||
cleanAfterEveryBuildPatterns: [join("static/assets/style.js")],
|
||||
verbose: true,
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
chunkFilename: "[id].css",
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue