Compare commits
2 Commits
b1619dde4a
...
4560f2b33b
| Author | SHA1 | Date | |
|---|---|---|---|
| 4560f2b33b | |||
| adf93fe21e |
132
.gitignore
vendored
Normal file
132
.gitignore
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/node,hugo,visualstudiocode
|
||||
# Edit at https://www.gitignore.io/?templates=node,hugo,visualstudiocode
|
||||
|
||||
### Hugo ###
|
||||
# Generated files by hugo
|
||||
/public/
|
||||
/resources/_gen/
|
||||
|
||||
# Executable may be added to repository
|
||||
hugo.exe
|
||||
hugo.darwin
|
||||
hugo.linux
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# rollup.js default build output
|
||||
dist/
|
||||
|
||||
# Uncomment the public line if your project uses Gatsby
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
|
||||
# public
|
||||
|
||||
# Storybook build outputs
|
||||
.out
|
||||
.storybook-out
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# Temporary folders
|
||||
tmp/
|
||||
temp/
|
||||
|
||||
### VisualStudioCode ###
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
### VisualStudioCode Patch ###
|
||||
# Ignore all local history of files
|
||||
.history
|
||||
|
||||
# End of https://www.gitignore.io/api/node,hugo,visualstudiocode
|
||||
20
config.toml
20
config.toml
@ -1,3 +1,23 @@
|
||||
baseURL = "http://example.org/"
|
||||
languageCode = "en-us"
|
||||
title = "My New Hugo Site"
|
||||
theme = "hugo-w2ng"
|
||||
pygmentsStyle="github"
|
||||
|
||||
[markup]
|
||||
[markup.goldmark]
|
||||
[markup.goldmark.extensions]
|
||||
definitionList = true
|
||||
footnote = true
|
||||
linkify = true
|
||||
strikethrough = true
|
||||
table = true
|
||||
taskList = true
|
||||
typographer = true
|
||||
[markup.goldmark.parser]
|
||||
attribute = true
|
||||
autoHeadingID = true
|
||||
[markup.goldmark.renderer]
|
||||
hardWraps = false
|
||||
unsafe = true
|
||||
xHTML = false
|
||||
@ -73,8 +73,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
||||
|
||||
#### Code block with backticks
|
||||
|
||||
```
|
||||
html
|
||||
``` html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
title: "中文Markdown测试"
|
||||
date: 2020-01-04T20:41:51+08:00
|
||||
draft: true
|
||||
---
|
||||
|
||||
# 中文网页重设与排版:_Typo.css_
|
||||
|
||||
21
themes/hugo-w2ng/assets/css/dev/postcss.config.js
Normal file
21
themes/hugo-w2ng/assets/css/dev/postcss.config.js
Normal file
@ -0,0 +1,21 @@
|
||||
// Custom PurgeCSS extractor for Tailwind that allows special characters in
|
||||
// class names.
|
||||
//
|
||||
// https://github.com/FullHuman/purgecss#extractor
|
||||
class TailwindExtractor {
|
||||
static extract(content) {
|
||||
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
|
||||
}
|
||||
}
|
||||
|
||||
const themeDir = __dirname + '/../../../';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
path: [themeDir]
|
||||
}),
|
||||
require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'),
|
||||
require('autoprefixer'),
|
||||
]
|
||||
}
|
||||
33
themes/hugo-w2ng/assets/css/postcss.config.js
Normal file
33
themes/hugo-w2ng/assets/css/postcss.config.js
Normal file
@ -0,0 +1,33 @@
|
||||
// Custom PurgeCSS extractor for Tailwind that allows special characters in
|
||||
// class names.
|
||||
//
|
||||
// https://github.com/FullHuman/purgecss#extractor
|
||||
class TailwindExtractor {
|
||||
static extract(content) {
|
||||
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
|
||||
}
|
||||
}
|
||||
|
||||
const themeDir = __dirname + '/../../';
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-import')({
|
||||
path: [themeDir]
|
||||
}),
|
||||
require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'),
|
||||
require('@fullhuman/postcss-purgecss')({
|
||||
content: [themeDir + 'layouts/**/*.html'],
|
||||
extractors: [
|
||||
{
|
||||
extractor: TailwindExtractor,
|
||||
extensions: ['html']
|
||||
}],
|
||||
fontFace: true
|
||||
}),
|
||||
require('autoprefixer')({
|
||||
grid: true
|
||||
}),
|
||||
require('postcss-reporter'),
|
||||
]
|
||||
}
|
||||
7
themes/hugo-w2ng/assets/css/site.css
Normal file
7
themes/hugo-w2ng/assets/css/site.css
Normal file
@ -0,0 +1,7 @@
|
||||
body {
|
||||
font-family: Optima, Candara, Calibri, Arial, sans-serif;
|
||||
}
|
||||
code {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
font-size: 85%;
|
||||
}
|
||||
71
themes/hugo-w2ng/assets/css/styles.css
Normal file
71
themes/hugo-w2ng/assets/css/styles.css
Normal file
@ -0,0 +1,71 @@
|
||||
/* 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";
|
||||
|
||||
h1 {
|
||||
@apply text-4xl;
|
||||
}
|
||||
h2 {
|
||||
@apply text-2xl;
|
||||
}
|
||||
h3 {
|
||||
@apply text-lg;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
@apply font-bold leading-loose;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 5px solid #ccc;
|
||||
@apply bg-gray-100 p-3 mx-3 my-2;
|
||||
}
|
||||
|
||||
table {
|
||||
@apply m-auto;
|
||||
border-top: 1px solid #666;
|
||||
border-bottom: 1px solid #666;
|
||||
}
|
||||
table thead th {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
@apply p-1;
|
||||
}
|
||||
thead,
|
||||
tfoot,
|
||||
tr:nth-child(even) {
|
||||
@apply bg-gray-200;
|
||||
}
|
||||
|
||||
pre {
|
||||
border: 1px solid #ddd;
|
||||
box-shadow: 5px 5px 5px #eee;
|
||||
@apply overflow-x-auto p-4;
|
||||
}
|
||||
code {
|
||||
@apply bg-gray-200;
|
||||
}
|
||||
pre code {
|
||||
@apply bg-transparent;
|
||||
}
|
||||
|
||||
ul {
|
||||
@apply text-base pl-8 list-disc;
|
||||
}
|
||||
|
||||
ol {
|
||||
@apply text-base pl-8 list-decimal;
|
||||
}
|
||||
|
||||
kbd {
|
||||
@apply text-xs inline-block rounded border px-1 py-5 align-middle font-normal font-mono shadow;
|
||||
}
|
||||
7
themes/hugo-w2ng/assets/css/tailwind.config.js
Normal file
7
themes/hugo-w2ng/assets/css/tailwind.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
theme: {
|
||||
extend: {}
|
||||
},
|
||||
variants: {},
|
||||
plugins: []
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<div id="content">
|
||||
<div id="content" class="">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
{{ define "main" }}
|
||||
{{ range .Pages }}
|
||||
<article class="">
|
||||
<h1 class=""><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@ -0,0 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<article class="max-w-3xl mx-auto p-4">
|
||||
<h1 class="">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@ -0,0 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<article class="">
|
||||
<h1 class="">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@ -0,0 +1,7 @@
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $style := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/dev/postcss.config.js") }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
{{ else }}
|
||||
{{ $style := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ end }}
|
||||
21
themes/hugo-w2ng/package.json
Normal file
21
themes/hugo-w2ng/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "hugo-w2ng",
|
||||
"version": "1.0.0",
|
||||
"description": "a hugo theme for wrong.wang",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@fullhuman/postcss-purgecss": "^1.3.0",
|
||||
"postcss-reporter": "^6.0.1",
|
||||
"tailwindcss": "^1.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [
|
||||
"theme",
|
||||
"tailwind"
|
||||
],
|
||||
"author": "Wrong Wang",
|
||||
"license": "MIT"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user