Skip to content

Commit

Permalink
Bring in the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jan 27, 2024
1 parent cbc97fd commit 3807859
Show file tree
Hide file tree
Showing 80 changed files with 5,195 additions and 0 deletions.
1 change: 1 addition & 0 deletions themes/paper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
8 changes: 8 additions & 0 deletions themes/paper/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/images
/static

.git*
*.toml
.prettierignore
LICENSE
yarn.lock
6 changes: 6 additions & 0 deletions themes/paper/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
singleQuote: true,

// https://github.com/tailwindlabs/prettier-plugin-tailwindcss
plugins: ['prettier-plugin-tailwindcss'],
};
2 changes: 2 additions & 0 deletions themes/paper/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
assets/main.css
12 changes: 12 additions & 0 deletions themes/paper/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
extends: ['stylelint-config-one'],
rules: {
'function-no-unknown': null,
'function-url-quotes': null,
'color-function-notation': null,
'no-descending-specificity': null,
'comment-empty-line-before': null,
'comment-whitespace-inside': null,
'custom-property-empty-line-before': null,
},
};
21 changes: 21 additions & 0 deletions themes/paper/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 南小北

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.
143 changes: 143 additions & 0 deletions themes/paper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
```
Imported from nanxiaobei/hugo-paper at 3586c85b77248312ccdd82f9e450cc91f4152a6c as MIT
https://github.com/nanxiaobei/hugo-paper/tree/3586c85b77248312ccdd82f9e450cc91f4152a6c
```

You can see the license in this folder! We want to really make some deep changes and at that point we might
as well have a hard fork of this theme instead of making a million overrides which make it impossible to update
from upstream

./orta

----------------

<div align="center">
<p><a href="https://kee.so/" target="_blank"><img src="https://i.imgur.com/x5SRUoo.png" alt="kee.so" /></a></p>

Create now ➫ [🔗 kee.so](https://kee.so/)

</div>

---

<div align="center">
<h1>Paper <sup><sup><sub>6.24</sub></sup></sup></h1>

Demo → [hugo-paper.vercel.app](https://hugo-paper.vercel.app/)

A simple, clean, customizable Hugo theme.

⚡️ Fast | 👒 Customizable | 🫙 Smooth

</div>

## Links

Product Hunt: [producthunt.com/posts/hugo-paper-6](https://www.producthunt.com/posts/hugo-paper-6)

Hugo themes: [themes.gohugo.io/hugo-paper](https://themes.gohugo.io/hugo-paper/)

## Overview

![](./images/screenshot.png)
![](./images/screenshot_dark.png)
![](./images/screenshot_mobile.png)
![](./images/pagespeed.png)

## Options

Available options to `config.toml` or `hugo.toml`:

```toml
disqusShortname = 'YOUR_DISQUS_SHORTNAME' # use disqus comments

[params]
# color style
color = 'linen' # linen, wheat, gray, light

# header social icons
twitter = 'YOUR_TWITTER_ID' # twitter.com/YOUR_TWITTER_ID
github = 'YOUR_GITHUB_ID' # github.com/YOUR_GITHUB_ID
instagram = 'YOUR_INSTAGRAM_ID' # instagram.com/YOUR_INSTAGRAM_ID
linkedin = 'YOUR_LINKEDIN_ID' # linkedin.com/in/YOUR_LINKEDIN_ID
mastodon = 'YOUR_MASTODON_LINK' # e.g. 'https://mastodon.instance/@xxx'
rss = true # show rss icon

# home page profile
avatar = 'GRAVATAR_EMAIL' # gravatar email or image url
name = 'YOUR_NAME'
bio = 'YOUR_BIO'


# misc
disableHLJS = true # disable highlight.js
disablePostNavigation = true # disable post navigation
monoDarkIcon = true # show monochrome dark mode icon
gravatarCdn = 'GRAVATAR_CDN_LINK' # e.g. 'https://cdn.v2ex.com/gravatar/'
graphCommentId = "YOUR_GRAPH_COMMENT_ID" # use graph comment (disqus alternative)
math = true # enable KaTeX math typesetting globally

# giscus
[params.giscus]
repo = 'YOUR_GISCUS_REPO' # see https://giscus.app for more details
repoId = 'YOUR_GISCUS_REPO_ID'
category = 'YOUR__GISCUS_CATEGORY'
categoryId = 'YOUR_GISCUS_CATEGORY_ID'
mapping = 'pathname'
theme = 'light'
lang = 'zh-CN'
```

Available options to front matter:

```toml
comments = false # disable comments for a specific page
math = true # enable KaTeX math typesetting for a specific page
```

## Install

### As hugo module

Inside the folder of your Hugo project, run:

```bash
hugo mod init github.com/<USERNAME>/<REPONAME>
```

Add paper theme ad dependency of your site:

```bash
hugo mod init github.com/<USERNAME>/<REPONAME>
```

Open `config.toml` or `hugo.toml`, remove the `theme` line (if present) and add module section at the bottom of the file:

```toml
[module]
[[module.imports]]
path = "github.com/nanxiaobei/hugo-paper"
```

For more information, please read the [official guide](https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme) of Hugo.

### As git submodule

Inside the folder of your Hugo project, run:

```bash
git submodule add https://github.com/nanxiaobei/hugo-paper themes/paper
```

Open `config.toml` or `hugo.toml`, change `theme` to `"paper"`:

```toml
theme = "paper"
```

For more information, please read the [official guide](https://gohugo.io/getting-started/quick-start/#configure-the-site) of Hugo.

## License

[MIT License](https://github.com/nanxiaobei/hugo-paper/blob/main/LICENSE) (c) [nanxiaobei](https://lee.so/)
121 changes: 121 additions & 0 deletions themes/paper/assets/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* Paper
* A simple, clean, flexible Hugo theme
* https://github.com/nanxiaobei/hugo-paper
* Designed by 南小北 https://lee.so/
*/

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
html,
body {
@apply h-full;
}

html {
--bg: transparent;
}

body {
-webkit-tap-highlight-color: transparent;
background: var(--bg);

@apply dark:bg-black/90;
}
}

@layer components {
.btn {
@apply rounded-full bg-black px-7 py-4 text-sm text-white no-underline shadow duration-100 active:scale-95 dark:bg-white dark:text-black;
}

.link {
@apply duration-200 hover:text-black dark:hover:text-white;
}
}

@layer utilities {
.not-ready * {
@apply !transition-none;
}

.btn-menu::before,
.btn-menu::after {
@apply block h-[2px] w-5 bg-black duration-200 content-[''] dark:invert;
}

.nav-wrapper {
background: var(--bg);
}

.open {
@apply overflow-hidden;
}

.open .btn-menu::before {
@apply w-6 translate-y-[5.5px] rotate-45;
}

.open .btn-menu::after {
@apply w-6 -translate-y-[5.5px] -rotate-45;
}

.open .nav-wrapper {
@apply top-0;
}

article {
@apply text-lg leading-[1.8] text-black dark:text-white;
}

article blockquote {
@apply !border-l-[3px] !border-black dark:!border-white;
}

article code {
@apply inline-block !text-sm !leading-6;
}

article .highlight {
@apply my-8;
}

article .highlight pre {
@apply my-0;
}

article .highlight > div {
@apply rounded-md bg-[--tw-prose-pre-bg];
}

article .highlight > div table {
@apply my-0 table-fixed;
}

article .highlight > div table tr {
@apply flex;
}

article .highlight > div table tr td {
@apply p-0;
}

article .highlight > div table tr td pre {
@apply !bg-transparent;
}

article .highlight > div table tr td:first-of-type pre {
@apply pr-[4px];
}

article .highlight > div table tr td:first-of-type pre code span {
@apply !mr-0 block min-w-[18px] !p-0 text-right text-white/40;
}

article .highlight > div table tr td:last-of-type {
@apply overflow-auto;
}
}
1 change: 1 addition & 0 deletions themes/paper/assets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Place custom css here. */
Loading

0 comments on commit 3807859

Please sign in to comment.