Skip to content

Commit

Permalink
re-add theme
Browse files Browse the repository at this point in the history
  • Loading branch information
netops2devops committed May 27, 2024
1 parent 298e4e4 commit 92716d2
Show file tree
Hide file tree
Showing 189 changed files with 12,494 additions and 0 deletions.
44 changes: 44 additions & 0 deletions themes/PaperModX/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''

---

<!--
## READ BEFORE OPENING ISSUES
Please fill the template below
- **DO NOT** ask for instructions.
- Search for previous issues/ pull requests
-->

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

- Device/Os: [e.g. Android 10]
- Type: [e.g. Desktop/Mobile]
- Browser and version [e.g. Chrome 86.0]:
- Hugo Version [ >=0.83.0 expected]:
- Theme Version [e.g. v4.0, master, or commit-id ]:

**Steps to reproduce the behavior:**
<!--
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->

**Expected behavior**:
<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

**Additional context**
<!--Add any other context about the problem here. -->
1 change: 1 addition & 0 deletions themes/PaperModX/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
7 changes: 7 additions & 0 deletions themes/PaperModX/.github/ISSUE_TEMPLATE/new-blank-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: New Blank Issue
about: Anything other than bug report
title: ""
labels: ""
assignees: ""
---
17 changes: 17 additions & 0 deletions themes/PaperModX/.github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 7
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 3
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- keep
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
68 changes: 68 additions & 0 deletions themes/PaperModX/.github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml
name: Deploy Hugo site to Pages

on:
push:
paths-ignore:
- "README.md"
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Configure Pages
id: pages
uses: actions/configure-pages@v3

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true

- name: Build
run: |
hugo \
--minify --verbose -D \
--buildFuture \
--environment production \
--themesDir ../.. --theme hugo-PaperModX \
--baseURL "${{ steps.pages.outputs.base_url }}/"
working-directory: exampleSite
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./exampleSite/public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
Empty file.
5 changes: 5 additions & 0 deletions themes/PaperModX/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"search.exclude": {
"**/public": true
}
}
22 changes: 22 additions & 0 deletions themes/PaperModX/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2020 nanxiaobei and adityatelange
Copyright (c) 2021 adityatelange

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.
9 changes: 9 additions & 0 deletions themes/PaperModX/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
run-default:
cd exampleSite && hugo server -D --gc -p 13131 --config config.default.yml

run-profile-mode:
cd exampleSite && hugo server -D --gc -p 13131 --config config.profileMode.yml

chroma-css:
hugo gen chromastyles --style=onedark > assets/css/lib/chroma-dark.css
hugo gen chromastyles --style=tango > assets/css/lib/chroma-light.css
138 changes: 138 additions & 0 deletions themes/PaperModX/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# PaperModX

PaperModX is a forked version of [PaperMod](https://github.com/adityatelange/hugo-PaperMod),
it aims at adding new features and improving code quality,
makes it easier to read and modify by anyone with basic knowledge of Hugo and HTML.

Features and changes:
- Table of Contents (ToC) floating on the side
- InstantClick integration
- Social icons from [Simple Icons](https://simpleicons.org/)
- Opinionated UI enhancements

## Getting started

You can use [reorx/papermodx-example](https://github.com/reorx/papermodx-example) as a boilerplate to create a new Hugo site with PaperModX theme. For detailed instructions please see the README of papermodx-example repo.

## Table of Contents (ToC) floating on the side

By adding config:

```yaml
params:
TocSide: 'left' # or 'right'
```
ToC will float on the left/right side of the page.
You can take a look at how `'right'` feels like in [Installation | Update](https://reorx.github.io/hugo-PaperModX/docs/installation/).
The ToC box is responsive, it only shows on the side when minimum screen size is 1440px.
This feature is enabled on this site.
## InstantClick integration
By adding config:
```yaml
params:
EnableInstantClick: true
```
[InstantClick](http://instantclick.io/) will be enabled,
making navigation behaves like Single Page Application.
Note that `/search` pages are omitted from InstantClick
to prevent conflicts from search's JavaScript,
this may be changed in the future after refactoring those scripts.

Another thing to notice is smooth scrolling will be disabled
if InstantClick is enabled, because they both listen click
event on every `<a>` tags. IMO smooth scrolling is not very useful
so it has to give way to InstantCllick.

This feature is enabled on this site.


## Give links an accent color.

Though PaperModX is designed to be minimal, accent color is still essential.
It's a good way to show personality and make your site feels more delightful.

The default color is a purple vibe,
you can customize the colors of link, link underline and their hover variants
by override the following css variables in `assets/css/extended/custom.css` of your site.

```css
:root {
--link-color: var(--primary);
--link-hover-color: #573eaa;
--link-underline-shadow: 0 1px 0 var(--link-color);
--link-hover-underline-color: #573eaa;
--link-hover-underline-shadow: 0 2px 0 var(--link-hover-underline-color);
}
```


## Customize pagniator size

In section pages, if you want the paginator size be different from the
[global config](https://gohugo.io/templates/pagination/#configure-pagination),
you can add `paginate` in the frontmatter to customize.

```yaml
---
paginate: 10
---
```


## Menus external link

You can add `external: true` to a menu item's params to mark it as an external link,
this will add a small icon to the end, and make the link open in new tab when clicked.

```yaml
menu:
main:
- name: "@Author"
url: "https://reorx.com"
params:
external: true
```


## Highlight code with Chroma, no bullshit

PaperMod uses highlight.js to highlight code blocks.
In PaperModX, we use Chroma which is the recommended way in Hugo's
[official docs](https://gohugo.io/content-management/syntax-highlighting/#:~:text=Hugo%20uses%20Chroma%20as%20its%20code%20highlighter%3B%20it%20is%20built%20in%20Go%20and%20is%20really%2C%20really%20fast),
thus changing theme is easily supported.

By default the themes are `github` for light and `dracula` for dark,
you can change it by adding `chroma-light.css` and `chroma-dark.css`
in site's `assets/css/lib` directory.


## Social icons from Simple Icons

Add social icons with `-simple` suffix from [Simple Icons](https://simpleicons.org/).

Available icons:
- github-simple
- rss-simple
- telegram-simple
- twitter-simple
- pinboard-simple

The icons are moved from `layouts/partials/svg.html` to `data/svg.toml`,
makes it easier to maintain, it's now possible to have an index page
to show all the icons, check it out at: [Icons Preview](https://reorx.github.io/hugo-PaperModX/docs/icons_preview/)


## Opinionated UI enhancements

- Distinguish home page width and post page width, post page is wider
(800px) for better readability, you can change it by `--post-width` in `theme-vars.css`.
- Menu links are always bold, this feels more consistent when clicking around. Active links have deeper color.
11 changes: 11 additions & 0 deletions themes/PaperModX/assets/css/common/404.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.not-found {
position: absolute;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
height: 80%;
font-size: 160px;
font-weight: 700;
}
44 changes: 44 additions & 0 deletions themes/PaperModX/assets/css/common/archive.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.archive-posts {
width: 100%;
font-size: 16px;
}

.archive-year {
margin-top: 40px;
}

.archive-year:not(:last-of-type) {
border-bottom: 2px solid var(--border);
}

.archive-month {
display: flex;
align-items: flex-start;
padding: 10px 0;
}

.archive-month-header {
margin: 22px 0;
width: 200px;
}

.archive-month:not(:last-of-type) {
border-bottom: 1px solid var(--border);
}

.archive-entry {
position: relative;
padding: 5px;
margin: 10px 0;
}

.archive-entry-title {
margin: 5px 0;
font-weight: 400;
}

.archive-count,
.archive-meta {
color: var(--secondary);
font-size: 14px;
}
Loading

0 comments on commit 92716d2

Please sign in to comment.