Skip to content

Commit

Permalink
Merge pull request #39 from Junyi-99/feat-experimental-config
Browse files Browse the repository at this point in the history
Merge feat-experimental-config
  • Loading branch information
Junyi-99 authored Apr 27, 2024
2 parents 4d6fbc8 + 007dc9d commit 8b402ff
Show file tree
Hide file tree
Showing 159 changed files with 1,174 additions and 854 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public/
32 changes: 32 additions & 0 deletions Features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Features

1. Automatic Dark/Light mode based on system settings
2. Dark/Light mode switcher
3. Automatic Diagram dark/light switch
4. Automatic Giscus dark/light switch

| Feature (light/dark mode) | Anubis2 |
| ---------------------------------------------------------------------- | ------- |
| Line Number (table) and Hilight Lines ||
| Line Number (true) and Hilight Lines ||
| Line Number (inline) and Hilight Lines ||
| Line Number (false) and Hilight Lines ||
| Line Number (table) and Hilight Lines and Anchor Line ||
| Line Number (table) and Hilight Inline ||
| Highlight Shortcode, Line Number (table) and Hilight Lines and Anchor ||
| Highlight Shortcode, Line Number (inline) and Hilight Lines and Anchor ||
| Highlight Shortcode, Line Number (false) and Hilight Lines and Anchor ||
| Mermaid Support (No Config, Lazy Load, Dark/Light Auto Switch) ||
| MathJax Support (No Config, Lazy Load, Dark/Light Auto Switch) ||
| Giscus Support (Dark/Light Auto Switch) ||
| Umami Support (Dark/Light Auto Switch) ||
| Multi-Author Support ||
| Multi-Language Support ||
| Support for \<code\> tag ||
| Support for \<pre\> tag ||
| Support for \<kbd\> tag ||
| Support for \<mark\> tag ||
| Passed CodePreKbdMark test ||
| Passed All 8 Summary Rendering Tests | ✅ 8/8 |
| Mermaid dark/light manual switch ||
| Mermaid dark/light auto switch ||
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ 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.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Anubis2 is another simple minimalist theme for [Hugo blog engine](https://gohugo
## Highlighted Features

- Multilingual
- Dark / Light mode
- Dark / Light mode (Automatic switch based on system settings)
- Table of Contents
- Comment Support (Giscus, Disque, ISSO, Utterances, GraphComment)
- Analytics (Google, Umami)
- RSS feeds
- Mobile Support
- [Full Features](wiki/Full-Features)

## Installation

Expand Down
1 change: 0 additions & 1 deletion archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

2 changes: 1 addition & 1 deletion assets/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ html[data-theme='dark'] {

--svg-color: #ccc;
--svg-state-color: #ff5858;
}
}
2 changes: 1 addition & 1 deletion assets/css/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ html[data-theme="light"] {
--pre-bg-color: #eff1f2;
--pre-border-color: #e1e5e9;
--kbd-bg-color: #f7f7f7;

--bq-color: #ccc;
--hr-color: #ccc;

Expand Down
105 changes: 72 additions & 33 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ kbd {
line-height: 154%;
border-radius: 6px;
border: 1px solid var(--pre-border-color);
overflow: auto;
}

/* <code> tag */
Expand Down Expand Up @@ -212,8 +211,68 @@ pre kbd kbd {
margin-right: 0.2em;
}

/* ```python``` like */
pre code {
p code,
p kbd {
padding: 0.1em 0.3em;
/* top, bottom */
/* margin-right: 4px; */
}

td pre {
border: none;
/* padding: 0px; */
border-radius: 0px;
}

td:first-child pre {
padding-right: 0;
}

td:last-child pre {
padding-left: 0;
}

td pre code {
/* when there is a line number grid */
padding: 0px;
display: flex;
flex-direction: column;
border-radius: 0px;
/* padding-top: 4px; */
/* padding-bottom: 4px; */
}

div.highlight {
border-radius: 6px;
border: 1px solid var(--pre-border-color);
margin-bottom: 14px;
}

div.highlight pre {
border: none;
display: grid;
margin: 0px;
overflow: auto; /* Have to add this line, otherwise the "pre" and "code" will have different width */
/* padding-left: 10px; */
/* padding-right: 10px; */
/* padding-top: 10px; */
/* padding-bottom: 10px; */
}

div.highlight code {
padding-left: 0px;
padding-right: 0px;
}

div.highlight code a:hover,
div.highlight code a:focus {
color: white;
border-bottom: 1px solid white;
/*for markup.highlight.anchorLineNos = true*/
}

pre code,
pre kbd {
color: inherit;
background-color: inherit;
border: none;
Expand Down Expand Up @@ -679,6 +738,8 @@ code.has-jax {
.post-translations>li:not(:last-child)::after {
content: "|";
display: inline-block;
margin-left: 4px;
margin-right: 4px;
}

.post-translations>li a {
Expand Down Expand Up @@ -794,33 +855,30 @@ ul.footer-menu>li {
/* Copy code */
.highlight {
position: relative;
overflow: auto;
}

.highlight pre {
padding-right: 75px;
overflow: hidden;
}

.highlight:hover .highlight-copy-btn {
display: inline-block;
border: 1px solid rgba(255, 255, 255, 0.1);
border: 1px solid rgba(0, 0, 0, 0.5);
}

.highlight-copy-btn {
display: none;
position: absolute;
top: 18px;
right: 2px;
border: 0;
top: 0px;
right: 0px;
border: 1px solid rgba(0, 0, 0, 0.5);
border-radius: 6px;
padding: 1px;
font-size: 0.7em;
line-height: 1.8;
color: #fff;
background-color: rgba(255, 255, 255, 0.1);
min-width: 25px;
min-width: 22px;
text-align: center;
transition: border 0.3s;
transition: background-color 0.3s;
}

.highlight-copy-btn:hover {
Expand Down Expand Up @@ -888,23 +946,4 @@ ul.footer-menu>li {
.post-pagination .pagination-item {
max-width: 10em;
}
}

{{ range site.Params.customCSS }}
{{ $custom := resources.Get . }}

{{ $custom.Content }}
{{ end }}

{{ if site.Params.isso.enabled }}

#isso-thread .textarea {
color: #000;
}

#isso-thread .isso-feedlink {
position: relative;
z-index: 1;
}

{{ end }}
}
2 changes: 1 addition & 1 deletion assets/images/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/js/copy-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ document.addEventListener("DOMContentLoaded", function(event) {
// Add copy button to code blocks
let highlightBlocks = document.getElementsByClassName('highlight');
Array.prototype.forEach.call(highlightBlocks, addCopyButton);
}, false);
}, false);
12 changes: 6 additions & 6 deletions assets/js/load-mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(function(window){
'use strict'

const elementCode = '.mermaid'
const loadMermaid = function(theme) {
window.mermaid.initialize({theme})
Expand All @@ -26,7 +26,7 @@
}
});
} catch (error) {
reject(error)
reject(error)
}
})
}
Expand All @@ -46,11 +46,11 @@
}
});
} catch (error) {
reject(error)
reject(error)
}
})
}
}

const init = ()=>{
saveOriginalData()
.catch( console.error )
Expand All @@ -66,4 +66,4 @@
})
}
window.initMermaid = init
})(window);
})(window);
2 changes: 1 addition & 1 deletion data/social.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ social_icons:
tumblr:
weibo:
x: https://twitter.com/%s
zhihu: https://www.zhihu.com/people/%s
zhihu: https://www.zhihu.com/people/%s
2 changes: 1 addition & 1 deletion exampleSiteMultilingual/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.hugo_build.lock
public/
resources/
resources/
11 changes: 11 additions & 0 deletions exampleSiteMultilingual/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
# - id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
9 changes: 9 additions & 0 deletions exampleSiteMultilingual/assets/custom-css/custom1.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import 'foundation/vars';

junyi {
display: block;
font: 100% $font-stack;
color: $primary-color;
background-color: $background-color;
margin-top: 1em;
}
7 changes: 7 additions & 0 deletions exampleSiteMultilingual/assets/custom-css/custom2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anubis-custom-style {
background-color: pink;
color: black;
padding: 1em;
border-radius: 0.3em;
border: 1px solid black;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$font-stack: Helvetica, sans-serif;
$primary-color: rgb(255, 255, 168);
$background-color: rgb(85, 85, 85);
1 change: 0 additions & 1 deletion exampleSiteMultilingual/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
+++
author = "Hugo Authors"
+++

24 changes: 0 additions & 24 deletions exampleSiteMultilingual/content/about-subpage.md

This file was deleted.

24 changes: 0 additions & 24 deletions exampleSiteMultilingual/content/about-subpage.pl.md

This file was deleted.

Loading

0 comments on commit 8b402ff

Please sign in to comment.