diff --git a/.gitignore b/.gitignore index 00741cb..00adeaa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store -.idea/ \ No newline at end of file +.idea/ +node_modules \ No newline at end of file diff --git a/assets/css/postcss.config.js b/assets/css/postcss.config.js new file mode 100644 index 0000000..5b84762 --- /dev/null +++ b/assets/css/postcss.config.js @@ -0,0 +1,9 @@ +const themeDir = __dirname + '/../../'; + +module.exports = { + plugins: [ + require('postcss-import')({ path: [themeDir] }), + require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'), + require('autoprefixer')(), + ] +} \ No newline at end of file diff --git a/assets/css/site.css b/assets/css/site.css new file mode 100644 index 0000000..7836339 --- /dev/null +++ b/assets/css/site.css @@ -0,0 +1,162 @@ +.post-content { + line-height: 1.625; + color: #424242; + } + + .post-content h2 { + font-size: 140%; + } + + .post-content h3 { + font-size: 120%; + } + + .post-content h2, + .post-content h3 { + margin: 2rem 0 0.3rem; + font-weight: 700; + } + + .post-content h2:target, + .post-content h3:target { + padding-top: 5rem; + } + + .post-content ul, + .post-content ol { + list-style-type: initial; + padding: 0.5rem 0 1rem 1.5rem; + } + + .post-content ul.list-none { + padding: 0 0 0 1rem; + } + + .post-content ul ul { + list-style-type: circle; + padding-left: 1.5rem; + } + + .post-content ul ul ul { + list-style-type: square; + margin-bottom: 0px; + } + + .post-content ul.list-none { + list-style-type: none; + } + + .post-content p code, + .post-content li code { + background-color: #f0f3f3; + padding: 0.1rem 0.4rem; + border-radius: 3px; + color: #805ad5; + } + + .post-content p { + margin: 0.5rem 0 1rem; + } + + .post-content img { + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); + margin: 1.5rem auto; + } + + .post-content a { + color: #0e7490; + text-decoration: none; + font-weight: 500; + box-shadow: inset 0 -0.125em 0 0 #fff, inset 0 -0.375em 0 0 rgb(165 243 252 / 40%); + } + + .post-content a:hover { + color: #0b4657; + } + + .dark .post-content a:hover { + color: #0e7490; + } + + .dark .post-content a { + color: #2fbfe7; + box-shadow: inset 0 -0.125em 0 0 #000, inset 0 -0.375em 0 0 rgb(165 243 252 / 40%); + } + + .post-content blockquote { + color: #9e9e9e; + padding-left: 1rem; + border-left-width: 4px; + border-color: #9e9e9e; + font-style: italic; + } + + .post-content pre, + .post-content .highlight { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + font-size: 0.875rem; + } + + ::selection { + background: #e9d8fd; + color: #202684; + /* WebKit/Blink Browsers */ + } + + ::-moz-selection { + background: #e9d8fd; + color: #202684; + /* Gecko Browsers */ + } + + a:focus { + outline: none; + background: #e9d8fd; + } + + .dark a:focus { + outline: none; + background: #000000; + } + + + /* 侧边导航 */ + + #menu-content > ul { + padding: none; + } + + #TableOfContents > ul { + list-style-type: none; + padding-left: 0; + } + + #TableOfContents li { + padding-top: 0.5em; + } + + #TableOfContents > ul > li ul { + list-style-type: none; + padding-left: 1.5em; + } + + #TableOfContents a { + transition: all 0.2s ease !important; + } + #TableOfContents a:hover { + color: #1a202c !important; + transform: translateX(2px) !important; + } + + .dark #TableOfContents a:hover { + color: #fdfdfd !important; + transform: translateX(2px) !important; + } + + .my-iconfont { + font-family: "iconfont" !important; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } \ No newline at end of file diff --git a/assets/css/styles.css b/assets/css/styles.css new file mode 100644 index 0000000..909e46a --- /dev/null +++ b/assets/css/styles.css @@ -0,0 +1,8 @@ +/* Tailwind base - put variables under: tailwind.config.js */ +@import "node_modules/tailwindcss/base"; +/* Tailwind component classes registered by plugins*/ +@import "node_modules/tailwindcss/components"; +/* Site Specific */ +@import "assets/css/site"; +/* Tailwind's utility classes - generated based on config file */ +@import "node_modules/tailwindcss/utilities"; \ No newline at end of file diff --git a/assets/css/tailwind.config.js b/assets/css/tailwind.config.js new file mode 100644 index 0000000..a1381aa --- /dev/null +++ b/assets/css/tailwind.config.js @@ -0,0 +1,52 @@ +const themeDir = __dirname + '/../../'; + +module.exports = { + purge: { + content: [ + './layouts/**/*.html', + './content/**/*.md', + './content/**/*.html', + themeDir + 'layouts/**/*.html', + themeDir + 'exampleSite/content/**/*.html', + themeDir + 'exampleSite/content/**/*.md', + ], + }, + theme: { + fontFamily: { + sans: [ + 'Inter', + 'system-ui', + '-apple-system', + 'BlinkMacSystemFont', + 'Segoe UI', + 'Roboto', + 'Helvetica Neue', + 'Arial', + 'Noto Sans', + 'sans-serif', + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol', + 'Noto Color Emoji', + ], + serif: [ + 'Georgia', + 'Cambria', + 'Times New Roman', + 'Times', + 'serif', + ], + mono: [ + 'Menlo', + 'Monaco', + 'Consolas', + 'Liberation Mono', + 'Courier New', + 'monospace' + ] + }, + }, + darkMode: 'class', + variants: {}, + plugins: [], +} \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html index cd66b25..91e7824 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,9 +1,9 @@ {{ define "main" }}
-
+
-

-

/* 404 page not found. */

+

+

/* 404 page not found. */

↑ 文章归档 ↑

@@ -17,7 +17,7 @@

{{ partial "posts/popular.html" . }}
-