init hugo
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build encountered an error

This commit is contained in:
Mathieu Broillet 2023-06-11 11:34:59 +02:00
parent 43c84e1df4
commit cda0c8f53d
Signed by: mathieu
GPG Key ID: A08E484FE95074C1
74 changed files with 2917 additions and 1 deletions

@ -1 +0,0 @@
Subproject commit 05c4ecfd03d75a0c96853737c01ecb538efea62c

View File

@ -0,0 +1,54 @@
---
env:
es6: true
extends:
# https://github.com/airbnb/javascript
- airbnb
- eslint:recommended
- prettier
parser: babel-eslint
rules:
# best practices
arrow-parens:
- 2
- as-needed
semi:
- 2
- never
class-methods-use-this: 0
comma-dangle:
- 2
- always-multiline
no-console:
- 2
no-unused-expressions: 0
no-param-reassign:
- 2
- props: false
no-useless-escape: 0
func-names: 0
quotes:
- 2
- single
- allowTemplateLiterals: true
no-underscore-dangle: 0
object-curly-newline: 0
function-paren-newline: 0
operator-linebreak:
- 2
- after
no-unused-vars:
- 2
- argsIgnorePattern: "^_"
globals:
document: true
requestAnimationFrame: true
window: true
self: true
fetch: true
Headers: true

2
themes/hello-friend/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
public

1
themes/hello-friend/.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn build && git add . && git commit --amend --no-edit

View File

@ -0,0 +1,11 @@
{
"parser": "babel",
"printWidth": 100,
"trailingComma": "all",
"overrides": [{
"files": ["*.html"],
"options": {
"parser": "go-template"
}
}]
}

View 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.
-->

View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2019 panr
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,310 @@
# Hello Friend
## The theme is no longer maintained, but can still be used
Even if the repository is archived you can still use the theme, fork it, download it, expand it, etc. Remember that each Hugo theme is a module that can be modified to match your needs. The theme is fully "open" and it depends only on the internal engines implemented in Hugo.
The theme brings many useful features thanks to [all people that contributed to it](https://github.com/panr/hugo-theme-hello-friend/graphs/contributors) (I want to thank you all!). At the time of archiving the theme has reached 14th place on the [official Hugo Themes list](https://themes.gohugo.io/). This is huge! Thanks to you!
----
![Hello Friend](https://github.com/panr/hugo-theme-hello-friend/blob/master/images/screenshot.png?raw=true)
### DEMO - https://hugo-hello-friend.now.sh/ <a id="demo" />
---
- [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 edit the theme](#how-to-edit)
- [Found a bug?](#bug)
- [New cool idea or feature](#feature)
- [`Hello Friend` theme user?](#hello-friend-theme-user)
- [License](#license)
## Features
- **dark/light mode**, depending on your preferences (the theme of your operating system is default, but you can change it)
- great reading experience thanks to [**Inter font**](https://rsms.me/inter/), made by [Rasmus Andersson](https://rsms.me/about/)
- nice code highlighting thanks to [**PrismJS**](https://prismjs.com)
- fully responsive
#### Built-in shortcodes
- **`image`** (prop required: **`src`**; props optional: **`alt`**, **`position`** (**left** is default | center | right), **`style`**)
- 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
By default the theme is using PrismJS to color your code syntax. All you need to do is to wrap you code like this:
<pre>
```html
// your code here
```
</pre>
**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 choose **one of the 3 possibilities** to install the theme:
1. as Hugo Module
2. as a standalone local directory
3. as a git submodule
⚠️ **The theme needs at least Hugo **Extended** v0.90.x**.
### Install theme as Hugo Module
```bash
# If this is the first time you're using Hugo Modules
# in your project. You have to initiate your own module before
# you fetch the theme module.
#
# hugo mod init [your website/module name]
hugo mod get github.com/panr/hugo-theme-hello-friend
```
and in your config file add:
```toml
[module]
# this is needed when you fetch the theme as a submodule to your repo.
# replacements = "github.com/panr/hugo-theme-hello-friend -> themes/hello-friend"
[[module.imports]]
path = 'github.com/panr/hugo-theme-hello-friend'
```
Keep in mind that the theme by default won't show up in the `themes` directory. This means that you are using the theme as it was on the repository at the moment you fetched it. Your local `go.sum` file keeps all the references. Read more about Hugo Modules in the [official documentation](https://gohugo.io/hugo-modules/).
⚠️ If you encounter any issues with:
```bash
Error: module "hello-friend" not found; either add it as a Hugo Module or store it in "[...your custom path]/themes".: module does not exist
```
then please try to remove `theme = "hello-friend"` from your config file.
### Install theme locally
```bash
git clone https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
```
This will clone the repository directly to the `themes/hello-friend` directory.
### Install theme as a submodule
```bash
git submodule add -f https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend
```
This will install the repository as a sumbodule in the `themes/hello-friend` directory.
## 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"
# Add it only if you keep the theme in the `themes` directory.
# Remove it if you use the theme as a remote Hugo Module.
theme = "hello-friend"
paginate = 5
[params]
# 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"
# OS theme is default when not provided, but you can force it to "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"
subtitle = "A simple theme for Hugo"
keywords = ""
copyright = ""
menuMore = "Show more"
writtenBy = "Written by"
readMore = "Read more"
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"
logoHomeLink = "/"
# or
#
# path = "/img/your-example-logo.svg"
# alt = "Your example logo alt text"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
[[languages.en.menu.main]]
identifier = "showcase"
name = "Showcase"
url = "/showcase"
```
to `config.toml` file in your Hugo root directory and change params fields. In case you need, here's [a YAML version](https://gist.github.com/panr/8f9b363e358aaa33f6d353c77feee959).
**NOTE:** Please keep in mind that currently main menu doesn't support nesting.
## How to add a cover image to your posts
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`:
* 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 edit the theme <a id="how-to-edit" />
If you are using as a remote Hugo Module (you don't have the theme files in the `theme/hello-friend`) and 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.
If you have the theme files in the theme directory, then you can directly edit anything in the theme, you just have to go to `themes/hello-friend` and modify the files. No compilation step needed.
## 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)! 🤗
## License
Copyright © 2019-2022 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.

View File

@ -0,0 +1,38 @@
# Meet the users of Hello Friend theme!
<!--
TEMPLATE:
- https://radoslawkoziel.pl — **Radek Kozieł** (Software designer and developer)
-->
- https://arubacao.com - **Christopher Lass** (Software Engineer and DevOps)
- https://blog.agate.pw/ - **Marco Agate** (System Engineer, DevOps)
- https://blog.lepape.me/ - **François Le Pape** (Student & developer freelance)
- 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://guilhermesteves.dev/ - **Guilherme Esteves** (Software Engineer, Writer, Speaker)
- https://hesec.de - **Patrick Hener** (Security Researcher, Pentester and Coder)
- https://imsalone.com/ - **Iancu makes stuff alone** (Indie Game Dev)
- https://jonathan.rico.live/ - **Jonathan Rico** (Electronics Engineer)
- https://kartiniteknologi.id/ - **Kartini Teknologi team** (Tech podcast)
- https://tug.ro/ - **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://www.miroslavbucek.cz - **Miroslav Buček** (Product Manager, Smart Home company owner)
- https://fmg3d.com/ - **Finn M Glas** (Aspiring Physicist, Software Developer)
- https://nali.org/ - **Nick Ali** (Marketer)
- https://abhinav031.netlify.app/ - **Abhinav Sriram** (Digital Artist, Hobbyist)
- https://codigonovato.netlify.app - **Javier Rangel** (Dev and notes)
- https://easyitblog.info/ - **Ivan Vaskevych** (Staff engineer)
- https://0days.io **Frederik Bøgeskov Krogsgaard** (Cyber & Information Security)
- https://www.paepper.com/blog/ **Marc Päpper** (Machine Learning)
- https://0days.io - **Frederik Bøgeskov Krogsgaard** (Cyber & Information Security)
- https://codejuggle.dj/ - **cornelk** (Software Engineer and DevOps)
- https://walmyrcarvalho.com.br/ - **Walmyr Carvalho** (Senior Android Engineer and Google Developer Expert)
- https://blogdoang.com — **Abdul Aziz** (Cloud Architect, DevOps)
- https://4strodev.com - **4strodev** (Backend developer working as fullstack :P)
- https://blog.vmichalak.com/ - **Valentin Michalak** (Software Engineer)

View 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;
}
}
}
}

View File

@ -0,0 +1,98 @@
.button-container {
display: table;
margin-left: auto;
margin-right: auto;
}
button,
.button,
a.button {
position: relative;
display: flex;
align-items: center;
justify-content: center;
padding: 8px 18px;
margin-bottom: 5px;
background: var(--background-secondary);
text-decoration: none;
text-align: center;
font-weight: 500;
border-radius: 8px;
border: 1px solid transparent;
appearance: none;
cursor: pointer;
outline: none;
/* variants */
&.outline {
background: transparent;
border-color: var(--background-secondary);
box-shadow: none;
padding: 8px 18px;
:hover {
transform: none;
box-shadow: none;
}
}
&.primary {
box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
&:hover {
box-shadow: 0 2px 6px rgba(50, 50, 93, .21), 0 1px 3px rgba(0, 0, 0, .08);
}
}
&.link {
background: none;
font-size: 1rem;
}
/* sizes */
&.small {
font-size: .8rem;
}
&.wide {
min-width: 200px;
padding: 14px 24px;
}
}
a.read-more,
a.read-more:hover,
a.read-more:active {
display: inline-flex;
background: none;
box-shadow: none;
padding: 0;
margin: 20px 0;
font-weight: bold;
}
.code-toolbar {
margin-bottom: 20px;
.toolbar-item a {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 3px 8px;
margin-bottom: 5px;
background: var(--background-secondary);
text-decoration: none;
text-align: center;
font-size: 13px;
font-weight: 500;
border-radius: 8px;
border: 1px solid transparent;
appearance: none;
cursor: pointer;
outline: none;
}
}

View 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;
}
}

View 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;
}

View File

@ -0,0 +1,51 @@
.footer {
padding: 40px 20px;
flex-grow: 0;
color: var(--color-secondary);
&__inner {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 auto;
width: 760px;
max-width: 100%;
@media ($tablet) {
flex-direction: column;
}
}
a {
color: inherit;
}
.copyright {
display: flex;
flex-direction: row;
align-items: center;
font-size: 1rem;
&--user {
margin: auto;
text-align: center;
}
& > *:first-child:not(:only-child) {
border-right: 1px solid;
padding-right: 10px;
margin-right: 10px;
@media ($tablet) {
border: none;
padding: 0;
margin: 0;
}
}
@media ($tablet) {
flex-direction: column;
margin-top: 10px;
}
}
}

View File

@ -0,0 +1,39 @@
.header {
background: var(--header);
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: 20px;
&__right {
display: flex;
flex-direction: row;
align-items: center;
@media ($phone) {
flex-direction: row-reverse;
}
}
&__inner {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 auto;
width: 760px;
max-width: 100%;
}
}
.theme-toggle {
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
cursor: pointer;
}
.theme-toggler {
fill: currentColor;
}

View File

@ -0,0 +1,39 @@
.logo {
display: flex;
align-items: center;
flex: 0 0 auto;
text-decoration: none;
font-weight: bold;
img {
height: 44px;
}
&__mark {
display: inline-flex;
align-items: center;
margin-right: 5px;
@include greater-icon(8px);
}
&__text {
font-size: 1.125rem;
}
&__cursor {
display: inline-block;
width: 10px;
height: 1rem;
background: #fe5186;
margin-left: 5px;
border-radius: 1px;
animation: cursor 1s infinite;
}
}
@keyframes cursor {
0% { opacity: 0; }
50% { opacity: 1; }
100% { opacity: 0; }
}

View File

@ -0,0 +1,304 @@
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin: 0;
padding: 0;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif;
font-size: 1rem;
font-weight: 500;
font-feature-settings: "liga", "tnum", "case", "calt", "zero", "ss01", "locl";
line-height: 1.54;
background-color: var(--background);
color: var(--color);
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
-webkit-text-size-adjust: 100%;
@media ($phone) {
font-size: 1rem;
}
}
h1, h2, h3, h4, h5, h6 {
line-height: 1.3;
}
h1 {
font-size: 2.625rem;
}
h2 {
font-size: 1.625rem;
}
h3 {
font-size: 1.375rem;
}
h4 {
font-size: 1.125rem;
}
@media ($phone) {
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.4rem;
}
h3 {
font-size: 1.15rem;
}
h4 {
font-size: 1.125rem;
}
}
a {
color: inherit;
}
img {
display: block;
max-width: 100%;
&.left {
margin-right: auto;
}
&.center {
margin-left: auto;
margin-right: auto;
}
&.right {
margin-left: auto;
}
}
figure {
display: table;
max-width: 100%;
margin: 25px 0;
&.left {
margin-right: auto;
}
&.center {
margin-left: auto;
margin-right: auto;
}
&.right {
margin-left: auto;
}
figcaption {
font-size: .9rem;
margin-top: 5px;
opacity: .8;
&.left {
text-align: left;
}
&.center {
text-align: center;
}
&.right {
text-align: right;
}
}
}
code, kbd {
font-family: Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;
background: var(--background-secondary);
padding: 1px 6px;
margin: 0 2px;
border-radius: 5px;
font-size: .9em;
font-weight: normal;
font-feature-settings: normal;
code, kbd {
background: transparent;
padding: 0;
margin: 0;
}
}
pre {
font-feature-settings: normal;
background: #212020;
padding: 20px;
border-radius: 8px;
font-size: .9rem;
overflow: auto;
@media ($phone) {
white-space: pre-wrap;
word-wrap: break-word;
}
code {
font-feature-settings: normal;
background: none !important;
color: #ccc;
margin: 0;
padding: 0;
font-size: inherit;
}
}
blockquote {
border-left: 2px solid;
margin: 40px;
padding: 10px 20px;
@media ($phone) {
margin: 10px;
padding: 10px;
}
&:before {
content: '';
font-family: Georgia, serif;
font-size: 3.875rem;
position: absolute;
left: -40px;
top: -20px;
}
p:first-of-type {
margin-top: 0;
}
p:last-of-type {
margin-bottom: 0;
}
}
/* Fix for gist integration */
table:not(.js-file-line-container) {
table-layout: fixed;
border-collapse: collapse;
width: 100%;
margin: 40px 0;
border-radius: 5px;
}
/* Fix for gist integration */
table, th, td:not(.js-line-number) {
border: 1px solid;
padding: 10px;
}
th {
background: var(--background-secondary);
}
ul, ol {
margin-left: 40px;
padding: 0;
@media ($phone) {
margin-left: 20px;
}
}
ol ol {
list-style-type: lower-alpha;
}
.container {
display: flex;
flex-direction: column;
justify-content: center;
}
.content {
display: flex;
flex-direction: column;
flex: 1 auto;
align-items: center;
justify-content: center;
margin: 50px 0;
@media ($phone) {
margin-top: 0;
}
}
hr {
width: 100%;
border: none;
background: var(--border-color);
height: 1px;
}
.hidden {
display: none;
}
.framed {
padding: 50px;
margin: 0 -50px 40px;
border-radius: 10px;
border: 1px solid var(--border-color);
width: 100%;
max-width: 860px;
@media ($tablet) {
width: auto;
max-width: 680px;
margin: 20px 20px 40px;
padding: 30px;
}
}
blockquote.twitter-tweet {
background: hsla(206deg, 62%, 45%, 0.1);
border: none;
padding: 30px;
color: inherit;
font-size: inherit;
line-height: inherit;
border-radius: 8px;
}
.h-anchor {
margin-left: 1px;
color: var(--color-secondary);
text-decoration: none;
visibility: hidden;
opacity: 0;
transition: visibility 0s linear 0.1s, opacity 0.1s linear;
}
h1:hover a,
h2:hover a,
h3:hover a,
h4:hover a {
visibility: visible;
opacity: 1;
transition-delay: 0s;
}
.framed .h-anchor {
visibility: hidden;
}

View File

@ -0,0 +1,136 @@
@mixin menu {
position: absolute;
background: var(--header);
box-shadow: var(--shadow);
margin: 0;
padding: 5px;
list-style: none;
border-radius: 5px;
z-index: 99;
}
.menu {
--color: rgba(0, 0, 0, .12);
--shadow: 0 8px 20px var(--color);
border-right: 1px solid;
margin-right: 18px;
padding-right: 24px;
font-weight: 500;
@media ($phone) {
@include menu;
border: none;
top: 50px;
right: 10px;
}
a {
text-decoration: none;
}
&__inner {
display: flex;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
list-style: none;
margin: 0;
padding: 0;
&--desktop {
@media ($phone) {
display: none;
}
}
&--mobile {
display: none;
@media ($phone) {
display: block;
}
}
li {
text-align: left;
flex: 0 0 auto;
&:not(:first-of-type) {
margin-left: 20px;
}
}
@media ($phone) {
flex-direction: column;
align-items: flex-start;
padding: 0;
li {
margin-left: 0 !important;
padding: 10px;
}
}
}
&__sub-inner {
position: relative;
list-style: none;
padding: 0;
margin: 0;
&:not(:only-child) {
margin-left: 20px;
}
&-more {
@include menu;
top: 35px;
left: 0;
&-trigger {
display: inline-flex;
align-items: center;
user-select: none;
cursor: pointer;
&-icon {
display: inline-flex;
align-items: center;
margin-left: 3px;
transform: rotate(90deg);
line-height: 1;
@include greater-icon(5px);
}
}
li {
.menu__inner & {
margin-left: 0;
white-space: nowrap;
&:hover {
background: rgba(0, 0, 0, 0.05);
border-radius: 3px;
cursor: pointer;
}
}
}
li a {
width: 100%;
display: inline-block;
padding: 10px;
}
}
}
&-trigger {
width: 24px;
height: 24px;
fill: currentColor;
margin-left: 10px;
cursor: pointer;
}
}

View File

@ -0,0 +1,85 @@
.pagination {
margin-top: 50px;
&__title {
display: flex;
text-align: center;
position: relative;
margin: 100px 0 20px;
&-h {
text-align: center;
margin: 0 auto;
padding: 5px 10px;
background: var(--background);
color: var(--color-secondary);
font-size: .8rem;
text-transform: uppercase;
text-decoration: none;
letter-spacing: .1em;
z-index: 1;
}
hr {
position: absolute;
left: 0;
right: 0;
width: 100%;
margin-top: 15px;
z-index: 0;
}
}
&__buttons {
display: flex;
align-items: center;
justify-content: center;
a {
text-decoration: none;
font-weight: bold;
}
}
}
.button {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
background: var(--background-secondary);
font-size: 1rem;
font-weight: 500;
border-radius: 8px;
max-width: 40%;
padding: 0;
cursor: pointer;
appearance: none;
+ .button {
margin-left: 10px;
}
a {
display: flex;
padding: 8px 16px;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
&__text {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
&.next .button__icon {
margin-left: 8px;
}
&.previous .button__icon {
margin-right: 8px;
}
}

View File

@ -0,0 +1,85 @@
.post {
width: 100%;
max-width: 800px;
text-align: left;
padding: 20px;
margin: 20px auto;
@media ($tablet) {
max-width: 660px;
}
&:not(:last-of-type) {
border-bottom: 1px solid var(--border-color);
}
&-meta {
font-size: 1rem;
margin-bottom: 10px;
@media ($phone) {
font-size: .85rem;
}
}
&-title {
font-size: 2.625rem;
margin: 0 0 20px;
@media ($phone) {
font-size: 2rem;
}
a {
text-decoration: none;
}
}
&-tags {
display: block;
margin-bottom: 20px;
font-size: 1rem;
opacity: .5;
a {
text-decoration: none;
}
}
&-content {
margin-top: 30px;
}
&-cover {
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;
width: 100%;
}
}
}
.post--regulation {
h1 {
justify-content: center;
}
h2 {
justify-content: center;
margin-bottom: 10px;
&+ h2 {
margin-top: -10px;
margin-bottom: 20px;
}
}
}

View File

@ -0,0 +1,259 @@
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+actionscript+apacheconf+applescript+c+csharp+bash+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+sql+processing+scss+python+jsx+typescript+reason+textile+rust+sass+stylus+scheme+pug+swift+yaml+haml+toml+twig+tsx+vim+visual-basic+wasm&plugins=line-numbers+toolbar+jsonp-highlight+command-line+copy-to-clipboard */
/**
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/chriskempson/tomorrow-theme
* @author Rose Pritchard
*/
code[class*="language-"],
pre[class*="language-"] {
background: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
/* line-height: 1.5; */
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #212020 !important;
color: inherit !important;
border-radius: 8px;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: rgba(255, 255, 255, .4);
}
.token.punctuation {
color: #a9a9b3;
}
.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
color: #e2777a;
}
.token.function-name {
color: #6196cc;
}
.token.boolean,
.token.number,
.token.function {
color: #f08d49;
}
.token.property,
.token.class-name,
.token.constant,
.token.symbol {
color: #f8c555;
}
.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
color: #cc99cd;
}
.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
color: #7ec699;
}
.token.operator,
.token.entity,
.token.url {
color: #67cdcc;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.inserted {
color: green;
}
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
div.code-toolbar {
position: relative;
}
div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}
div.code-toolbar:hover > .toolbar {
opacity: 1;
}
div.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}
div.code-toolbar > .toolbar a {
cursor: pointer;
}
div.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}
div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
border-radius: .5em;
}
div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}
.command-line-prompt {
border-right: 1px solid #999;
display: block;
float: left;
font-size: 100%;
letter-spacing: -1px;
margin-right: 1em;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.command-line-prompt > span:before {
color: #999;
content: ' ';
display: block;
padding-right: 0.8em;
}
.command-line-prompt > span[data-user]:before {
content: "[" attr(data-user) "@" attr(data-host) "] $";
}
.command-line-prompt > span[data-user="root"]:before {
content: "[" attr(data-user) "@" attr(data-host) "] #";
}
.command-line-prompt > span[data-prompt]:before {
content: attr(data-prompt);
}

View File

@ -0,0 +1,18 @@
@import 'variables';
@import 'fonts';
@import 'buttons';
@import 'header';
@import 'logo';
@import 'menu';
@import 'main';
@import 'post';
@import 'pagination';
@import 'footer';
@import 'terms';
@import 'archive';
@import 'prism';
@import 'code';

View 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;
}
}
}

View File

@ -0,0 +1,69 @@
body.light-theme, :root {
/* light theme color */
--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: #121212;
--background-secondary: #1e1e1e;
--header: #0f0f0f;
--color: #bdc1c6;
--color-secondary: #666666;
--border-color: #232323;
}
@media (prefers-color-scheme: light) {
body:not(.dark-theme) {
/* light theme color */
--background: #fff;
--background-secondary: #eaeaea;
--header: #fafafa;
--color: #222;
--color-secondary: #999;
--border-color: #dcdcdc;
}
}
@media (prefers-color-scheme: dark) {
body:not(.light-theme) {
/* dark theme colors */
--background: #121212;
--background-secondary: #1e1e1e;
--header: #0f0f0f;
--color: #bdc1c6;
--color-secondary: #666666;
--border-color: #232323;
}
}
/* MEDIA QUERIES */
$phone: "max-width: 684px";
$tablet: "max-width: 900px";
@mixin greater-icon($stroke-width: 3px, $width: .95rem, $height: 100%) {
.greater-icon {
width: $width;
height: $height;
path {
stroke: currentColor;
stroke-width: $stroke-width;
}
}
}
/* HOW TO USE */
/*@media ($phone) {*/
/*margin-top: 0;*/
/*}*/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,54 @@
const container = document.querySelector(".container");
const menu = document.querySelector(".menu");
const mobileMenuTrigger = document.querySelector(".menu-trigger");
const desktopMenu = document.querySelector(".menu__inner--desktop");
const desktopMenuTrigger = document.querySelector(".menu__sub-inner-more-trigger");
const menuMore = document.querySelector(".menu__sub-inner-more");
const mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth");
const isMobile = () => window.matchMedia(mobileQuery).matches;
const isMobileMenu = () => {
mobileMenuTrigger && mobileMenuTrigger.classList.toggle("hidden", !isMobile());
menu && menu.classList.toggle("hidden", isMobile());
menuMore && menuMore.classList.toggle("hidden", !isMobile());
};
// Common
menu && menu.addEventListener("click", e => e.stopPropagation());
menuMore && menuMore.addEventListener("click", e => e.stopPropagation());
isMobileMenu();
document.body.addEventListener("click", () => {
if (!isMobile() && menuMore && !menuMore.classList.contains("hidden")) {
menuMore.classList.add("hidden");
} else if (isMobile() && !menu.classList.contains("hidden")) {
menu.classList.add("hidden");
}
});
window.addEventListener("resize", isMobileMenu);
// Mobile menu
mobileMenuTrigger &&
mobileMenuTrigger.addEventListener("click", e => {
e.stopPropagation();
menu && menu.classList.toggle("hidden");
});
// Desktop menu
desktopMenuTrigger &&
desktopMenuTrigger.addEventListener("click", e => {
e.stopPropagation();
menuMore && menuMore.classList.toggle("hidden");
if (
menuMore &&
menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right
) {
menuMore.style.left = "auto";
menuMore.style.right = 0;
}
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,31 @@
// Toggle theme
const localTheme = window.localStorage && window.localStorage.getItem("theme");
const themeToggle = document.querySelector(".theme-toggle");
if (localTheme) {
document.body.classList.remove("light-theme", "dark-theme");
document.body.classList.add(localTheme);
}
themeToggle.addEventListener("click", () => {
const themeUndefined = !new RegExp("(dark|light)-theme").test(document.body.className);
const isOSDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
if (themeUndefined) {
if (isOSDark) {
document.body.classList.add("light-theme");
} else {
document.body.classList.add("dark-theme");
}
} else {
document.body.classList.toggle("light-theme");
document.body.classList.toggle("dark-theme");
}
window.localStorage &&
window.localStorage.setItem(
"theme",
document.body.classList.contains("dark-theme") ? "dark-theme" : "light-theme",
);
});

View 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,
};
};

View File

View File

@ -0,0 +1,3 @@
module github.com/panr/hugo-theme-hello-friend
go 1.19

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

View 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." | markdownify }}
</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 }}

View File

@ -0,0 +1,4 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
{{ .Text | safeHTML }}
<a href="#{{ .Anchor | safeURL }}" class="h-anchor" aria-hidden="true">#</a>
</h{{ .Level }}>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<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>
{{ end }}
{{ partial "head.html" . }}
</head>
<body {{ with $.Site.Params.defaultTheme -}} class="{{ printf "%s-theme" . }}" {{- end }}>
<div class="container">
{{ partial "header.html" . }}
<div class="content">
{{ block "main" . }} {{ end }}
</div>
{{ block "footer" . }}
{{ partial "footer.html" . }}
{{ end }}
</div>
{{ if $.Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
</body>
</html>

View 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 }}
<article class="post on-list">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
{{ if .Date }}
<time class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</time>
{{ 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>&nbsp;
{{ 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 }}
</article>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}

View File

@ -0,0 +1,61 @@
{{ define "main" }}
<div class="posts">
{{ range .Pages }}
<article class="post on-list">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
{{ if .Date }}
<time class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</time>
{{ 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>&nbsp;
{{ 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 }}
</article>
{{ end }}
{{ partial "pagination.html" . }}
</div>
{{ end }}

View 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>

View File

@ -0,0 +1,91 @@
{{ define "main" }}
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
<article class="post">
<h1 class="post-title">{{ .Title | markdownify }}</h1>
<div class="post-meta">
{{ if .Date | default nil }}
<time class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
</time>
{{ 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 }}
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
<a href="{{ (urlize (printf "tags/%s" . )) | absLangURL }}/">#{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ 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
>
<hr />
</div>
<div class="pagination__buttons">
{{ if .NextInSection }}
<span class="button previous">
<a href="{{ .NextInSection.Permalink }}">
<span class="button__icon"></span>
<span class="button__text">{{ .NextInSection.Title }}</span>
</a>
</span>
{{ end }}
{{ if .PrevInSection }}
<span class="button next">
<a href="{{ .PrevInSection.Permalink }}">
<span class="button__text">{{ .PrevInSection.Title }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
{{ if not (eq .Params.Comments "false") }}
{{ if or (eq .Type $.Site.Params.contentTypeName) (.Params.Comments) }}
{{ partial "comments.html" . }}
{{ end }}
{{ end }}
</article>
{{ end }}

View 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 }}

View 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" }}
<article class="archive__post">
<h3 class="archive__post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h3>
<div class="archive__post-meta">
<time class="archive__post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</time>
{{ 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>
</article>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
{{ end }}
</div>
{{ end }}

View File

@ -0,0 +1,10 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>

View File

@ -0,0 +1,7 @@
<!--
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 -->

View 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.
-->

View 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.
-->

View File

@ -0,0 +1,21 @@
<footer class="footer">
<div class="footer__inner">
{{ if $.Site.Copyright }}
<div class="copyright copyright--user">{{ $.Site.Copyright | safeHTML }}</div>
{{ else }}
{{ partial "logo.html" . }}
<div class="copyright">
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a></span>
<span><a href="https://github.com/panr/hugo-theme-hello-friend" target="_blank">Theme</a> made by <a href="https://github.com/panr" target="_blank">panr</a></span>
</div>
{{ end }}
</div>
</footer>
{{ $menu := resources.Get "js/menu.js" | js.Build }}
{{ $prism := resources.Get "js/prism.js" | js.Build }}
{{ $theme := resources.Get "js/theme.js" | js.Build }}
{{ $bundle := slice $menu $prism $theme | resources.Concat "bundle.js" | resources.Minify }}
<script type="text/javascript" src="{{ $bundle.RelPermalink }}"></script>
{{- partial "extended_footer.html" . }}

View File

@ -0,0 +1,3 @@
<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>

After

Width:  |  Height:  |  Size: 146 B

View File

@ -0,0 +1,48 @@
<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 }}" />
<!-- head custom -->
{{- partial "prepended_head.html" . }}
<!-- Theme CSS -->
{{ $res := resources.Get "css/style.scss" }}
{{ $style := $res | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
<!-- Custom CSS to override theme properties (/static/style.css) -->
<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 }}" />
<!-- Fonts -->
<link href="{{ (resources.Get "fonts/Inter-Italic.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<link href="{{ (resources.Get "fonts/Inter-Regular.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<link href="{{ (resources.Get "fonts/Inter-Medium.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<link href="{{ (resources.Get "fonts/Inter-MediumItalic.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<link href="{{ (resources.Get "fonts/Inter-Bold.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<link href="{{ (resources.Get "fonts/Inter-BoldItalic.woff2").RelPermalink }}" rel="preload" type="font/woff2" as="font" crossorigin="">
<!-- Twitter Card -->
{{ template "_internal/twitter_cards.html" . }}
<!-- OG data -->
{{ template "_internal/opengraph.html" . }}
<!-- RSS | JSON -->
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}
<!-- head custom -->
{{- partial "extended_head.html" . }}

View File

@ -0,0 +1,19 @@
<header class="header">
<span class="header__inner">
{{ partial "logo.html" . }}
<span class="header__right">
{{ if len $.Site.Menus }}
{{ partial "menu.html" . }}
<span class="menu-trigger">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none" />
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</span>
{{ end }}
<span class="theme-toggle">
{{ partial "theme-icon.html" . }}
</span>
</span>
</span>
</header>

View 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 }}

View File

@ -0,0 +1,15 @@
<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__cursor"></span>
{{ end }}
</a>

View File

@ -0,0 +1,42 @@
<nav class="menu">
<ul class="menu__inner menu__inner--desktop">
{{ if or $.Site.Params.showMenuItems (eq $.Site.Params.showMenuItems 0) }}
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
<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
>
</li>
<ul class="menu__sub-inner-more hidden">
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
</ul>
</ul>
{{ end }}
{{ else }}
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
<ul class="menu__inner menu__inner--mobile">
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ end }}
</ul>
</nav>

View File

@ -0,0 +1,20 @@
<div class="pagination">
<div class="pagination__buttons">
{{ if .Paginator.HasPrev }}
<span class="button previous">
<a href="{{ .Paginator.Prev.URL }}">
<span class="button__icon"></span>
<span class="button__text">{{ $.Site.Params.NewerPosts | default "Newer posts" }}</span>
</a>
</span>
{{ end }}
{{ if .Paginator.HasNext }}
<span class="button next">
<a href="{{ .Paginator.Next.URL }}">
<span class="button__text">{{ $.Site.Params.OlderPosts | default "Older posts" }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>

View 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>

View 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.
-->

View File

@ -0,0 +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
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"
/>
</svg>

After

Width:  |  Height:  |  Size: 337 B

View 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 }}

View File

@ -0,0 +1,8 @@
{{ if .Get "src" }}
<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" | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}

View File

@ -0,0 +1,3 @@
{{ if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
{{ end }}

View 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>

View File

@ -0,0 +1,44 @@
{
"name": "hello-friend",
"version": "3.0.0",
"main": "index.js",
"author": "Radosław Kozieł <@panr> <radoslaw.koziel@gmail.com>",
"license": "MIT",
"scripts": {
"test": "echo 'Test'"
},
"browserslist": [
"last 2 versions",
">1%",
"not dead"
],
"comments": {
"dependencies": {
"yarn": "project"
},
"devDependencies": {
"browserslist": "project",
"clipboard": "project",
"eslint-config-airbnb": "project",
"eslint-config-prettier": "project",
"eslint-plugin-jsx-a11y": "project",
"husky": "project"
}
},
"dependencies": {
"yarn": "^1.22.10"
},
"devDependencies": {
"browserslist": "^4.16.5",
"clipboard": "^2.0.4",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"husky": "^5.1.3"
},
"husky": {
"hooks": {
"pre-push": "yarn build && git add . && git commit --amend --no-edit"
}
}
}

View File

@ -0,0 +1,44 @@
{
"name": "hello-friend",
"version": "3.0.0",
"main": "index.js",
"author": "Radosław Kozieł <@panr> <radoslaw.koziel@gmail.com>",
"license": "MIT",
"scripts": {
"test": "echo 'Test'"
},
"browserslist": [
"last 2 versions",
">1%",
"not dead"
],
"comments": {
"dependencies": {
"yarn": "project"
},
"devDependencies": {
"browserslist": "project",
"clipboard": "project",
"eslint-config-airbnb": "project",
"eslint-config-prettier": "project",
"eslint-plugin-jsx-a11y": "project",
"husky": "project"
}
},
"dependencies": {
"yarn": "^1.22.10"
},
"devDependencies": {
"browserslist": "^4.16.5",
"clipboard": "^2.0.4",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"husky": "^5.1.3"
},
"husky": {
"hooks": {
"pre-push": "yarn build && git add . && git commit --amend --no-edit"
}
}
}

View File

@ -0,0 +1,24 @@
const url = require("postcss-url");
const imports = require("postcss-import");
const nested = require("postcss-nested");
const postcssCustomMedia = require("postcss-custom-media");
const postCSSPresetEnv = require("postcss-preset-env");
const browsers = require("browserslist");
const cssnano = require("cssnano");
const mixins = require("postcss-mixins");
module.exports = () => ({
plugins: [
url,
imports,
mixins,
nested,
postcssCustomMedia,
postCSSPresetEnv({
stage: 1,
}),
cssnano({
preset: "default",
}),
],
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

View File

@ -0,0 +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"
min_version = 0.90
tags = [
"blog",
"clean",
"customizable",
"dark",
"highlighting",
"light",
"minimal",
"monochromatic",
"multilingual",
"personal",
"responsive",
"simple",
"technical",
]
[author]
homepage = "https://radoslawkoziel.pl"
name = "panr"
twitter = "https://twitter.com/panr"